Explorar el Código

Fix broken get_latest_version implementations

Simon Legner hace 5 años
padre
commit
c0290b816d

+ 2 - 2
lib/docs/scrapers/ansible.rb

@@ -75,8 +75,8 @@ module Docs
     end
 
     def get_latest_version(opts)
-      doc = fetch_doc('https://docs.ansible.com/ansible/latest/index.html', opts)
-      doc.at_css('.version').content.strip
+      tags = get_github_tags('ansible', 'ansible', opts)
+      tags[0]['name'][1..-1]
     end
   end
 end

+ 1 - 3
lib/docs/scrapers/mdn/mdn.rb

@@ -22,9 +22,7 @@ module Docs
     HTML
 
     def get_latest_version(opts)
-      json = fetch_json("https://developer.mozilla.org/en-US/docs/feeds/json/tag/#{options[:mdn_tag]}", opts)
-      dates = json.map { |i| i['pubdate'] }
-      DateTime.parse(dates.max).to_time.to_i
+      get_latest_github_commit_date('mdn', 'content', opts)
     end
 
     private

+ 1 - 2
lib/docs/scrapers/numpy.rb

@@ -66,8 +66,7 @@ module Docs
     end
 
     def get_latest_version(opts)
-      html = fetch('https://docs.scipy.org/doc/', opts)
-      html.scan(/Numpy ([0-9.]+) Reference Guide/)[0][0]
+      get_latest_github_release('numpy', 'numpy', opts)
     end
   end
 end

+ 1 - 1
lib/docs/scrapers/vue.rb

@@ -34,7 +34,7 @@ module Docs
     end
 
     def get_latest_version(opts)
-      get_latest_github_release('vuejs', 'vue', opts)
+      get_latest_github_release('vuejs', 'vue-next', opts)
     end
   end
 end