Showing the changes to lib/docs (154 of 231 files). Show all
Unified · Split
| @@ -152,7 +152,6 @@ module Docs · 151 unmodified lines | |||
| 152 | end | 152 | end |
| 153 | end | 153 | end |
| 154 | 154 | ||
| 155 | |||
| 156 | def initialize | 155 | def initialize |
| 157 | raise NotImplementedError, "#{self.class} is an abstract class and cannot be instantiated." if self.class.abstract | 156 | raise NotImplementedError, "#{self.class} is an abstract class and cannot be instantiated." if self.class.abstract |
| 158 | end | 157 | end |
| @@ -164,5 +163,104 @@ module Docs · 5 unmodified lines | |||
| 164 | def build_pages(&block) | 163 | def build_pages(&block) |
| 165 | raise NotImplementedError | 164 | raise NotImplementedError |
| 166 | end | 165 | end |
| 166 | |||
| 167 | def get_scraper_version(opts) | ||
| 168 | if self.class.method_defined?(:options) and !options[:release].nil? | ||
| 169 | options[:release] | ||
| 170 | else | ||
| 171 | # If options[:release] does not exist, we return the Epoch timestamp of when the doc was last modified in DevDocs production | ||
| 172 | json = fetch_json('https://devdocs.io/docs.json', opts) | ||
| 173 | items = json.select {|item| item['name'] == self.class.name} | ||
| 174 | items = items.map {|item| item['mtime']} | ||
| 175 | items.max | ||
| 176 | end | ||
| 177 | end | ||
| 178 | |||
| 179 | # Should return the latest version of this documentation | ||
| 180 | # If options[:release] is defined, it should be in the same format | ||
| 181 | # If options[:release] is not defined, it should return the Epoch timestamp of when the documentation was last updated | ||
| 182 | # If the docs will never change, simply return '1.0.0' | ||
| 183 | def get_latest_version(opts) | ||
| 184 | raise NotImplementedError | ||
| 185 | end | ||
| 186 | |||
| 187 | # Returns whether or not this scraper is outdated. | ||
| 188 | # | ||
| 189 | # The default implementation assumes the documentation uses a semver(-like) approach when it comes to versions. | ||
| 190 | # Patch updates are ignored because there are usually little to no documentation changes in bug-fix-only releases. | ||
| 191 | # | ||
| 192 | # Scrapers of documentations that do not use this versioning approach should override this method. | ||
| 193 | # | ||
| 194 | # Examples of the default implementation: | ||
| 195 | # 1 -> 2 = outdated | ||
| 196 | # 1.1 -> 1.2 = outdated | ||
| 197 | # 1.1.1 -> 1.1.2 = not outdated | ||
| 198 | def is_outdated(scraper_version, latest_version) | ||
| 199 | scraper_parts = scraper_version.to_s.split(/\./).map(&:to_i) | ||
| 200 | latest_parts = latest_version.to_s.split(/\./).map(&:to_i) | ||
| 201 | |||
| 202 | # Only check the first two parts, the third part is for patch updates | ||
| 203 | [0, 1].each do |i| | ||
| 204 | break if i >= scraper_parts.length or i >= latest_parts.length | ||
| 205 | return true if latest_parts[i] > scraper_parts[i] | ||
| 206 | return false if latest_parts[i] < scraper_parts[i] | ||
| 207 | end | ||
| 208 | |||
| 209 | false | ||
| 210 | end | ||
| 211 | |||
| 212 | private | ||
| 213 | |||
| 214 | # | ||
| 215 | # Utility methods for get_latest_version | ||
| 216 | # | ||
| 217 | |||
| 218 | def fetch(url, opts) | ||
| 219 | headers = {} | ||
| 220 | |||
| 221 | if opts.key?(:github_token) and url.start_with?('https://api.github.com/') | ||
| 222 | headers['Authorization'] = "token #{opts[:github_token]}" | ||
| 223 | end | ||
| 224 | |||
| 225 | opts[:logger].debug("Fetching #{url}") | ||
| 226 | response = Request.run(url, { connecttimeout: 15, headers: headers }) | ||
| 227 | |||
| 228 | if response.success? | ||
| 229 | response.body | ||
| 230 | else | ||
| 231 | reason = response.timed_out? ? "Timed out while connecting to #{url}" : "Couldn't fetch #{url} (response code #{response.code})" | ||
| 232 | opts[:logger].error(reason) | ||
| 233 | raise reason | ||
| 234 | end | ||
| 235 | end | ||
| 236 | |||
| 237 | def fetch_doc(url, opts) | ||
| 238 | body = fetch(url, opts) | ||
| 239 | Nokogiri::HTML.parse(body, nil, 'UTF-8') | ||
| 240 | end | ||
| 241 | |||
| 242 | def fetch_json(url, opts) | ||
| 243 | JSON.parse fetch(url, opts) | ||
| 244 | end | ||
| 245 | |||
| 246 | def get_npm_version(package, opts) | ||
| 247 | json = fetch_json("https://registry.npmjs.com/#{package}", opts) | ||
| 248 | json['dist-tags']['latest'] | ||
| 249 | end | ||
| 250 | |||
| 251 | def get_latest_github_release(owner, repo, opts) | ||
| 252 | release = fetch_json("https://api.github.com/repos/#{owner}/#{repo}/releases/latest", opts) | ||
| 253 | tag_name = release['tag_name'] | ||
| 254 | tag_name.start_with?('v') ? tag_name[1..-1] : tag_name | ||
| 255 | end | ||
| 256 | |||
| 257 | def get_github_tags(owner, repo, opts) | ||
| 258 | fetch_json("https://api.github.com/repos/#{owner}/#{repo}/tags", opts) | ||
| 259 | end | ||
| 260 | |||
| 261 | def get_github_file_contents(owner, repo, path, opts) | ||
| 262 | json = fetch_json("https://api.github.com/repos/#{owner}/#{repo}/contents/#{path}", opts) | ||
| 263 | Base64.decode64(json['content']) | ||
| 264 | end | ||
| 167 | end | 265 | end |
| 168 | end | 266 | end |
| @@ -29,7 +29,7 @@ module Docs · 28 unmodified lines | |||
| 29 | 29 | ||
| 30 | def request_one(url) | 30 | def request_one(url) |
| 31 | assert_source_directory_exists | 31 | assert_source_directory_exists |
| 32 | Response.new read_file(url_to_path(url)), URL.parse(url) | 32 | Response.new read_file(File.join(source_directory, url_to_path(url))), URL.parse(url) |
| 33 | end | 33 | end |
| 34 | 34 | ||
| 35 | def request_all(urls) | 35 | def request_all(urls) |
| @@ -50,7 +50,7 @@ module Docs · 14 unmodified lines | |||
| 50 | end | 50 | end |
| 51 | 51 | ||
| 52 | def read_file(path) | 52 | def read_file(path) |
| 53 | File.read(File.join(source_directory, path)) | 53 | File.read(path) |
| 54 | rescue | 54 | rescue |
| 55 | instrument 'warn.doc', msg: "Failed to open file: #{path}" | 55 | instrument 'warn.doc', msg: "Failed to open file: #{path}" |
| 56 | nil | 56 | nil |
| @@ -57,6 +57,11 @@ module Docs · 56 unmodified lines | |||
| 57 | node.parent.after(node) | 57 | node.parent.after(node) |
| 58 | end | 58 | end |
| 59 | 59 | ||
| 60 | css('.signature').each do |node| | ||
| 61 | non_text_children = node.xpath('node()[not(self::text())]') | ||
| 62 | non_text_children.to_a.reverse.each { |child| node.parent.add_next_sibling(child) } | ||
| 63 | end | ||
| 64 | |||
| 60 | css('pre').each do |node| | 65 | css('pre').each do |node| |
| 61 | node['data-language'] = 'elixir' | 66 | node['data-language'] = 'elixir' |
| 62 | node.content = node.content | 67 | node.content = node.content |
| @@ -4,6 +4,11 @@ module Docs · 3 unmodified lines | |||
| 4 | def call | 4 | def call |
| 5 | css('hr') | 5 | css('hr') |
| 6 | 6 | ||
| 7 | if at_css('h1').nil? | ||
| 8 | title = current_url.normalized_path[1..-1].gsub(/-/, ' ') | ||
| 9 | doc.children.before("<h1>#{title}</h1>") | ||
| 10 | end | ||
| 11 | |||
| 7 | css('div.highlighter-rouge').each do |node| | 12 | css('div.highlighter-rouge').each do |node| |
| 8 | lang = node['class'][/language-(\w+)/, 1] | 13 | lang = node['class'][/language-(\w+)/, 1] |
| 9 | node['data-language'] = lang if lang | 14 | node['data-language'] = lang if lang |
| @@ -2,7 +2,8 @@ module Docs · 1 unmodified line | |||
| 2 | class Homebrew | 2 | class Homebrew |
| 3 | class EntriesFilter < Docs::EntriesFilter | 3 | class EntriesFilter < Docs::EntriesFilter |
| 4 | def get_name | 4 | def get_name |
| 5 | name = at_css('h1').content.strip | 5 | header = at_css('h1') |
| 6 | name = header.nil? ? current_url.normalized_path[1..-1].gsub(/-/, ' ') : header.content.strip | ||
| 6 | name.remove! %r{\(.*} | 7 | name.remove! %r{\(.*} |
| 7 | name | 8 | name |
| 8 | end | 9 | end |
| @@ -16,6 +17,7 @@ module Docs · 7 unmodified lines | |||
| 16 | Python-for-Formula-Authors | 17 | Python-for-Formula-Authors |
| 17 | Migrating-A-Formula-To-A-Tap | 18 | Migrating-A-Formula-To-A-Tap |
| 18 | Rename-A-Formula | 19 | Rename-A-Formula |
| 20 | Building-Against-Non-Homebrew-Dependencies | ||
| 19 | How-to-Create-and-Maintain-a-Tap | 21 | How-to-Create-and-Maintain-a-Tap |
| 20 | Brew-Test-Bot | 22 | Brew-Test-Bot |
| 21 | Prose-Style-Guidelines) | 23 | Prose-Style-Guidelines) |
| @@ -8,6 +8,7 @@ module Docs · 7 unmodified lines | |||
| 8 | # QML property/method header | 8 | # QML property/method header |
| 9 | css('.qmlproto').each do |node| | 9 | css('.qmlproto').each do |node| |
| 10 | id = node.at_css('tr')['id'] | 10 | id = node.at_css('tr')['id'] |
| 11 | id = node.at_css('a')['name'] if id.blank? | ||
| 11 | node.inner_html = node.at_css('td').inner_html | 12 | node.inner_html = node.at_css('td').inner_html |
| 12 | node.name = 'h3' | 13 | node.name = 'h3' |
| 13 | node['id'] = id | 14 | node['id'] = id |
| @@ -111,6 +111,7 @@ module Docs · 110 unmodified lines | |||
| 111 | css('.qmlproto').each do |node| | 111 | css('.qmlproto').each do |node| |
| 112 | title = node.content.strip | 112 | title = node.content.strip |
| 113 | id = node.at_css('tr')['id'] | 113 | id = node.at_css('tr')['id'] |
| 114 | id = node.at_css('a')['name'] if id.blank? | ||
| 114 | 115 | ||
| 115 | # Remove options | 116 | # Remove options |
| 116 | title.remove!(%r{^\[.*\] }) | 117 | title.remove!(%r{^\[.*\] }) |
| @@ -155,6 +155,10 @@ module Docs · 154 unmodified lines | |||
| 155 | end | 155 | end |
| 156 | end | 156 | end |
| 157 | 157 | ||
| 158 | def get_latest_version(opts) | ||
| 159 | get_npm_version('@angular/core', opts) | ||
| 160 | end | ||
| 161 | |||
| 158 | private | 162 | private |
| 159 | 163 | ||
| 160 | def parse(response) | 164 | def parse(response) |
| @@ -69,5 +69,9 @@ module Docs · 68 unmodified lines | |||
| 69 | self.release = '1.2.32' | 69 | self.release = '1.2.32' |
| 70 | self.base_url = "https://code.angularjs.org/#{release}/docs/partials/" | 70 | self.base_url = "https://code.angularjs.org/#{release}/docs/partials/" |
| 71 | end | 71 | end |
| 72 | |||
| 73 | def get_latest_version(opts) | ||
| 74 | get_npm_version('angular', opts) | ||
| 75 | end | ||
| 72 | end | 76 | end |
| 73 | end | 77 | end |
| @@ -87,5 +87,10 @@ module Docs · 86 unmodified lines | |||
| 87 | quickstart.html | 87 | quickstart.html |
| 88 | list_of_all_modules.html) | 88 | list_of_all_modules.html) |
| 89 | end | 89 | end |
| 90 | |||
| 91 | def get_latest_version(opts) | ||
| 92 | doc = fetch_doc('https://docs.ansible.com/ansible/latest/index.html', opts) | ||
| 93 | doc.at_css('.DocSiteProduct-CurrentVersion').content.strip | ||
| 94 | end | ||
| 90 | end | 95 | end |
| 91 | end | 96 | end |
| @@ -33,5 +33,10 @@ module Docs · 32 unmodified lines | |||
| 33 | © 2018 The Apache Software Foundation<br> | 33 | © 2018 The Apache Software Foundation<br> |
| 34 | Licensed under the Apache License, Version 2.0. | 34 | Licensed under the Apache License, Version 2.0. |
| 35 | HTML | 35 | HTML |
| 36 | |||
| 37 | def get_latest_version(opts) | ||
| 38 | doc = fetch_doc('http://httpd.apache.org/docs/', opts) | ||
| 39 | doc.at_css('#apcontents > ul a')['href'][0...-1] | ||
| 40 | end | ||
| 36 | end | 41 | end |
| 37 | end | 42 | end |
| @@ -43,5 +43,10 @@ module Docs · 42 unmodified lines | |||
| 43 | self.base_url = "https://pig.apache.org/docs/r#{release}/" | 43 | self.base_url = "https://pig.apache.org/docs/r#{release}/" |
| 44 | end | 44 | end |
| 45 | 45 | ||
| 46 | def get_latest_version(opts) | ||
| 47 | doc = fetch_doc('https://pig.apache.org/', opts) | ||
| 48 | item = doc.at_css('div[id="menu_1.2"] > .menuitem:last-child') | ||
| 49 | item.content.strip.sub(/Release /, '') | ||
| 50 | end | ||
| 46 | end | 51 | end |
| 47 | end | 52 | end |
| @@ -17,5 +17,10 @@ module Docs · 16 unmodified lines | |||
| 17 | © 2010–2018 Caolan McMahon<br> | 17 | © 2010–2018 Caolan McMahon<br> |
| 18 | Licensed under the MIT License. | 18 | Licensed under the MIT License. |
| 19 | HTML | 19 | HTML |
| 20 | |||
| 21 | def get_latest_version(opts) | ||
| 22 | doc = fetch_doc('https://caolan.github.io/async/v3/', opts) | ||
| 23 | doc.at_css('#version-dropdown > a').content.strip[1..-1] | ||
| 24 | end | ||
| 20 | end | 25 | end |
| 21 | end | 26 | end |
| @@ -22,5 +22,10 @@ module Docs · 21 unmodified lines | |||
| 22 | stub '' do | 22 | stub '' do |
| 23 | '<div></div>' | 23 | '<div></div>' |
| 24 | end | 24 | end |
| 25 | |||
| 26 | def get_latest_version(opts) | ||
| 27 | doc = fetch_doc('https://babeljs.io/docs/en/', opts) | ||
| 28 | doc.at_css('a[href="/versions"] > h3').content | ||
| 29 | end | ||
| 25 | end | 30 | end |
| 26 | end | 31 | end |
| @@ -20,5 +20,10 @@ module Docs · 19 unmodified lines | |||
| 20 | © 2010–2016 Jeremy Ashkenas, DocumentCloud<br> | 20 | © 2010–2016 Jeremy Ashkenas, DocumentCloud<br> |
| 21 | Licensed under the MIT License. | 21 | Licensed under the MIT License. |
| 22 | HTML | 22 | HTML |
| 23 | |||
| 24 | def get_latest_version(opts) | ||
| 25 | doc = fetch_doc('https://backbonejs.org/', opts) | ||
| 26 | doc.at_css('.version').content[1...-1] | ||
| 27 | end | ||
| 23 | end | 28 | end |
| 24 | end | 29 | end |
| @@ -1,7 +1,7 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Bash < UrlScraper | 2 | class Bash < UrlScraper |
| 3 | self.type = 'bash' | 3 | self.type = 'bash' |
| 4 | self.release = '4.4' | 4 | self.release = '5.0' |
| 5 | self.base_url = 'https://www.gnu.org/software/bash/manual' | 5 | self.base_url = 'https://www.gnu.org/software/bash/manual' |
| 6 | self.root_path = '/html_node/index.html' | 6 | self.root_path = '/html_node/index.html' |
| 7 | self.links = { | 7 | self.links = { |
| @@ -17,5 +17,10 @@ module Docs · 9 unmodified lines | |||
| 17 | Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.<br> | 17 | Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.<br> |
| 18 | Licensed under the GNU Free Documentation License. | 18 | Licensed under the GNU Free Documentation License. |
| 19 | HTML | 19 | HTML |
| 20 | |||
| 21 | def get_latest_version(opts) | ||
| 22 | body = fetch('https://www.gnu.org/software/bash/manual/html_node/index.html', opts) | ||
| 23 | body.scan(/, Version ([0-9.]+)/)[0][0][0...-1] | ||
| 24 | end | ||
| 20 | end | 25 | end |
| 21 | end | 26 | end |
| @@ -18,5 +18,9 @@ module Docs · 17 unmodified lines | |||
| 18 | © 2013–2017 Petka Antonov<br> | 18 | © 2013–2017 Petka Antonov<br> |
| 19 | Licensed under the MIT License. | 19 | Licensed under the MIT License. |
| 20 | HTML | 20 | HTML |
| 21 | |||
| 22 | def get_latest_version(opts) | ||
| 23 | get_npm_version('bluebird', opts) | ||
| 24 | end | ||
| 21 | end | 25 | end |
| 22 | end | 26 | end |
| @@ -34,5 +34,10 @@ module Docs · 33 unmodified lines | |||
| 34 | 34 | ||
| 35 | options[:only] = %w(getting-started/ css/ components/ javascript/) | 35 | options[:only] = %w(getting-started/ css/ components/ javascript/) |
| 36 | end | 36 | end |
| 37 | |||
| 38 | def get_latest_version(opts) | ||
| 39 | doc = fetch_doc('https://getbootstrap.com/', opts) | ||
| 40 | doc.at_css('#bd-versions').content.strip[1..-1] | ||
| 41 | end | ||
| 37 | end | 42 | end |
| 38 | end | 43 | end |
| @@ -27,5 +27,11 @@ module Docs · 26 unmodified lines | |||
| 27 | self.release = '0.11.7' | 27 | self.release = '0.11.7' |
| 28 | self.base_url = "https://bottlepy.org/docs/#{self.version}/" | 28 | self.base_url = "https://bottlepy.org/docs/#{self.version}/" |
| 29 | end | 29 | end |
| 30 | |||
| 31 | def get_latest_version(opts) | ||
| 32 | doc = fetch_doc('https://bottlepy.org/docs/stable/', opts) | ||
| 33 | label = doc.at_css('.sphinxsidebarwrapper > ul > li > b') | ||
| 34 | label.content.sub(/Bottle /, '') | ||
| 35 | end | ||
| 30 | end | 36 | end |
| 31 | end | 37 | end |
| @@ -19,5 +19,9 @@ module Docs · 18 unmodified lines | |||
| 19 | © 2018 Bower contributors<br> | 19 | © 2018 Bower contributors<br> |
| 20 | Licensed under the MIT License. | 20 | Licensed under the MIT License. |
| 21 | HTML | 21 | HTML |
| 22 | |||
| 23 | def get_latest_version(opts) | ||
| 24 | get_npm_version('bower', opts) | ||
| 25 | end | ||
| 22 | end | 26 | end |
| 23 | end | 27 | end |
| @@ -26,6 +26,13 @@ module Docs · 25 unmodified lines | |||
| 26 | Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0. | 26 | Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0. |
| 27 | HTML | 27 | HTML |
| 28 | 28 | ||
| 29 | def get_latest_version(opts) | ||
| 30 | doc = fetch_doc('https://en.cppreference.com/w/Cppreference:Archives', opts) | ||
| 31 | link = doc.at_css('a[title^="File:"]') | ||
| 32 | date = link.content.scan(/(\d+)\./)[0][0] | ||
| 33 | DateTime.strptime(date, '%Y%m%d').to_time.to_i | ||
| 34 | end | ||
| 35 | |||
| 29 | private | 36 | private |
| 30 | 37 | ||
| 31 | def file_path_for(*) | 38 | def file_path_for(*) |
| @@ -71,6 +71,11 @@ module Docs · 70 unmodified lines | |||
| 71 | self.base_url = 'https://api.cakephp.org/2.7/' | 71 | self.base_url = 'https://api.cakephp.org/2.7/' |
| 72 | end | 72 | end |
| 73 | 73 | ||
| 74 | def get_latest_version(opts) | ||
| 75 | doc = fetch_doc('https://api.cakephp.org/3.7/', opts) | ||
| 76 | doc.at_css('.version-picker .dropdown-toggle').content.strip | ||
| 77 | end | ||
| 78 | |||
| 74 | private | 79 | private |
| 75 | 80 | ||
| 76 | def parse(response) | 81 | def parse(response) |
| @@ -23,5 +23,9 @@ module Docs · 22 unmodified lines | |||
| 23 | © 2016 Chai.js Assertion Library<br> | 23 | © 2016 Chai.js Assertion Library<br> |
| 24 | Licensed under the MIT License. | 24 | Licensed under the MIT License. |
| 25 | HTML | 25 | HTML |
| 26 | |||
| 27 | def get_latest_version(opts) | ||
| 28 | get_npm_version('chai', opts) | ||
| 29 | end | ||
| 26 | end | 30 | end |
| 27 | end | 31 | end |
| @@ -47,5 +47,10 @@ module Docs · 46 unmodified lines | |||
| 47 | 47 | ||
| 48 | options[:only_patterns] = [/\A#{client_path}\//, /\A#{server_path}\//] | 48 | options[:only_patterns] = [/\A#{client_path}\//, /\A#{server_path}\//] |
| 49 | end | 49 | end |
| 50 | |||
| 51 | def get_latest_version(opts) | ||
| 52 | doc = fetch_doc('https://downloads.chef.io/chef', opts) | ||
| 53 | doc.at_css('h1.product-heading > span').content.strip | ||
| 54 | end | ||
| 50 | end | 55 | end |
| 51 | end | 56 | end |
| @@ -13,19 +13,29 @@ module Docs · 12 unmodified lines | |||
| 13 | Licensed under the Eclipse Public License 1.0. | 13 | Licensed under the Eclipse Public License 1.0. |
| 14 | HTML | 14 | HTML |
| 15 | 15 | ||
| 16 | version '1.9' do | 16 | version '1.10' do |
| 17 | self.release = '1.9' | 17 | self.release = '1.10 (stable)' |
| 18 | self.base_url = 'https://clojure.github.io/clojure/' | 18 | self.base_url = 'https://clojure.github.io/clojure/' |
| 19 | end | 19 | end |
| 20 | 20 | ||
| 21 | version '1.9' do | ||
| 22 | self.release = '1.9 (legacy)' | ||
| 23 | self.base_url = 'https://clojure.github.io/clojure/branch-clojure-1.9.0/' | ||
| 24 | end | ||
| 25 | |||
| 21 | version '1.8' do | 26 | version '1.8' do |
| 22 | self.release = '1.8' | 27 | self.release = '1.8 (legacy)' |
| 23 | self.base_url = 'https://clojure.github.io/clojure/branch-clojure-1.8.0/' | 28 | self.base_url = 'https://clojure.github.io/clojure/branch-clojure-1.8.0/' |
| 24 | end | 29 | end |
| 25 | 30 | ||
| 26 | version '1.7' do | 31 | version '1.7' do |
| 27 | self.release = '1.7' | 32 | self.release = '1.7 (legacy)' |
| 28 | self.base_url = 'https://clojure.github.io/clojure/branch-clojure-1.7.0/' | 33 | self.base_url = 'https://clojure.github.io/clojure/branch-clojure-1.7.0/' |
| 29 | end | 34 | end |
| 35 | |||
| 36 | def get_latest_version(opts) | ||
| 37 | doc = fetch_doc('http://clojure.github.io/clojure/index.html', opts) | ||
| 38 | doc.at_css('#header-version').content[1..-1] | ||
| 39 | end | ||
| 30 | end | 40 | end |
| 31 | end | 41 | end |
| @@ -59,5 +59,11 @@ module Docs · 58 unmodified lines | |||
| 59 | self.release = '3.5.2' | 59 | self.release = '3.5.2' |
| 60 | self.base_url = 'https://cmake.org/cmake/help/v3.5/' | 60 | self.base_url = 'https://cmake.org/cmake/help/v3.5/' |
| 61 | end | 61 | end |
| 62 | |||
| 63 | def get_latest_version(opts) | ||
| 64 | doc = fetch_doc('https://cmake.org/documentation/', opts) | ||
| 65 | link = doc.at_css('.entry-content ul > li > strong > a > big') | ||
| 66 | link.content.scan(/([0-9.]+)/)[0][0] | ||
| 67 | end | ||
| 62 | end | 68 | end |
| 63 | end | 69 | end |
| @@ -18,5 +18,10 @@ module Docs · 17 unmodified lines | |||
| 18 | © 2011 Michael Bodnarchuk and contributors<br> | 18 | © 2011 Michael Bodnarchuk and contributors<br> |
| 19 | Licensed under the MIT License. | 19 | Licensed under the MIT License. |
| 20 | HTML | 20 | HTML |
| 21 | |||
| 22 | def get_latest_version(opts) | ||
| 23 | doc = fetch_doc('https://codeception.com/changelog', opts) | ||
| 24 | doc.at_css('#page > h4').content | ||
| 25 | end | ||
| 21 | end | 26 | end |
| 22 | end | 27 | end |
| @@ -21,5 +21,9 @@ module Docs · 20 unmodified lines | |||
| 21 | © 2015 DavertMik <davert@codegyre.com> (http://codegyre.com)<br> | 21 | © 2015 DavertMik <davert@codegyre.com> (http://codegyre.com)<br> |
| 22 | Licensed under the MIT License. | 22 | Licensed under the MIT License. |
| 23 | HTML | 23 | HTML |
| 24 | |||
| 25 | def get_latest_version(opts) | ||
| 26 | get_npm_version('codeceptjs', opts) | ||
| 27 | end | ||
| 24 | end | 28 | end |
| 25 | end | 29 | end |
| @@ -38,5 +38,11 @@ module Docs · 37 unmodified lines | |||
| 38 | version '3' do | 38 | version '3' do |
| 39 | self.release = '3.1.8' | 39 | self.release = '3.1.8' |
| 40 | end | 40 | end |
| 41 | |||
| 42 | def get_latest_version(opts) | ||
| 43 | doc = fetch_doc('https://codeigniter.com/user_guide/changelog.html', opts) | ||
| 44 | header = doc.at_css('#change-log h2') | ||
| 45 | header.content.scan(/([0-9.]+)/)[0][0] | ||
| 46 | end | ||
| 41 | end | 47 | end |
| 42 | end | 48 | end |
| @@ -30,5 +30,9 @@ module Docs · 29 unmodified lines | |||
| 30 | 30 | ||
| 31 | options[:container] = '.container' | 31 | options[:container] = '.container' |
| 32 | end | 32 | end |
| 33 | |||
| 34 | def get_latest_version(opts) | ||
| 35 | get_npm_version('coffeescript', opts) | ||
| 36 | end | ||
| 33 | end | 37 | end |
| 34 | end | 38 | end |
| @@ -42,5 +42,15 @@ module Docs · 41 unmodified lines | |||
| 42 | self.release = '6.5.0' | 42 | self.release = '6.5.0' |
| 43 | self.base_url = 'https://cordova.apache.org/docs/en/6.x/' | 43 | self.base_url = 'https://cordova.apache.org/docs/en/6.x/' |
| 44 | end | 44 | end |
| 45 | |||
| 46 | def get_latest_version(opts) | ||
| 47 | doc = fetch_doc('https://cordova.apache.org/docs/en/latest/', opts) | ||
| 48 | |||
| 49 | label = doc.at_css('#versionDropdown').content.strip | ||
| 50 | version = label.scan(/([0-9.]+)/)[0][0] | ||
| 51 | version = version[0...-1] if version.end_with?('.') | ||
| 52 | |||
| 53 | version | ||
| 54 | end | ||
| 45 | end | 55 | end |
| 46 | end | 56 | end |
| @@ -34,6 +34,14 @@ module Docs · 33 unmodified lines | |||
| 34 | Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0. | 34 | Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0. |
| 35 | HTML | 35 | HTML |
| 36 | 36 | ||
| 37 | # Same as get_latest_version in lib/docs/scrapers/c.rb | ||
| 38 | def get_latest_version(opts) | ||
| 39 | doc = fetch_doc('https://en.cppreference.com/w/Cppreference:Archives', opts) | ||
| 40 | link = doc.at_css('a[title^="File:"]') | ||
| 41 | date = link.content.scan(/(\d+)\./)[0][0] | ||
| 42 | DateTime.strptime(date, '%Y%m%d').to_time.to_i | ||
| 43 | end | ||
| 44 | |||
| 37 | private | 45 | private |
| 38 | 46 | ||
| 39 | def file_path_for(*) | 47 | def file_path_for(*) |
| @@ -34,5 +34,10 @@ module Docs · 33 unmodified lines | |||
| 34 | HTML | 34 | HTML |
| 35 | end | 35 | end |
| 36 | } | 36 | } |
| 37 | |||
| 38 | def get_latest_version(opts) | ||
| 39 | body = fetch('https://crystal-lang.org/api', opts) | ||
| 40 | body.scan(/Crystal Docs ([0-9.]+)/)[0][0] | ||
| 41 | end | ||
| 37 | end | 42 | end |
| 38 | end | 43 | end |
| @@ -26,5 +26,10 @@ module Docs · 25 unmodified lines | |||
| 26 | def initial_urls | 26 | def initial_urls |
| 27 | %w(https://dlang.org/phobos/index.html https://dlang.org/spec/intro.html) | 27 | %w(https://dlang.org/phobos/index.html https://dlang.org/spec/intro.html) |
| 28 | end | 28 | end |
| 29 | |||
| 30 | def get_latest_version(opts) | ||
| 31 | doc = fetch_doc('https://dlang.org/changelog/', opts) | ||
| 32 | doc.at_css('#content > ul > li:nth-child(2) > a')['id'] | ||
| 33 | end | ||
| 29 | end | 34 | end |
| 30 | end | 35 | end |
| @@ -58,5 +58,9 @@ module Docs · 57 unmodified lines | |||
| 58 | options[:root_title] = 'D3.js' | 58 | options[:root_title] = 'D3.js' |
| 59 | options[:only_patterns] = [/\.md\z/] | 59 | options[:only_patterns] = [/\.md\z/] |
| 60 | end | 60 | end |
| 61 | |||
| 62 | def get_latest_version(opts) | ||
| 63 | get_npm_version('d3', opts) | ||
| 64 | end | ||
| 61 | end | 65 | end |
| 62 | end | 66 | end |
| @@ -31,5 +31,11 @@ module Docs · 30 unmodified lines | |||
| 31 | self.release = '1.24.3' | 31 | self.release = '1.24.3' |
| 32 | self.base_url = "https://api.dartlang.org/stable/#{release}/" | 32 | self.base_url = "https://api.dartlang.org/stable/#{release}/" |
| 33 | end | 33 | end |
| 34 | |||
| 35 | def get_latest_version(opts) | ||
| 36 | doc = fetch_doc('https://api.dartlang.org/', opts) | ||
| 37 | label = doc.at_css('footer > span').content.strip | ||
| 38 | label.sub(/Dart /, '') | ||
| 39 | end | ||
| 34 | end | 40 | end |
| 35 | end | 41 | end |
| @@ -63,5 +63,10 @@ module Docs · 62 unmodified lines | |||
| 63 | self.release = '1.8.18' | 63 | self.release = '1.8.18' |
| 64 | self.base_url = 'https://docs.djangoproject.com/en/1.8/' | 64 | self.base_url = 'https://docs.djangoproject.com/en/1.8/' |
| 65 | end | 65 | end |
| 66 | |||
| 67 | def get_latest_version(opts) | ||
| 68 | doc = fetch_doc('https://docs.djangoproject.com/', opts) | ||
| 69 | doc.at_css('#doc-versions > li.current > span > strong').content | ||
| 70 | end | ||
| 66 | end | 71 | end |
| 67 | end | 72 | end |
| @@ -176,5 +176,11 @@ module Docs · 175 unmodified lines | |||
| 176 | options[:container] = '#docs' | 176 | options[:container] = '#docs' |
| 177 | options[:only_patterns] << /\Aswarm\// | 177 | options[:only_patterns] << /\Aswarm\// |
| 178 | end | 178 | end |
| 179 | |||
| 180 | def get_latest_version(opts) | ||
| 181 | doc = fetch_doc('https://docs.docker.com/', opts) | ||
| 182 | label = doc.at_css('.nav-container button.dropdown-toggle').content.strip | ||
| 183 | label.scan(/([0-9.]+)/)[0][0] | ||
| 184 | end | ||
| 179 | end | 185 | end |
| 180 | end | 186 | end |
| @@ -36,6 +36,11 @@ module Docs · 35 unmodified lines | |||
| 36 | urls.map { |url| "<a href='#{url}'>#{url}</a>" }.join | 36 | urls.map { |url| "<a href='#{url}'>#{url}</a>" }.join |
| 37 | end | 37 | end |
| 38 | 38 | ||
| 39 | def get_latest_version(opts) | ||
| 40 | doc = fetch_doc('https://dojotoolkit.org/api/', opts) | ||
| 41 | doc.at_css('#versionSelector > option[selected]').content | ||
| 42 | end | ||
| 43 | |||
| 39 | private | 44 | private |
| 40 | 45 | ||
| 41 | def get_url_list(json, set = Set.new) | 46 | def get_url_list(json, set = Set.new) |
| @@ -98,5 +98,10 @@ module Docs · 97 unmodified lines | |||
| 98 | /\A[\w\-\.]+\.php\/7\.x\z/ | 98 | /\A[\w\-\.]+\.php\/7\.x\z/ |
| 99 | ] | 99 | ] |
| 100 | end | 100 | end |
| 101 | |||
| 102 | def get_latest_version(opts) | ||
| 103 | json = fetch_json('https://packagist.org/packages/drupal/drupal.json', opts) | ||
| 104 | json['package']['versions'].keys.find {|version| !version.end_with?('-dev')} | ||
| 105 | end | ||
| 101 | end | 106 | end |
| 102 | end | 107 | end |
| @@ -22,5 +22,10 @@ module Docs · 21 unmodified lines | |||
| 22 | © 2013–2018 GitHub Inc.<br> | 22 | © 2013–2018 GitHub Inc.<br> |
| 23 | Licensed under the MIT license. | 23 | Licensed under the MIT license. |
| 24 | HTML | 24 | HTML |
| 25 | |||
| 26 | def get_latest_version(opts) | ||
| 27 | doc = fetch_doc('https://electronjs.org/docs', opts) | ||
| 28 | doc.at_css('.docs-version').content | ||
| 29 | end | ||
| 25 | end | 30 | end |
| 26 | end | 31 | end |
| @@ -33,8 +33,34 @@ module Docs · 32 unmodified lines | |||
| 33 | "https://elixir-lang.org/getting-started/introduction.html" ] | 33 | "https://elixir-lang.org/getting-started/introduction.html" ] |
| 34 | end | 34 | end |
| 35 | 35 | ||
| 36 | version '1.9' do | ||
| 37 | self.release = '1.9.1' | ||
| 38 | self.base_urls = [ | ||
| 39 | "https://hexdocs.pm/elixir/#{release}/", | ||
| 40 | "https://hexdocs.pm/eex/#{release}/", | ||
| 41 | "https://hexdocs.pm/ex_unit/#{release}/", | ||
| 42 | "https://hexdocs.pm/iex/#{release}/", | ||
| 43 | "https://hexdocs.pm/logger/#{release}/", | ||
| 44 | "https://hexdocs.pm/mix/#{release}/", | ||
| 45 | 'https://elixir-lang.org/getting-started/' | ||
| 46 | ] | ||
| 47 | end | ||
| 48 | |||
| 49 | version '1.8' do | ||
| 50 | self.release = '1.8.2' | ||
| 51 | self.base_urls = [ | ||
| 52 | "https://hexdocs.pm/elixir/#{release}/", | ||
| 53 | "https://hexdocs.pm/eex/#{release}/", | ||
| 54 | "https://hexdocs.pm/ex_unit/#{release}/", | ||
| 55 | "https://hexdocs.pm/iex/#{release}/", | ||
| 56 | "https://hexdocs.pm/logger/#{release}/", | ||
| 57 | "https://hexdocs.pm/mix/#{release}/", | ||
| 58 | 'https://elixir-lang.org/getting-started/' | ||
| 59 | ] | ||
| 60 | end | ||
| 61 | |||
| 36 | version '1.7' do | 62 | version '1.7' do |
| 37 | self.release = '1.7.3' | 63 | self.release = '1.7.4' |
| 38 | self.base_urls = [ | 64 | self.base_urls = [ |
| 39 | "https://hexdocs.pm/elixir/#{release}/", | 65 | "https://hexdocs.pm/elixir/#{release}/", |
| 40 | "https://hexdocs.pm/eex/#{release}/", | 66 | "https://hexdocs.pm/eex/#{release}/", |
| @@ -47,7 +73,7 @@ module Docs · 6 unmodified lines | |||
| 47 | end | 73 | end |
| 48 | 74 | ||
| 49 | version '1.6' do | 75 | version '1.6' do |
| 50 | self.release = '1.6.5' | 76 | self.release = '1.6.6' |
| 51 | self.base_urls = [ | 77 | self.base_urls = [ |
| 52 | "https://hexdocs.pm/elixir/#{release}/", | 78 | "https://hexdocs.pm/elixir/#{release}/", |
| 53 | "https://hexdocs.pm/eex/#{release}/", | 79 | "https://hexdocs.pm/eex/#{release}/", |
| @@ -97,5 +123,10 @@ module Docs · 43 unmodified lines | |||
| 97 | 'https://elixir-lang.org/getting-started/' | 123 | 'https://elixir-lang.org/getting-started/' |
| 98 | ] | 124 | ] |
| 99 | end | 125 | end |
| 126 | |||
| 127 | def get_latest_version(opts) | ||
| 128 | doc = fetch_doc('https://hexdocs.pm/elixir/api-reference.html', opts) | ||
| 129 | doc.at_css('h2.sidebar-projectVersion').content.strip[1..-1] | ||
| 130 | end | ||
| 100 | end | 131 | end |
| 101 | end | 132 | end |
| @@ -56,5 +56,10 @@ module Docs · 55 unmodified lines | |||
| 56 | https://emberjs.com/api/ember-data/2.14/classes/DS | 56 | https://emberjs.com/api/ember-data/2.14/classes/DS |
| 57 | ) | 57 | ) |
| 58 | end | 58 | end |
| 59 | |||
| 60 | def get_latest_version(opts) | ||
| 61 | doc = fetch_doc('https://emberjs.com/api/ember/release', opts) | ||
| 62 | doc.at_css('.sidebar > .select-container .ember-power-select-selected-item').content.strip | ||
| 63 | end | ||
| 59 | end | 64 | end |
| 60 | end | 65 | end |
| @@ -55,5 +55,10 @@ module Docs · 54 unmodified lines | |||
| 55 | version '18' do | 55 | version '18' do |
| 56 | self.release = '18.3' | 56 | self.release = '18.3' |
| 57 | end | 57 | end |
| 58 | |||
| 59 | def get_latest_version(opts) | ||
| 60 | doc = fetch_doc('https://www.erlang.org/downloads', opts) | ||
| 61 | doc.at_css('.col-lg-3 > ul > li').content.strip.sub(/OTP /, '') | ||
| 62 | end | ||
| 58 | end | 63 | end |
| 59 | end | 64 | end |
| @@ -20,5 +20,9 @@ module Docs · 19 unmodified lines | |||
| 20 | © JS Foundation and other contributors<br> | 20 | © JS Foundation and other contributors<br> |
| 21 | Licensed under the MIT License. | 21 | Licensed under the MIT License. |
| 22 | HTML | 22 | HTML |
| 23 | |||
| 24 | def get_latest_version(opts) | ||
| 25 | get_npm_version('eslint', opts) | ||
| 26 | end | ||
| 23 | end | 27 | end |
| 24 | end | 28 | end |
| @@ -28,5 +28,9 @@ module Docs · 27 unmodified lines | |||
| 28 | © 2017 StrongLoop, IBM, and other expressjs.com contributors.<br> | 28 | © 2017 StrongLoop, IBM, and other expressjs.com contributors.<br> |
| 29 | Licensed under the Creative Commons Attribution-ShareAlike License v3.0. | 29 | Licensed under the Creative Commons Attribution-ShareAlike License v3.0. |
| 30 | HTML | 30 | HTML |
| 31 | |||
| 32 | def get_latest_version(opts) | ||
| 33 | get_npm_version('express', opts) | ||
| 34 | end | ||
| 31 | end | 35 | end |
| 32 | end | 36 | end |
| @@ -33,5 +33,10 @@ module Docs · 32 unmodified lines | |||
| 33 | self.release = '1.2.0' | 33 | self.release = '1.2.0' |
| 34 | self.base_url = "https://falcon.readthedocs.io/en/#{self.release}/" | 34 | self.base_url = "https://falcon.readthedocs.io/en/#{self.release}/" |
| 35 | end | 35 | end |
| 36 | |||
| 37 | def get_latest_version(opts) | ||
| 38 | doc = fetch_doc('https://falcon.readthedocs.io/en/stable/changes/index.html', opts) | ||
| 39 | doc.at_css('#changelogs ul > li > a').content | ||
| 40 | end | ||
| 36 | end | 41 | end |
| 37 | end | 42 | end |
| @@ -46,5 +46,10 @@ module Docs · 45 unmodified lines | |||
| 46 | self.release = '2.2.0' | 46 | self.release = '2.2.0' |
| 47 | self.base_url = "https://fishshell.com/docs/#{version}/" | 47 | self.base_url = "https://fishshell.com/docs/#{version}/" |
| 48 | end | 48 | end |
| 49 | |||
| 50 | def get_latest_version(opts) | ||
| 51 | doc = fetch_doc('http://fishshell.com/docs/current/index.html', opts) | ||
| 52 | doc.at_css('#toc-index').content.scan(/([0-9.]+)/)[0][0] | ||
| 53 | end | ||
| 49 | end | 54 | end |
| 50 | end | 55 | end |
| @@ -18,5 +18,9 @@ module Docs · 17 unmodified lines | |||
| 18 | © 2013–present Facebook Inc.<br> | 18 | © 2013–present Facebook Inc.<br> |
| 19 | Licensed under the MIT License. | 19 | Licensed under the MIT License. |
| 20 | HTML | 20 | HTML |
| 21 | |||
| 22 | def get_latest_version(opts) | ||
| 23 | get_npm_version('flow-bin', opts) | ||
| 24 | end | ||
| 21 | end | 25 | end |
| 22 | end | 26 | end |
| @@ -19,5 +19,10 @@ module Docs · 18 unmodified lines | |||
| 19 | © 2005–2018 Linus Torvalds and others<br> | 19 | © 2005–2018 Linus Torvalds and others<br> |
| 20 | Licensed under the GNU General Public License version 2. | 20 | Licensed under the GNU General Public License version 2. |
| 21 | HTML | 21 | HTML |
| 22 | |||
| 23 | def get_latest_version(opts) | ||
| 24 | doc = fetch_doc('https://git-scm.com/', opts) | ||
| 25 | doc.at_css('.version').content.strip | ||
| 26 | end | ||
| 22 | end | 27 | end |
| 23 | end | 28 | end |
| @@ -99,5 +99,11 @@ module Docs · 98 unmodified lines | |||
| 99 | 99 | ||
| 100 | options[:replace_paths] = CPP_PATHS | 100 | options[:replace_paths] = CPP_PATHS |
| 101 | end | 101 | end |
| 102 | |||
| 103 | def get_latest_version(opts) | ||
| 104 | doc = fetch_doc('https://gcc.gnu.org/onlinedocs/', opts) | ||
| 105 | label = doc.at_css('ul > li > ul > li > a').content.strip | ||
| 106 | label.scan(/([0-9.]+)/)[0][0] | ||
| 107 | end | ||
| 102 | end | 108 | end |
| 103 | end | 109 | end |
| @@ -25,5 +25,11 @@ module Docs · 24 unmodified lines | |||
| 25 | self.release = '4.9.3' | 25 | self.release = '4.9.3' |
| 26 | self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gfortran/" | 26 | self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gfortran/" |
| 27 | end | 27 | end |
| 28 | |||
| 29 | def get_latest_version(opts) | ||
| 30 | doc = fetch_doc('https://gcc.gnu.org/onlinedocs/', opts) | ||
| 31 | label = doc.at_css('ul > li > ul > li > a').content.strip | ||
| 32 | label.scan(/([0-9.]+)/)[0][0] | ||
| 33 | end | ||
| 28 | end | 34 | end |
| 29 | end | 35 | end |
| @@ -24,6 +24,11 @@ module Docs · 23 unmodified lines | |||
| 24 | Licensed under the Creative Commons Attribution License 3.0. | 24 | Licensed under the Creative Commons Attribution License 3.0. |
| 25 | HTML | 25 | HTML |
| 26 | 26 | ||
| 27 | def get_latest_version(opts) | ||
| 28 | doc = fetch_doc('https://golang.org/project/', opts) | ||
| 29 | doc.at_css('#page ul > li > a').text[3..-1] | ||
| 30 | end | ||
| 31 | |||
| 27 | private | 32 | private |
| 28 | 33 | ||
| 29 | def parse(response) # Hook here because Nokogori removes whitespace from textareas | 34 | def parse(response) # Hook here because Nokogori removes whitespace from textareas |
| @@ -37,5 +37,10 @@ module Docs · 36 unmodified lines | |||
| 37 | self.release = '2.1' | 37 | self.release = '2.1' |
| 38 | self.base_url = "http://docs.godotengine.org/en/#{self.version}/" | 38 | self.base_url = "http://docs.godotengine.org/en/#{self.version}/" |
| 39 | end | 39 | end |
| 40 | |||
| 41 | def get_latest_version(opts) | ||
| 42 | doc = fetch_doc('https://docs.godotengine.org/', opts) | ||
| 43 | doc.at_css('.version').content.strip | ||
| 44 | end | ||
| 40 | end | 45 | end |
| 41 | end | 46 | end |
| @@ -17,5 +17,10 @@ module Docs · 16 unmodified lines | |||
| 17 | © 2011–2016 The Graphite Project<br> | 17 | © 2011–2016 The Graphite Project<br> |
| 18 | Licensed under the Apache License, Version 2.0. | 18 | Licensed under the Apache License, Version 2.0. |
| 19 | HTML | 19 | HTML |
| 20 | |||
| 21 | def get_latest_version(opts) | ||
| 22 | doc = fetch_doc('https://graphite.readthedocs.io/en/latest/releases.html', opts) | ||
| 23 | doc.at_css('#release-notes li > a').content | ||
| 24 | end | ||
| 20 | end | 25 | end |
| 21 | end | 26 | end |
| @@ -26,5 +26,9 @@ module Docs · 25 unmodified lines | |||
| 26 | © GruntJS Team<br> | 26 | © GruntJS Team<br> |
| 27 | Licensed under the MIT License. | 27 | Licensed under the MIT License. |
| 28 | HTML | 28 | HTML |
| 29 | |||
| 30 | def get_latest_version(opts) | ||
| 31 | get_npm_version('grunt-cli', opts) | ||
| 32 | end | ||
| 29 | end | 33 | end |
| 30 | end | 34 | end |
| @@ -19,5 +19,9 @@ module Docs · 18 unmodified lines | |||
| 19 | © 2011–2017 by Yehuda Katz<br> | 19 | © 2011–2017 by Yehuda Katz<br> |
| 20 | Licensed under the MIT License. | 20 | Licensed under the MIT License. |
| 21 | HTML | 21 | HTML |
| 22 | |||
| 23 | def get_latest_version(opts) | ||
| 24 | get_npm_version('handlebars', opts) | ||
| 25 | end | ||
| 22 | end | 26 | end |
| 23 | end | 27 | end |
| @@ -10,7 +10,7 @@ module Docs · 9 unmodified lines | |||
| 10 | 10 | ||
| 11 | html_filters.push 'haskell/entries', 'haskell/clean_html' | 11 | html_filters.push 'haskell/entries', 'haskell/clean_html' |
| 12 | 12 | ||
| 13 | options[:container] = ->(filter) { filter.subpath.start_with?('users_guide') ? '.body' : '#content' } | 13 | options[:container] = ->(filter) {filter.subpath.start_with?('users_guide') ? '.body' : '#content'} |
| 14 | 14 | ||
| 15 | options[:only_patterns] = [/\Alibraries\//, /\Ausers_guide\//] | 15 | options[:only_patterns] = [/\Alibraries\//, /\Ausers_guide\//] |
| 16 | options[:skip_patterns] = [ | 16 | options[:skip_patterns] = [ |
| @@ -68,5 +68,12 @@ module Docs · 51 unmodified lines | |||
| 68 | 68 | ||
| 69 | options[:only_patterns] = [/\Alibraries\//] | 69 | options[:only_patterns] = [/\Alibraries\//] |
| 70 | end | 70 | end |
| 71 | |||
| 72 | def get_latest_version(opts) | ||
| 73 | doc = fetch_doc('https://downloads.haskell.org/~ghc/latest/docs/html/', opts) | ||
| 74 | links = doc.css('a').to_a | ||
| 75 | versions = links.map {|link| link['href'].scan(/ghc-([0-9.]+)/)} | ||
| 76 | versions.find {|version| !version.empty?}[0][0] | ||
| 77 | end | ||
| 71 | end | 78 | end |
| 72 | end | 79 | end |
| @@ -66,5 +66,11 @@ module Docs · 65 unmodified lines | |||
| 66 | version 'Python' do | 66 | version 'Python' do |
| 67 | self.base_url = 'https://api.haxe.org/python/' | 67 | self.base_url = 'https://api.haxe.org/python/' |
| 68 | end | 68 | end |
| 69 | |||
| 70 | def get_latest_version(opts) | ||
| 71 | doc = fetch_doc('https://api.haxe.org/', opts) | ||
| 72 | label = doc.at_css('.container.main-content h1 > small').content | ||
| 73 | label.sub(/version /, '') | ||
| 74 | end | ||
| 69 | end | 75 | end |
| 70 | end | 76 | end |
| @@ -2,7 +2,7 @@ module Docs · 1 unmodified line | |||
| 2 | class Homebrew < UrlScraper | 2 | class Homebrew < UrlScraper |
| 3 | self.name = 'Homebrew' | 3 | self.name = 'Homebrew' |
| 4 | self.type = 'simple' | 4 | self.type = 'simple' |
| 5 | self.release = '1.8.1' | 5 | self.release = '2.1.9' |
| 6 | self.base_url = 'https://docs.brew.sh/' | 6 | self.base_url = 'https://docs.brew.sh/' |
| 7 | self.links = { | 7 | self.links = { |
| 8 | home: 'https://brew.sh', | 8 | home: 'https://brew.sh', |
| @@ -19,5 +19,9 @@ module Docs · 10 unmodified lines | |||
| 19 | © 2009–present Homebrew contributors<br> | 19 | © 2009–present Homebrew contributors<br> |
| 20 | Licensed under the BSD 2-Clause License. | 20 | Licensed under the BSD 2-Clause License. |
| 21 | HTML | 21 | HTML |
| 22 | |||
| 23 | def get_latest_version(opts) | ||
| 24 | get_latest_github_release('Homebrew', 'brew', opts) | ||
| 25 | end | ||
| 22 | end | 26 | end |
| 23 | end | 27 | end |
| @@ -7,6 +7,8 @@ module Docs · 6 unmodified lines | |||
| 7 | 7 | ||
| 8 | html_filters.push 'http/clean_html', 'http/entries', 'title' | 8 | html_filters.push 'http/clean_html', 'http/entries', 'title' |
| 9 | 9 | ||
| 10 | options[:mdn_tag] = 'HTTP' | ||
| 11 | |||
| 10 | options[:root_title] = 'HTTP' | 12 | options[:root_title] = 'HTTP' |
| 11 | options[:title] = ->(filter) { filter.current_url.host == 'tools.ietf.org' ? false : filter.default_title } | 13 | options[:title] = ->(filter) { filter.current_url.host == 'tools.ietf.org' ? false : filter.default_title } |
| 12 | options[:container] = ->(filter) { filter.current_url.host == 'tools.ietf.org' ? '.content' : nil } | 14 | options[:container] = ->(filter) { filter.current_url.host == 'tools.ietf.org' ? '.content' : nil } |
| @@ -54,5 +54,9 @@ module Docs · 53 unmodified lines | |||
| 54 | JS | 54 | JS |
| 55 | capybara.html | 55 | capybara.html |
| 56 | end | 56 | end |
| 57 | |||
| 58 | def get_latest_version(opts) | ||
| 59 | get_npm_version('immutable', opts) | ||
| 60 | end | ||
| 57 | end | 61 | end |
| 58 | end | 62 | end |
| @@ -46,5 +46,11 @@ module Docs · 45 unmodified lines | |||
| 46 | © 2015 InfluxData, Inc.<br> | 46 | © 2015 InfluxData, Inc.<br> |
| 47 | Licensed under the MIT license. | 47 | Licensed under the MIT license. |
| 48 | HTML | 48 | HTML |
| 49 | |||
| 50 | def get_latest_version(opts) | ||
| 51 | doc = fetch_doc('https://docs.influxdata.com/influxdb/', opts) | ||
| 52 | label = doc.at_css('.navbar--current-product').content.strip | ||
| 53 | label.scan(/([0-9.]+)/)[0][0] | ||
| 54 | end | ||
| 49 | end | 55 | end |
| 50 | end | 56 | end |
| @@ -17,5 +17,9 @@ module Docs · 16 unmodified lines | |||
| 17 | © 2008–2017 Pivotal Labs<br> | 17 | © 2008–2017 Pivotal Labs<br> |
| 18 | Licensed under the MIT License. | 18 | Licensed under the MIT License. |
| 19 | HTML | 19 | HTML |
| 20 | |||
| 21 | def get_latest_version(opts) | ||
| 22 | get_latest_github_release('jasmine', 'jasmine', opts) | ||
| 23 | end | ||
| 20 | end | 24 | end |
| 21 | end | 25 | end |
| @@ -28,5 +28,10 @@ module Docs · 27 unmodified lines | |||
| 28 | © 2008–2018 Tom Preston-Werner and Jekyll contributors<br> | 28 | © 2008–2018 Tom Preston-Werner and Jekyll contributors<br> |
| 29 | Licensed under the MIT license. | 29 | Licensed under the MIT license. |
| 30 | HTML | 30 | HTML |
| 31 | |||
| 32 | def get_latest_version(opts) | ||
| 33 | doc = fetch_doc('https://jekyllrb.com/docs/', opts) | ||
| 34 | doc.at_css('.meta a').content[1..-1] | ||
| 35 | end | ||
| 31 | end | 36 | end |
| 32 | end | 37 | end |
| @@ -17,5 +17,10 @@ module Docs · 16 unmodified lines | |||
| 17 | © 2014–present Facebook Inc.<br> | 17 | © 2014–present Facebook Inc.<br> |
| 18 | Licensed under the BSD License. | 18 | Licensed under the BSD License. |
| 19 | HTML | 19 | HTML |
| 20 | |||
| 21 | def get_latest_version(opts) | ||
| 22 | doc = fetch_doc('https://jestjs.io/docs/en/getting-started', opts) | ||
| 23 | doc.at_css('header > a > h3').content | ||
| 24 | end | ||
| 20 | end | 25 | end |
| 21 | end | 26 | end |
| @@ -22,5 +22,9 @@ module Docs · 21 unmodified lines | |||
| 22 | /Selectors\/odd/i, | 22 | /Selectors\/odd/i, |
| 23 | /index/i | 23 | /index/i |
| 24 | ] | 24 | ] |
| 25 | |||
| 26 | def get_latest_version(opts) | ||
| 27 | get_npm_version('jquery', opts) | ||
| 28 | end | ||
| 25 | end | 29 | end |
| 26 | end | 30 | end |
| @@ -16,5 +16,10 @@ module Docs · 15 unmodified lines | |||
| 16 | options[:fix_urls] = ->(url) do | 16 | options[:fix_urls] = ->(url) do |
| 17 | url.sub! 'http://api.jquerymobile.com/', 'https://api.jquerymobile.com/' | 17 | url.sub! 'http://api.jquerymobile.com/', 'https://api.jquerymobile.com/' |
| 18 | end | 18 | end |
| 19 | |||
| 20 | def get_latest_version(opts) | ||
| 21 | doc = fetch_doc('https://jquerymobile.com/', opts) | ||
| 22 | doc.at_css('.download-box > .download-option:last-child > span').content.sub(/Version /, '') | ||
| 23 | end | ||
| 19 | end | 24 | end |
| 20 | end | 25 | end |
| @@ -15,5 +15,9 @@ module Docs · 14 unmodified lines | |||
| 15 | options[:fix_urls] = ->(url) do | 15 | options[:fix_urls] = ->(url) do |
| 16 | url.sub! 'http://api.jqueryui.com/', 'https://api.jqueryui.com/' | 16 | url.sub! 'http://api.jqueryui.com/', 'https://api.jqueryui.com/' |
| 17 | end | 17 | end |
| 18 | |||
| 19 | def get_latest_version(opts) | ||
| 20 | get_npm_version('jquery-ui', opts) | ||
| 21 | end | ||
| 18 | end | 22 | end |
| 19 | end | 23 | end |
| @@ -21,5 +21,9 @@ module Docs · 20 unmodified lines | |||
| 21 | © 2011–2017 the contributors to the JSDoc 3 documentation project<br> | 21 | © 2011–2017 the contributors to the JSDoc 3 documentation project<br> |
| 22 | Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0. | 22 | Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0. |
| 23 | HTML | 23 | HTML |
| 24 | |||
| 25 | def get_latest_version(opts) | ||
| 26 | get_latest_github_release('jsdoc3', 'jsdoc', opts) | ||
| 27 | end | ||
| 24 | end | 28 | end |
| 25 | end | 29 | end |
| @@ -49,5 +49,9 @@ module Docs · 48 unmodified lines | |||
| 49 | 49 | ||
| 50 | html_filters.push 'julia/entries_sphinx', 'julia/clean_html_sphinx', 'sphinx/clean_html' | 50 | html_filters.push 'julia/entries_sphinx', 'julia/clean_html_sphinx', 'sphinx/clean_html' |
| 51 | end | 51 | end |
| 52 | |||
| 53 | def get_latest_version(opts) | ||
| 54 | get_latest_github_release('JuliaLang', 'julia', opts) | ||
| 55 | end | ||
| 52 | end | 56 | end |
| 53 | end | 57 | end |
| @@ -33,5 +33,9 @@ module Docs · 32 unmodified lines | |||
| 33 | © Steven Sanderson, the Knockout.js team, and other contributors<br> | 33 | © Steven Sanderson, the Knockout.js team, and other contributors<br> |
| 34 | Licensed under the MIT License. | 34 | Licensed under the MIT License. |
| 35 | HTML | 35 | HTML |
| 36 | |||
| 37 | def get_latest_version(opts) | ||
| 38 | get_latest_github_release('knockout', 'knockout', opts) | ||
| 39 | end | ||
| 36 | end | 40 | end |
| 37 | end | 41 | end |
| @@ -34,5 +34,9 @@ module Docs · 33 unmodified lines | |||
| 34 | © 2018 Koa contributors<br> | 34 | © 2018 Koa contributors<br> |
| 35 | Licensed under the MIT License. | 35 | Licensed under the MIT License. |
| 36 | HTML | 36 | HTML |
| 37 | |||
| 38 | def get_latest_version(opts) | ||
| 39 | get_npm_version('koa', opts) | ||
| 40 | end | ||
| 37 | end | 41 | end |
| 38 | end | 42 | end |
| @@ -28,5 +28,9 @@ module Docs · 27 unmodified lines | |||
| 28 | © 2010–2018 JetBrains s.r.o.<br> | 28 | © 2010–2018 JetBrains s.r.o.<br> |
| 29 | Licensed under the Apache License, Version 2.0. | 29 | Licensed under the Apache License, Version 2.0. |
| 30 | HTML | 30 | HTML |
| 31 | |||
| 32 | def get_latest_version(opts) | ||
| 33 | get_latest_github_release('JetBrains', 'kotlin', opts) | ||
| 34 | end | ||
| 31 | end | 35 | end |
| 32 | end | 36 | end |
| @@ -133,5 +133,9 @@ module Docs · 132 unmodified lines | |||
| 133 | url | 133 | url |
| 134 | end | 134 | end |
| 135 | end | 135 | end |
| 136 | |||
| 137 | def get_latest_version(opts) | ||
| 138 | get_latest_github_release('laravel', 'laravel', opts) | ||
| 139 | end | ||
| 136 | end | 140 | end |
| 137 | end | 141 | end |
| @@ -39,5 +39,10 @@ module Docs · 38 unmodified lines | |||
| 39 | self.base_url = "https://leafletjs.com/reference-#{release}.html" | 39 | self.base_url = "https://leafletjs.com/reference-#{release}.html" |
| 40 | end | 40 | end |
| 41 | 41 | ||
| 42 | def get_latest_version(opts) | ||
| 43 | doc = fetch_doc('https://leafletjs.com/index.html', opts) | ||
| 44 | link = doc.css('ul > li > a').to_a.select {|node| node.content == 'Docs'}.first | ||
| 45 | link['href'].scan(/reference-([0-9.]+)\.html/)[0][0] | ||
| 46 | end | ||
| 42 | end | 47 | end |
| 43 | end | 48 | end |
| @@ -21,5 +21,11 @@ module Docs · 20 unmodified lines | |||
| 21 | © 2009–2016 The Core Less Team<br> | 21 | © 2009–2016 The Core Less Team<br> |
| 22 | Licensed under the Creative Commons Attribution License 3.0. | 22 | Licensed under the Creative Commons Attribution License 3.0. |
| 23 | HTML | 23 | HTML |
| 24 | |||
| 25 | def get_latest_version(opts) | ||
| 26 | doc = fetch_doc('http://lesscss.org/features/', opts) | ||
| 27 | label = doc.at_css('.footer-links > li').content | ||
| 28 | label.scan(/([0-9.]+)/)[0][0] | ||
| 29 | end | ||
| 24 | end | 30 | end |
| 25 | end | 31 | end |
| @@ -19,5 +19,10 @@ module Docs · 18 unmodified lines | |||
| 19 | © 2005, 2006 Tobias Luetke<br> | 19 | © 2005, 2006 Tobias Luetke<br> |
| 20 | Licensed under the MIT License. | 20 | Licensed under the MIT License. |
| 21 | HTML | 21 | HTML |
| 22 | |||
| 23 | def get_latest_version(opts) | ||
| 24 | tags = get_github_tags('Shopify', 'liquid', opts) | ||
| 25 | tags[0]['name'][1..-1] | ||
| 26 | end | ||
| 22 | end | 27 | end |
| 23 | end | 28 | end |
| @@ -32,5 +32,10 @@ module Docs · 31 unmodified lines | |||
| 32 | self.release = '2.4.2' | 32 | self.release = '2.4.2' |
| 33 | self.base_url = "https://lodash.com/docs/#{release}" | 33 | self.base_url = "https://lodash.com/docs/#{release}" |
| 34 | end | 34 | end |
| 35 | |||
| 36 | def get_latest_version(opts) | ||
| 37 | doc = fetch_doc('https://lodash.com/docs/', opts) | ||
| 38 | doc.at_css('#version > option[selected]').content | ||
| 39 | end | ||
| 35 | end | 40 | end |
| 36 | end | 41 | end |
| @@ -39,5 +39,10 @@ module Docs · 38 unmodified lines | |||
| 39 | © 2006–2016 LÖVE Development Team<br> | 39 | © 2006–2016 LÖVE Development Team<br> |
| 40 | Licensed under the GNU Free Documentation License, Version 1.3. | 40 | Licensed under the GNU Free Documentation License, Version 1.3. |
| 41 | HTML | 41 | HTML |
| 42 | |||
| 43 | def get_latest_version(opts) | ||
| 44 | doc = fetch_doc('https://love2d.org/wiki/Version_History', opts) | ||
| 45 | doc.at_css('#mw-content-text table a').content | ||
| 46 | end | ||
| 42 | end | 47 | end |
| 43 | end | 48 | end |
| @@ -26,5 +26,10 @@ module Docs · 25 unmodified lines | |||
| 26 | self.release = '5.1.5' | 26 | self.release = '5.1.5' |
| 27 | self.base_url = 'https://www.lua.org/manual/5.1/' | 27 | self.base_url = 'https://www.lua.org/manual/5.1/' |
| 28 | end | 28 | end |
| 29 | |||
| 30 | def get_latest_version(opts) | ||
| 31 | doc = fetch_doc('https://www.lua.org/manual/', opts) | ||
| 32 | doc.at_css('p.menubar > a').content | ||
| 33 | end | ||
| 29 | end | 34 | end |
| 30 | end | 35 | end |
| @@ -38,5 +38,9 @@ module Docs · 37 unmodified lines | |||
| 38 | 38 | ||
| 39 | html_filters.push 'marionette/entries_v2' | 39 | html_filters.push 'marionette/entries_v2' |
| 40 | end | 40 | end |
| 41 | |||
| 42 | def get_latest_version(opts) | ||
| 43 | get_npm_version('backbone.marionette', opts) | ||
| 44 | end | ||
| 41 | end | 45 | end |
| 42 | end | 46 | end |
| @@ -13,5 +13,9 @@ module Docs · 12 unmodified lines | |||
| 13 | © 2004 John Gruber<br> | 13 | © 2004 John Gruber<br> |
| 14 | Licensed under the BSD License. | 14 | Licensed under the BSD License. |
| 15 | HTML | 15 | HTML |
| 16 | |||
| 17 | def get_latest_version(opts) | ||
| 18 | '1.0.0' | ||
| 19 | end | ||
| 16 | end | 20 | end |
| 17 | end | 21 | end |
| @@ -64,5 +64,9 @@ module Docs · 63 unmodified lines | |||
| 64 | "https://matplotlib.org/#{release}/mpl_toolkits/axes_grid/api/" | 64 | "https://matplotlib.org/#{release}/mpl_toolkits/axes_grid/api/" |
| 65 | ] | 65 | ] |
| 66 | end | 66 | end |
| 67 | |||
| 68 | def get_latest_version(opts) | ||
| 69 | get_latest_github_release('matplotlib', 'matplotlib', opts) | ||
| 70 | end | ||
| 67 | end | 71 | end |
| 68 | end | 72 | end |
| @@ -6,6 +6,8 @@ module Docs · 5 unmodified lines | |||
| 6 | 6 | ||
| 7 | html_filters.push 'css/clean_html', 'css/entries', 'title' | 7 | html_filters.push 'css/clean_html', 'css/entries', 'title' |
| 8 | 8 | ||
| 9 | options[:mdn_tag] = 'CSS' | ||
| 10 | |||
| 9 | options[:root_title] = 'CSS' | 11 | options[:root_title] = 'CSS' |
| 10 | 12 | ||
| 11 | options[:skip] = %w(/CSS3 /Media/Visual /paged_media /Media/TV /Media/Tactile) | 13 | options[:skip] = %w(/CSS3 /Media/Visual /paged_media /Media/TV /Media/Tactile) |
| @@ -8,6 +8,8 @@ module Docs · 7 unmodified lines | |||
| 8 | 8 | ||
| 9 | html_filters.push 'dom/clean_html', 'dom/entries', 'title' | 9 | html_filters.push 'dom/clean_html', 'dom/entries', 'title' |
| 10 | 10 | ||
| 11 | options[:mdn_tag] = 'XSLT_Reference' | ||
| 12 | |||
| 11 | options[:root_title] = 'DOM' | 13 | options[:root_title] = 'DOM' |
| 12 | 14 | ||
| 13 | options[:skip] = %w( | 15 | options[:skip] = %w( |
| @@ -9,6 +9,8 @@ module Docs · 8 unmodified lines | |||
| 9 | html_filters.insert_after 'clean_html', 'dom_events/clean_html' | 9 | html_filters.insert_after 'clean_html', 'dom_events/clean_html' |
| 10 | html_filters.push 'dom_events/entries', 'title' | 10 | html_filters.push 'dom_events/entries', 'title' |
| 11 | 11 | ||
| 12 | options[:mdn_tag] = 'events' | ||
| 13 | |||
| 12 | options[:root_title] = 'DOM Events' | 14 | options[:root_title] = 'DOM Events' |
| 13 | 15 | ||
| 14 | options[:skip] = %w(/MozOrientation) | 16 | options[:skip] = %w(/MozOrientation) |
| @@ -7,6 +7,8 @@ module Docs · 6 unmodified lines | |||
| 7 | 7 | ||
| 8 | html_filters.push 'html/clean_html', 'html/entries', 'title' | 8 | html_filters.push 'html/clean_html', 'html/entries', 'title' |
| 9 | 9 | ||
| 10 | options[:mdn_tag] = 'HTML' | ||
| 11 | |||
| 10 | options[:root_title] = 'HTML' | 12 | options[:root_title] = 'HTML' |
| 11 | 13 | ||
| 12 | options[:title] = ->(filter) do | 14 | options[:title] = ->(filter) do |
| @@ -8,6 +8,8 @@ module Docs · 7 unmodified lines | |||
| 8 | 8 | ||
| 9 | html_filters.push 'javascript/clean_html', 'javascript/entries', 'title' | 9 | html_filters.push 'javascript/clean_html', 'javascript/entries', 'title' |
| 10 | 10 | ||
| 11 | options[:mdn_tag] = 'JavaScript' | ||
| 12 | |||
| 11 | options[:root_title] = 'JavaScript' | 13 | options[:root_title] = 'JavaScript' |
| 12 | 14 | ||
| 13 | # Don't want | 15 | # Don't want |
| @@ -21,6 +21,11 @@ module Docs · 20 unmodified lines | |||
| 21 | Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later. | 21 | Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later. |
| 22 | HTML | 22 | HTML |
| 23 | 23 | ||
| 24 | def get_latest_version(opts) | ||
| 25 | json = fetch_json("https://developer.mozilla.org/en-US/docs/feeds/json/tag/#{options[:mdn_tag]}", opts) | ||
| 26 | DateTime.parse(json[0]['pubdate']).to_time.to_i | ||
| 27 | end | ||
| 28 | |||
| 24 | private | 29 | private |
| 25 | 30 | ||
| 26 | def process_response?(response) | 31 | def process_response?(response) |
| @@ -8,6 +8,8 @@ module Docs · 7 unmodified lines | |||
| 8 | 8 | ||
| 9 | html_filters.push 'svg/clean_html', 'svg/entries', 'title' | 9 | html_filters.push 'svg/clean_html', 'svg/entries', 'title' |
| 10 | 10 | ||
| 11 | options[:mdn_tag] = 'XSLT_Reference' | ||
| 12 | |||
| 11 | options[:root_title] = 'SVG' | 13 | options[:root_title] = 'SVG' |
| 12 | 14 | ||
| 13 | options[:title] = ->(filter) do | 15 | options[:title] = ->(filter) do |
| @@ -8,6 +8,8 @@ module Docs · 7 unmodified lines | |||
| 8 | 8 | ||
| 9 | html_filters.push 'xslt_xpath/clean_html', 'xslt_xpath/entries', 'title' | 9 | html_filters.push 'xslt_xpath/clean_html', 'xslt_xpath/entries', 'title' |
| 10 | 10 | ||
| 11 | options[:mdn_tag] = 'XSLT_Reference' | ||
| 12 | |||
| 11 | options[:root_title] = 'XSLT' | 13 | options[:root_title] = 'XSLT' |
| 12 | 14 | ||
| 13 | options[:only_patterns] = [/\A\/XSLT/, /\A\/XPath/] | 15 | options[:only_patterns] = [/\A\/XSLT/, /\A\/XPath/] |
| @@ -45,5 +45,10 @@ module Docs · 44 unmodified lines | |||
| 45 | self.base_urls = ['https://guide.meteor.com/v1.3/', "https://docs.meteor.com/v#{self.release}/"] | 45 | self.base_urls = ['https://guide.meteor.com/v1.3/', "https://docs.meteor.com/v#{self.release}/"] |
| 46 | options[:fix_urls] = nil | 46 | options[:fix_urls] = nil |
| 47 | end | 47 | end |
| 48 | |||
| 49 | def get_latest_version(opts) | ||
| 50 | doc = fetch_doc('https://docs.meteor.com/#/full/', opts) | ||
| 51 | doc.at_css('select.version-select > option').content | ||
| 52 | end | ||
| 48 | end | 53 | end |
| 49 | end | 54 | end |
| @@ -18,5 +18,9 @@ module Docs · 17 unmodified lines | |||
| 18 | © 2011–2018 JS Foundation and contributors<br> | 18 | © 2011–2018 JS Foundation and contributors<br> |
| 19 | Licensed under the Creative Commons Attribution 4.0 International License. | 19 | Licensed under the Creative Commons Attribution 4.0 International License. |
| 20 | HTML | 20 | HTML |
| 21 | |||
| 22 | def get_latest_version(opts) | ||
| 23 | get_npm_version('mocha', opts) | ||
| 24 | end | ||
| 21 | end | 25 | end |
| 22 | end | 26 | end |
| @@ -15,5 +15,9 @@ module Docs · 14 unmodified lines | |||
| 15 | © 2009–2017 The Modernizr team<br> | 15 | © 2009–2017 The Modernizr team<br> |
| 16 | Licensed under the MIT License. | 16 | Licensed under the MIT License. |
| 17 | HTML | 17 | HTML |
| 18 | |||
| 19 | def get_latest_version(opts) | ||
| 20 | get_npm_version('modernizr', opts) | ||
| 21 | end | ||
| 18 | end | 22 | end |
| 19 | end | 23 | end |
| @@ -22,5 +22,10 @@ module Docs · 21 unmodified lines | |||
| 22 | © JS Foundation and other contributors<br> | 22 | © JS Foundation and other contributors<br> |
| 23 | Licensed under the MIT License. | 23 | Licensed under the MIT License. |
| 24 | HTML | 24 | HTML |
| 25 | |||
| 26 | def get_latest_version(opts) | ||
| 27 | doc = fetch_doc('http://momentjs.com/', opts) | ||
| 28 | doc.at_css('.hero-title > h1 > span').content | ||
| 29 | end | ||
| 25 | end | 30 | end |
| 26 | end | 31 | end |
| @@ -26,5 +26,11 @@ module Docs · 25 unmodified lines | |||
| 26 | © 2010 LearnBoost<br> | 26 | © 2010 LearnBoost<br> |
| 27 | Licensed under the MIT License. | 27 | Licensed under the MIT License. |
| 28 | HTML | 28 | HTML |
| 29 | |||
| 30 | def get_latest_version(opts) | ||
| 31 | doc = fetch_doc('https://mongoosejs.com/docs/', opts) | ||
| 32 | label = doc.at_css('.pure-menu-link').content.strip | ||
| 33 | label.sub(/Version /, '') | ||
| 34 | end | ||
| 29 | end | 35 | end |
| 30 | end | 36 | end |
| @@ -25,5 +25,11 @@ module Docs · 24 unmodified lines | |||
| 25 | © 2011-2018 Nginx, Inc.<br> | 25 | © 2011-2018 Nginx, Inc.<br> |
| 26 | Licensed under the BSD License. | 26 | Licensed under the BSD License. |
| 27 | HTML | 27 | HTML |
| 28 | |||
| 29 | def get_latest_version(opts) | ||
| 30 | doc = fetch_doc('https://nginx.org/en/download.html', opts) | ||
| 31 | table = doc.at_css('#content > table').inner_html | ||
| 32 | table.scan(/nginx-([0-9.]+)</)[0][0] | ||
| 33 | end | ||
| 28 | end | 34 | end |
| 29 | end | 35 | end |
| @@ -4,6 +4,9 @@ module Docs · 3 unmodified lines | |||
| 4 | self.slug = 'nginx_lua_module' | 4 | self.slug = 'nginx_lua_module' |
| 5 | self.release = '0.10.13' | 5 | self.release = '0.10.13' |
| 6 | self.base_url = "https://github.com/openresty/lua-nginx-module/tree/v#{self.release}/" | 6 | self.base_url = "https://github.com/openresty/lua-nginx-module/tree/v#{self.release}/" |
| 7 | self.links = { | ||
| 8 | code: 'https://github.com/openresty/lua-nginx-module' | ||
| 9 | } | ||
| 7 | 10 | ||
| 8 | html_filters.push 'nginx_lua_module/clean_html', 'nginx_lua_module/entries', 'title' | 11 | html_filters.push 'nginx_lua_module/clean_html', 'nginx_lua_module/entries', 'title' |
| 9 | 12 | ||
| @@ -15,5 +18,11 @@ module Docs · 5 unmodified lines | |||
| 15 | © 2009–2018 Yichun "agentzh" Zhang (章亦春), OpenResty Inc.<br> | 18 | © 2009–2018 Yichun "agentzh" Zhang (章亦春), OpenResty Inc.<br> |
| 16 | Licensed under the BSD License. | 19 | Licensed under the BSD License. |
| 17 | HTML | 20 | HTML |
| 21 | |||
| 22 | def get_latest_version(opts) | ||
| 23 | tags = get_github_tags('openresty', 'lua-nginx-module', opts) | ||
| 24 | tag = tags.find {|tag| !tag['name'].include?('rc')} | ||
| 25 | tag['name'][1..-1] | ||
| 26 | end | ||
| 18 | end | 27 | end |
| 19 | end | 28 | end |
| @@ -17,5 +17,10 @@ module Docs · 16 unmodified lines | |||
| 17 | © 2006–2018 Andreas Rumpf<br> | 17 | © 2006–2018 Andreas Rumpf<br> |
| 18 | Licensed under the MIT License. | 18 | Licensed under the MIT License. |
| 19 | HTML | 19 | HTML |
| 20 | |||
| 21 | def get_latest_version(opts) | ||
| 22 | doc = fetch_doc('https://nim-lang.org/docs/overview.html', opts) | ||
| 23 | doc.at_css('.container > .docinfo > tbody > tr:last-child > td').content.strip | ||
| 24 | end | ||
| 20 | end | 25 | end |
| 21 | end | 26 | end |
| @@ -46,5 +46,10 @@ module Docs · 45 unmodified lines | |||
| 46 | self.release = '4.9.1' | 46 | self.release = '4.9.1' |
| 47 | self.base_url = 'https://nodejs.org/dist/latest-v4.x/docs/api/' | 47 | self.base_url = 'https://nodejs.org/dist/latest-v4.x/docs/api/' |
| 48 | end | 48 | end |
| 49 | |||
| 50 | def get_latest_version(opts) | ||
| 51 | doc = fetch_doc('https://nodejs.org/en/', opts) | ||
| 52 | doc.at_css('#home-intro > .home-downloadblock:last-of-type > a')['data-version'][1..-1] | ||
| 53 | end | ||
| 49 | end | 54 | end |
| 50 | end | 55 | end |
| @@ -19,5 +19,9 @@ module Docs · 18 unmodified lines | |||
| 19 | Patrick Mahoney, Yoko Harada, Akinori Musha, John Shahid, Lars Kanis<br> | 19 | Patrick Mahoney, Yoko Harada, Akinori Musha, John Shahid, Lars Kanis<br> |
| 20 | Licensed under the MIT License. | 20 | Licensed under the MIT License. |
| 21 | HTML | 21 | HTML |
| 22 | |||
| 23 | def get_latest_version(opts) | ||
| 24 | get_latest_github_release('sparklemotion', 'nokogiri', opts) | ||
| 25 | end | ||
| 22 | end | 26 | end |
| 23 | end | 27 | end |
| @@ -29,5 +29,9 @@ module Docs · 28 unmodified lines | |||
| 29 | Licensed under the npm License.<br> | 29 | Licensed under the npm License.<br> |
| 30 | npm is a trademark of npm, Inc. | 30 | npm is a trademark of npm, Inc. |
| 31 | HTML | 31 | HTML |
| 32 | |||
| 33 | def get_latest_version(opts) | ||
| 34 | get_latest_github_release('npm', 'cli', opts) | ||
| 35 | end | ||
| 32 | end | 36 | end |
| 33 | end | 37 | end |
| @@ -49,5 +49,9 @@ module Docs · 48 unmodified lines | |||
| 49 | self.release = '1.10.4' | 49 | self.release = '1.10.4' |
| 50 | self.base_url = "https://docs.scipy.org/doc/numpy-#{self.release}/reference/" | 50 | self.base_url = "https://docs.scipy.org/doc/numpy-#{self.release}/reference/" |
| 51 | end | 51 | end |
| 52 | |||
| 53 | def get_latest_version(opts) | ||
| 54 | get_latest_github_release('numpy', 'numpy', opts) | ||
| 55 | end | ||
| 52 | end | 56 | end |
| 53 | end | 57 | end |
| @@ -86,5 +86,25 @@ module Docs · 85 unmodified lines | |||
| 86 | def read_file(path) | 86 | def read_file(path) |
| 87 | File.read(path).force_encoding('iso-8859-1').encode('utf-8') rescue nil | 87 | File.read(path).force_encoding('iso-8859-1').encode('utf-8') rescue nil |
| 88 | end | 88 | end |
| 89 | |||
| 90 | def get_latest_version(opts) | ||
| 91 | latest_version = 8 | ||
| 92 | current_attempt = latest_version | ||
| 93 | attempts = 0 | ||
| 94 | |||
| 95 | while attempts < 3 | ||
| 96 | current_attempt += 1 | ||
| 97 | |||
| 98 | doc = fetch_doc("https://packages.debian.org/sid/openjdk-#{current_attempt}-doc", opts) | ||
| 99 | if doc.at_css('.perror').nil? | ||
| 100 | latest_version = current_attempt | ||
| 101 | attempts = 0 | ||
| 102 | else | ||
| 103 | attempts += 1 | ||
| 104 | end | ||
| 105 | end | ||
| 106 | |||
| 107 | latest_version | ||
| 108 | end | ||
| 89 | end | 109 | end |
| 90 | end | 110 | end |
| @@ -18,5 +18,9 @@ module Docs · 17 unmodified lines | |||
| 18 | © 2010–2016 The OpenTSDB Authors<br> | 18 | © 2010–2016 The OpenTSDB Authors<br> |
| 19 | Licensed under the GNU LGPLv2.1+ and GPLv3+ licenses. | 19 | Licensed under the GNU LGPLv2.1+ and GPLv3+ licenses. |
| 20 | HTML | 20 | HTML |
| 21 | |||
| 22 | def get_latest_version(opts) | ||
| 23 | get_latest_github_release('OpenTSDB', 'opentsdb', opts) | ||
| 24 | end | ||
| 21 | end | 25 | end |
| 22 | end | 26 | end |
| @@ -23,5 +23,9 @@ module Docs · 22 unmodified lines | |||
| 23 | stub 'index2' do | 23 | stub 'index2' do |
| 24 | request_one(url_for('index')).body | 24 | request_one(url_for('index')).body |
| 25 | end | 25 | end |
| 26 | |||
| 27 | def get_latest_version(opts) | ||
| 28 | get_github_tags('padrino', 'padrino-framework', opts)[0]['name'] | ||
| 29 | end | ||
| 26 | end | 30 | end |
| 27 | end | 31 | end |
| @@ -49,5 +49,11 @@ module Docs · 48 unmodified lines | |||
| 49 | self.release = '0.18.1' | 49 | self.release = '0.18.1' |
| 50 | self.base_url = "http://pandas.pydata.org/pandas-docs/version/#{self.release}/" | 50 | self.base_url = "http://pandas.pydata.org/pandas-docs/version/#{self.release}/" |
| 51 | end | 51 | end |
| 52 | |||
| 53 | def get_latest_version(opts) | ||
| 54 | doc = fetch_doc('http://pandas.pydata.org/pandas-docs/stable/', opts) | ||
| 55 | label = doc.at_css('.body > .section > p').content | ||
| 56 | label.scan(/Version: ([0-9.]+)/)[0][0] | ||
| 57 | end | ||
| 52 | end | 58 | end |
| 53 | end | 59 | end |
| @@ -43,5 +43,11 @@ module Docs · 42 unmodified lines | |||
| 43 | self.release = '5.20.2' | 43 | self.release = '5.20.2' |
| 44 | self.base_url = "https://perldoc.perl.org/#{self.release}/" | 44 | self.base_url = "https://perldoc.perl.org/#{self.release}/" |
| 45 | end | 45 | end |
| 46 | |||
| 47 | def get_latest_version(opts) | ||
| 48 | doc = fetch_doc('https://perldoc.perl.org/', opts) | ||
| 49 | header = doc.at_css('h2.h1').content | ||
| 50 | header.scan(/Perl ([0-9.]+)/)[0][0] | ||
| 51 | end | ||
| 46 | end | 52 | end |
| 47 | end | 53 | end |
| @@ -29,5 +29,10 @@ module Docs · 28 unmodified lines | |||
| 29 | self.release = '2.0.13' | 29 | self.release = '2.0.13' |
| 30 | self.base_url = 'https://docs.phalconphp.com/en/2.0.0/' | 30 | self.base_url = 'https://docs.phalconphp.com/en/2.0.0/' |
| 31 | end | 31 | end |
| 32 | |||
| 33 | def get_latest_version(opts) | ||
| 34 | doc = fetch_doc('https://docs.phalconphp.com/', opts) | ||
| 35 | doc.at_css('.header__lang.expand > div > ul > li > a').content | ||
| 36 | end | ||
| 32 | end | 37 | end |
| 33 | end | 38 | end |
| @@ -25,5 +25,9 @@ module Docs · 24 unmodified lines | |||
| 25 | © 2016 Richard Davey, Photon Storm Ltd.<br> | 25 | © 2016 Richard Davey, Photon Storm Ltd.<br> |
| 26 | Licensed under the MIT License. | 26 | Licensed under the MIT License. |
| 27 | HTML | 27 | HTML |
| 28 | |||
| 29 | def get_latest_version(opts) | ||
| 30 | get_latest_github_release('photonstorm', 'phaser', opts) | ||
| 31 | end | ||
| 28 | end | 32 | end |
| 29 | end | 33 | end |
| @@ -46,5 +46,10 @@ module Docs · 45 unmodified lines | |||
| 46 | HTML | 46 | HTML |
| 47 | end | 47 | end |
| 48 | } | 48 | } |
| 49 | |||
| 50 | def get_latest_version(opts) | ||
| 51 | doc = fetch_doc('https://hexdocs.pm/phoenix/Phoenix.html', opts) | ||
| 52 | doc.at_css('.sidebar-projectVersion').content.strip[1..-1] | ||
| 53 | end | ||
| 49 | end | 54 | end |
| 50 | end | 55 | end |
| @@ -66,5 +66,11 @@ module Docs · 65 unmodified lines | |||
| 66 | © 1997–2018 The PHP Documentation Group<br> | 66 | © 1997–2018 The PHP Documentation Group<br> |
| 67 | Licensed under the Creative Commons Attribution License v3.0 or later. | 67 | Licensed under the Creative Commons Attribution License v3.0 or later. |
| 68 | HTML | 68 | HTML |
| 69 | |||
| 70 | def get_latest_version(opts) | ||
| 71 | doc = fetch_doc('https://secure.php.net/manual/en/doc.changelog.php', opts) | ||
| 72 | label = doc.at_css('tbody.gen-changelog > tr > td').content | ||
| 73 | label.split(',').last.strip | ||
| 74 | end | ||
| 69 | end | 75 | end |
| 70 | end | 76 | end |
| @@ -37,5 +37,11 @@ module Docs · 36 unmodified lines | |||
| 37 | self.release = '4.8' | 37 | self.release = '4.8' |
| 38 | self.base_url = "https://phpunit.de/manual/#{release}/en/" | 38 | self.base_url = "https://phpunit.de/manual/#{release}/en/" |
| 39 | end | 39 | end |
| 40 | |||
| 41 | def get_latest_version(opts) | ||
| 42 | doc = fetch_doc('https://phpunit.readthedocs.io/', opts) | ||
| 43 | label = doc.at_css('.rst-current-version').content.strip | ||
| 44 | label.scan(/v: ([0-9.]+)/)[0][0] | ||
| 45 | end | ||
| 40 | end | 46 | end |
| 41 | end | 47 | end |
| @@ -80,5 +80,11 @@ module Docs · 79 unmodified lines | |||
| 80 | 80 | ||
| 81 | html_filters.insert_before 'postgresql/extract_metadata', 'postgresql/normalize_class_names' | 81 | html_filters.insert_before 'postgresql/extract_metadata', 'postgresql/normalize_class_names' |
| 82 | end | 82 | end |
| 83 | |||
| 84 | def get_latest_version(opts) | ||
| 85 | doc = fetch_doc('https://www.postgresql.org/docs/current/index.html', opts) | ||
| 86 | label = doc.at_css('#pgContentWrap h1.title').content | ||
| 87 | label.scan(/([0-9.]+)/)[0][0] | ||
| 88 | end | ||
| 83 | end | 89 | end |
| 84 | end | 90 | end |
| @@ -18,6 +18,10 @@ module Docs · 17 unmodified lines | |||
| 18 | Licensed under the MIT license. | 18 | Licensed under the MIT license. |
| 19 | HTML | 19 | HTML |
| 20 | 20 | ||
| 21 | def get_latest_version(opts) | ||
| 22 | get_npm_version('pug', opts) | ||
| 23 | end | ||
| 24 | |||
| 21 | private | 25 | private |
| 22 | 26 | ||
| 23 | def parse(response) # Hook here because Nokogori removes whitespace from textareas | 27 | def parse(response) # Hook here because Nokogori removes whitespace from textareas |
| @@ -14,5 +14,10 @@ module Docs · 13 unmodified lines | |||
| 14 | © 2017 Google Inc<br> | 14 | © 2017 Google Inc<br> |
| 15 | Licensed under the Apache License 2.0. | 15 | Licensed under the Apache License 2.0. |
| 16 | HTML | 16 | HTML |
| 17 | |||
| 18 | def get_latest_version(opts) | ||
| 19 | contents = get_github_file_contents('GoogleChrome', 'puppeteer', 'README.md', opts) | ||
| 20 | contents.scan(/\/v([0-9.]+)\/docs\/api\.md/)[0][0] | ||
| 21 | end | ||
| 17 | end | 22 | end |
| 18 | end | 23 | end |
| @@ -2,6 +2,7 @@ module Docs · 1 unmodified line | |||
| 2 | class Pygame < UrlScraper | 2 | class Pygame < UrlScraper |
| 3 | self.type = 'simple' | 3 | self.type = 'simple' |
| 4 | self.release = '1.9.4' | 4 | self.release = '1.9.4' |
| 5 | self.base_url = 'https://www.pygame.org/docs/' | ||
| 5 | self.root_path = 'py-modindex.html' | 6 | self.root_path = 'py-modindex.html' |
| 6 | self.links = { | 7 | self.links = { |
| 7 | home: 'https://www.pygame.org/', | 8 | home: 'https://www.pygame.org/', |
| @@ -16,5 +17,9 @@ module Docs · 8 unmodified lines | |||
| 16 | © Pygame Developpers.<br> | 17 | © Pygame Developpers.<br> |
| 17 | Licensed under the GNU LGPL License version 2.1. | 18 | Licensed under the GNU LGPL License version 2.1. |
| 18 | HTML | 19 | HTML |
| 20 | |||
| 21 | def get_latest_version(opts) | ||
| 22 | get_latest_github_release('pygame', 'pygame', opts) | ||
| 23 | end | ||
| 19 | end | 24 | end |
| 20 | end | 25 | end |
| @@ -50,5 +50,10 @@ module Docs · 49 unmodified lines | |||
| 50 | 50 | ||
| 51 | html_filters.push 'python/entries_v2', 'sphinx/clean_html', 'python/clean_html' | 51 | html_filters.push 'python/entries_v2', 'sphinx/clean_html', 'python/clean_html' |
| 52 | end | 52 | end |
| 53 | |||
| 54 | def get_latest_version(opts) | ||
| 55 | doc = fetch_doc('https://docs.python.org/', opts) | ||
| 56 | doc.at_css('.version_switcher_placeholder').content | ||
| 57 | end | ||
| 53 | end | 58 | end |
| 54 | end | 59 | end |
| @@ -19,5 +19,9 @@ module Docs · 18 unmodified lines | |||
| 19 | © 2009–2017 Kristopher Michael Kowal<br> | 19 | © 2009–2017 Kristopher Michael Kowal<br> |
| 20 | Licensed under the MIT License. | 20 | Licensed under the MIT License. |
| 21 | HTML | 21 | HTML |
| 22 | |||
| 23 | def get_latest_version(opts) | ||
| 24 | get_npm_version('q', opts) | ||
| 25 | end | ||
| 22 | end | 26 | end |
| 23 | end | 27 | end |
| @@ -103,9 +103,19 @@ module Docs · 102 unmodified lines | |||
| 103 | Licensed under the GNU Free Documentation License, Version 1.3. | 103 | Licensed under the GNU Free Documentation License, Version 1.3. |
| 104 | HTML | 104 | HTML |
| 105 | 105 | ||
| 106 | version '5.13' do | ||
| 107 | self.release = '5.13' | ||
| 108 | self.base_url = 'https://doc.qt.io/qt-5.13/' | ||
| 109 | end | ||
| 110 | |||
| 111 | version '5.12' do | ||
| 112 | self.release = '5.12' | ||
| 113 | self.base_url = 'https://doc.qt.io/qt-5.12/' | ||
| 114 | end | ||
| 115 | |||
| 106 | version '5.11' do | 116 | version '5.11' do |
| 107 | self.release = '5.11' | 117 | self.release = '5.11' |
| 108 | self.base_url = 'https://doc.qt.io/qt-5/' | 118 | self.base_url = 'https://doc.qt.io/archives/qt-5.11/' |
| 109 | end | 119 | end |
| 110 | 120 | ||
| 111 | version '5.9' do | 121 | version '5.9' do |
| @@ -115,7 +125,12 @@ module Docs · 3 unmodified lines | |||
| 115 | 125 | ||
| 116 | version '5.6' do | 126 | version '5.6' do |
| 117 | self.release = '5.6' | 127 | self.release = '5.6' |
| 118 | self.base_url = 'https://doc.qt.io/qt-5.6/' | 128 | self.base_url = 'https://doc.qt.io/archives/qt-5.6/' |
| 129 | end | ||
| 130 | |||
| 131 | def get_latest_version(opts) | ||
| 132 | doc = fetch_doc('https://doc.qt.io/qt-5/index.html', opts) | ||
| 133 | doc.at_css('.mainContent h1.title').content.sub(/Qt /, '') | ||
| 119 | end | 134 | end |
| 120 | end | 135 | end |
| 121 | end | 136 | end |
| @@ -15,6 +15,11 @@ module Docs · 14 unmodified lines | |||
| 15 | © 2013–2016 Scott Sauyet and Michael Hurley<br> | 15 | © 2013–2016 Scott Sauyet and Michael Hurley<br> |
| 16 | Licensed under the MIT License. | 16 | Licensed under the MIT License. |
| 17 | HTML | 17 | HTML |
| 18 | |||
| 19 | def get_latest_version(opts) | ||
| 20 | doc = fetch_doc('https://ramdajs.com/docs/', opts) | ||
| 21 | doc.at_css('.navbar-brand > .version').content[1..-1] | ||
| 22 | end | ||
| 18 | end | 23 | end |
| 19 | end | 24 | end |
| 20 | 25 | ||
| @@ -21,5 +21,10 @@ module Docs · 20 unmodified lines | |||
| 21 | © Ryan Davis, seattle.rb<br> | 21 | © Ryan Davis, seattle.rb<br> |
| 22 | Licensed under the MIT License. | 22 | Licensed under the MIT License. |
| 23 | HTML | 23 | HTML |
| 24 | |||
| 25 | def get_latest_version(opts) | ||
| 26 | contents = get_github_file_contents('seattlerb', 'minitest', 'History.rdoc', opts) | ||
| 27 | contents.scan(/([0-9.]+)/)[0][0] | ||
| 28 | end | ||
| 24 | end | 29 | end |
| 25 | end | 30 | end |
| @@ -93,5 +93,9 @@ module Docs · 92 unmodified lines | |||
| 93 | version '4.1' do | 93 | version '4.1' do |
| 94 | self.release = '4.1.16' | 94 | self.release = '4.1.16' |
| 95 | end | 95 | end |
| 96 | |||
| 97 | def get_latest_version(opts) | ||
| 98 | get_latest_github_release('rails', 'rails', opts) | ||
| 99 | end | ||
| 96 | end | 100 | end |
| 97 | end | 101 | end |
| @@ -84,5 +84,16 @@ module Docs · 83 unmodified lines | |||
| 84 | version '2.2' do | 84 | version '2.2' do |
| 85 | self.release = '2.2.10' | 85 | self.release = '2.2.10' |
| 86 | end | 86 | end |
| 87 | |||
| 88 | def get_latest_version(opts) | ||
| 89 | tags = get_github_tags('ruby', 'ruby', opts) | ||
| 90 | tags.each do |tag| | ||
| 91 | version = tag['name'].gsub(/_/, '.')[1..-1] | ||
| 92 | |||
| 93 | if !/^([0-9.]+)$/.match(version).nil? && version.count('.') == 2 | ||
| 94 | return version | ||
| 95 | end | ||
| 96 | end | ||
| 97 | end | ||
| 87 | end | 98 | end |
| 88 | end | 99 | end |
| @@ -30,5 +30,10 @@ module Docs · 29 unmodified lines | |||
| 30 | © 2013–present Facebook Inc.<br> | 30 | © 2013–present Facebook Inc.<br> |
| 31 | Licensed under the Creative Commons Attribution 4.0 International Public License. | 31 | Licensed under the Creative Commons Attribution 4.0 International Public License. |
| 32 | HTML | 32 | HTML |
| 33 | |||
| 34 | def get_latest_version(opts) | ||
| 35 | doc = fetch_doc('https://reactjs.org/docs/getting-started.html', opts) | ||
| 36 | doc.at_css('a[href="/versions"]').content.strip[1..-1] | ||
| 37 | end | ||
| 33 | end | 38 | end |
| 34 | end | 39 | end |
| @@ -30,5 +30,10 @@ module Docs · 29 unmodified lines | |||
| 30 | © 2015–2018 Facebook Inc.<br> | 30 | © 2015–2018 Facebook Inc.<br> |
| 31 | Licensed under the Creative Commons Attribution 4.0 International Public License. | 31 | Licensed under the Creative Commons Attribution 4.0 International Public License. |
| 32 | HTML | 32 | HTML |
| 33 | |||
| 34 | def get_latest_version(opts) | ||
| 35 | doc = fetch_doc('https://facebook.github.io/react-native/docs/getting-started.html', opts) | ||
| 36 | doc.at_css('header > a > h3').content | ||
| 37 | end | ||
| 33 | end | 38 | end |
| 34 | end | 39 | end |
| @@ -19,5 +19,11 @@ module Docs · 18 unmodified lines | |||
| 19 | © 2009–2018 Salvatore Sanfilippo<br> | 19 | © 2009–2018 Salvatore Sanfilippo<br> |
| 20 | Licensed under the Creative Commons Attribution-ShareAlike License 4.0. | 20 | Licensed under the Creative Commons Attribution-ShareAlike License 4.0. |
| 21 | HTML | 21 | HTML |
| 22 | |||
| 23 | def get_latest_version(opts) | ||
| 24 | body = fetch('http://download.redis.io/redis-stable/00-RELEASENOTES', opts) | ||
| 25 | body = body.lines[1..-1].join | ||
| 26 | body.scan(/Redis ([0-9.]+)/)[0][0] | ||
| 27 | end | ||
| 22 | end | 28 | end |
| 23 | end | 29 | end |
| @@ -20,5 +20,9 @@ module Docs · 19 unmodified lines | |||
| 20 | stub '' do | 20 | stub '' do |
| 21 | request_one('http://redux.js.org/index.html').body | 21 | request_one('http://redux.js.org/index.html').body |
| 22 | end | 22 | end |
| 23 | |||
| 24 | def get_latest_version(opts) | ||
| 25 | get_npm_version('redux', opts) | ||
| 26 | end | ||
| 23 | end | 27 | end |
| 24 | end | 28 | end |
| @@ -18,5 +18,10 @@ module Docs · 17 unmodified lines | |||
| 18 | © 2013–present Facebook Inc.<br> | 18 | © 2013–present Facebook Inc.<br> |
| 19 | Licensed under the BSD License. | 19 | Licensed under the BSD License. |
| 20 | HTML | 20 | HTML |
| 21 | |||
| 22 | def get_latest_version(opts) | ||
| 23 | doc = fetch_doc('http://facebook.github.io/relay/en/', opts) | ||
| 24 | doc.at_css('header > a > h3').content[1..-1] | ||
| 25 | end | ||
| 21 | end | 26 | end |
| 22 | end | 27 | end |
| @@ -30,5 +30,9 @@ module Docs · 29 unmodified lines | |||
| 30 | © jQuery Foundation and other contributors<br> | 30 | © jQuery Foundation and other contributors<br> |
| 31 | Licensed under the MIT License. | 31 | Licensed under the MIT License. |
| 32 | HTML | 32 | HTML |
| 33 | |||
| 34 | def get_latest_version(opts) | ||
| 35 | get_npm_version('requirejs', opts) | ||
| 36 | end | ||
| 33 | end | 37 | end |
| 34 | end | 38 | end |
| @@ -58,6 +58,10 @@ module Docs · 57 unmodified lines | |||
| 58 | CODE | 58 | CODE |
| 59 | end | 59 | end |
| 60 | 60 | ||
| 61 | def get_latest_version(opts) | ||
| 62 | get_latest_github_release('rethinkdb', 'rethinkdb', opts) | ||
| 63 | end | ||
| 64 | |||
| 61 | private | 65 | private |
| 62 | 66 | ||
| 63 | def process_response?(response) | 67 | def process_response?(response) |
| @@ -39,6 +39,12 @@ module Docs · 38 unmodified lines | |||
| 39 | Licensed under the Apache License, Version 2.0 or the MIT license, at your option. | 39 | Licensed under the Apache License, Version 2.0 or the MIT license, at your option. |
| 40 | HTML | 40 | HTML |
| 41 | 41 | ||
| 42 | def get_latest_version(opts) | ||
| 43 | doc = fetch_doc('https://www.rust-lang.org/', opts) | ||
| 44 | label = doc.at_css('.button-download + p > a').content | ||
| 45 | label.sub(/Version /, '') | ||
| 46 | end | ||
| 47 | |||
| 42 | private | 48 | private |
| 43 | 49 | ||
| 44 | REDIRECT_RGX = /http-equiv="refresh"/i | 50 | REDIRECT_RGX = /http-equiv="refresh"/i |
| @@ -23,5 +23,9 @@ module Docs · 22 unmodified lines | |||
| 23 | © 2006–2016 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein<br> | 23 | © 2006–2016 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein<br> |
| 24 | Licensed under the MIT License. | 24 | Licensed under the MIT License. |
| 25 | HTML | 25 | HTML |
| 26 | |||
| 27 | def get_latest_version(opts) | ||
| 28 | get_latest_github_release('sass', 'libsass', opts) | ||
| 29 | end | ||
| 26 | end | 30 | end |
| 27 | end | 31 | end |
| @@ -20,5 +20,10 @@ module Docs · 19 unmodified lines | |||
| 20 | © 2011 the scikit-image team<br> | 20 | © 2011 the scikit-image team<br> |
| 21 | Licensed under the BSD 3-clause License. | 21 | Licensed under the BSD 3-clause License. |
| 22 | HTML | 22 | HTML |
| 23 | |||
| 24 | def get_latest_version(opts) | ||
| 25 | tags = get_github_tags('scikit-image', 'scikit-image', opts) | ||
| 26 | tags[0]['name'][1..-1] | ||
| 27 | end | ||
| 23 | end | 28 | end |
| 24 | end | 29 | end |
| @@ -25,5 +25,9 @@ module Docs · 24 unmodified lines | |||
| 25 | Licensed under the 3-clause BSD License. | 25 | Licensed under the 3-clause BSD License. |
| 26 | HTML | 26 | HTML |
| 27 | 27 | ||
| 28 | def get_latest_version(opts) | ||
| 29 | doc = fetch_doc('https://scikit-learn.org/stable/documentation.html', opts) | ||
| 30 | doc.at_css('.body h1').content.scan(/([0-9.]+)/)[0][0] | ||
| 31 | end | ||
| 28 | end | 32 | end |
| 29 | end | 33 | end |
| @@ -52,5 +52,10 @@ module Docs · 51 unmodified lines | |||
| 52 | self.release = '1.17.7' | 52 | self.release = '1.17.7' |
| 53 | self.base_url = "https://sinonjs.org/releases/v#{release}/" | 53 | self.base_url = "https://sinonjs.org/releases/v#{release}/" |
| 54 | end | 54 | end |
| 55 | |||
| 56 | def get_latest_version(opts) | ||
| 57 | body = fetch('https://sinonjs.org/', opts) | ||
| 58 | body.scan(/\/releases\/v([0-9.]+)/)[0][0] | ||
| 59 | end | ||
| 55 | end | 60 | end |
| 56 | end | 61 | end |
| @@ -20,5 +20,9 @@ module Docs · 19 unmodified lines | |||
| 20 | © 2014–2015 Automattic<br> | 20 | © 2014–2015 Automattic<br> |
| 21 | Licensed under the MIT License. | 21 | Licensed under the MIT License. |
| 22 | HTML | 22 | HTML |
| 23 | |||
| 24 | def get_latest_version(opts) | ||
| 25 | get_npm_version('socket.io', opts) | ||
| 26 | end | ||
| 23 | end | 27 | end |
| 24 | end | 28 | end |
| @@ -41,6 +41,11 @@ module Docs · 40 unmodified lines | |||
| 41 | 41 | ||
| 42 | options[:attribution] = 'SQLite is in the Public Domain.' | 42 | options[:attribution] = 'SQLite is in the Public Domain.' |
| 43 | 43 | ||
| 44 | def get_latest_version(opts) | ||
| 45 | doc = fetch_doc('https://sqlite.org/chronology.html', opts) | ||
| 46 | doc.at_css('#chrontab > tbody > tr > td:last-child > a').content | ||
| 47 | end | ||
| 48 | |||
| 44 | private | 49 | private |
| 45 | 50 | ||
| 46 | def parse(response) | 51 | def parse(response) |
| @@ -21,5 +21,9 @@ module Docs · 20 unmodified lines | |||
| 21 | Licensed under the 3-clause BSD License. | 21 | Licensed under the 3-clause BSD License. |
| 22 | HTML | 22 | HTML |
| 23 | 23 | ||
| 24 | def get_latest_version(opts) | ||
| 25 | doc = fetch_doc('http://www.statsmodels.org/stable/', opts) | ||
| 26 | doc.at_css('.sphinxsidebarwrapper h3 + p > b').content[1..-1] | ||
| 27 | end | ||
| 24 | end | 28 | end |
| 25 | end | 29 | end |
| @@ -178,5 +178,11 @@ module Docs · 177 unmodified lines | |||
| 178 | </p> | 178 | </p> |
| 179 | </div> | 179 | </div> |
| 180 | HTML | 180 | HTML |
| 181 | |||
| 182 | def get_latest_version(opts) | ||
| 183 | body = fetch('https://feeds.feedburner.com/WhenCanIUse?format=xml', opts) | ||
| 184 | timestamp = body.scan(/<updated>([^<]+)<\/updated>/)[0][0] | ||
| 185 | DateTime.parse(timestamp).to_time.to_i | ||
| 186 | end | ||
| 181 | end | 187 | end |
| 182 | end | 188 | end |
| @@ -70,5 +70,9 @@ module Docs · 69 unmodified lines | |||
| 70 | self.release = '2.7.35' | 70 | self.release = '2.7.35' |
| 71 | self.base_url = "https://api.symfony.com/#{version}/" | 71 | self.base_url = "https://api.symfony.com/#{version}/" |
| 72 | end | 72 | end |
| 73 | |||
| 74 | def get_latest_version(opts) | ||
| 75 | get_latest_github_release('symfony', 'symfony', opts) | ||
| 76 | end | ||
| 73 | end | 77 | end |
| 74 | end | 78 | end |
| @@ -25,5 +25,10 @@ module Docs · 24 unmodified lines | |||
| 25 | options[:attribution] = <<-HTML | 25 | options[:attribution] = <<-HTML |
| 26 | Licensed under <a href="http://tcl.tk/software/tcltk/license.html">Tcl/Tk terms</a> | 26 | Licensed under <a href="http://tcl.tk/software/tcltk/license.html">Tcl/Tk terms</a> |
| 27 | HTML | 27 | HTML |
| 28 | |||
| 29 | def get_latest_version(opts) | ||
| 30 | doc = fetch_doc('https://www.tcl.tk/man/tcl/contents.htm', opts) | ||
| 31 | doc.at_css('h2').content.scan(/Tk([0-9.]+)/)[0][0] | ||
| 32 | end | ||
| 28 | end | 33 | end |
| 29 | end | 34 | end |
| @@ -56,6 +56,10 @@ module Docs · 55 unmodified lines | |||
| 56 | /\Aextend/] | 56 | /\Aextend/] |
| 57 | end | 57 | end |
| 58 | 58 | ||
| 59 | def get_latest_version(opts) | ||
| 60 | get_latest_github_release('tensorflow', 'tensorflow', opts) | ||
| 61 | end | ||
| 62 | |||
| 59 | private | 63 | private |
| 60 | 64 | ||
| 61 | def parse(response) | 65 | def parse(response) |
| @@ -18,5 +18,10 @@ module Docs · 17 unmodified lines | |||
| 18 | © 2018 HashiCorp</br> | 18 | © 2018 HashiCorp</br> |
| 19 | Licensed under the MPL 2.0 License. | 19 | Licensed under the MPL 2.0 License. |
| 20 | HTML | 20 | HTML |
| 21 | |||
| 22 | def get_latest_version(opts) | ||
| 23 | contents = get_github_file_contents('hashicorp', 'terraform-website', 'content/config.rb', opts) | ||
| 24 | contents.scan(/version\s+=\s+"([0-9.]+)"/)[0][0] | ||
| 25 | end | ||
| 21 | end | 26 | end |
| 22 | end | 27 | end |
| @@ -28,5 +28,10 @@ module Docs · 27 unmodified lines | |||
| 28 | self.release = '1.34.3' | 28 | self.release = '1.34.3' |
| 29 | self.base_url = 'https://twig.symfony.com/doc/1.x/' | 29 | self.base_url = 'https://twig.symfony.com/doc/1.x/' |
| 30 | end | 30 | end |
| 31 | |||
| 32 | def get_latest_version(opts) | ||
| 33 | tags = get_github_tags('twigphp', 'Twig', opts) | ||
| 34 | tags[0]['name'][1..-1] | ||
| 35 | end | ||
| 31 | end | 36 | end |
| 32 | end | 37 | end |
| @@ -24,6 +24,10 @@ module Docs · 23 unmodified lines | |||
| 24 | © Microsoft and other contributors<br> | 24 | © Microsoft and other contributors<br> |
| 25 | Licensed under the Apache License, Version 2.0. | 25 | Licensed under the Apache License, Version 2.0. |
| 26 | HTML | 26 | HTML |
| 27 | |||
| 28 | def get_latest_version(opts) | ||
| 29 | get_latest_github_release('Microsoft', 'TypeScript', opts) | ||
| 30 | end | ||
| 27 | end | 31 | end |
| 28 | end | 32 | end |
| 29 | 33 | ||
| @@ -20,5 +20,10 @@ module Docs · 19 unmodified lines | |||
| 20 | © 2009–2018 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors<br> | 20 | © 2009–2018 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors<br> |
| 21 | Licensed under the MIT License. | 21 | Licensed under the MIT License. |
| 22 | HTML | 22 | HTML |
| 23 | |||
| 24 | def get_latest_version(opts) | ||
| 25 | doc = fetch_doc('https://underscorejs.org/', opts) | ||
| 26 | doc.at_css('.version').content[1...-1] | ||
| 27 | end | ||
| 23 | end | 28 | end |
| 24 | end | 29 | end |
| @@ -18,5 +18,10 @@ module Docs · 17 unmodified lines | |||
| 18 | © 2010–2018 Mitchell Hashimoto<br> | 18 | © 2010–2018 Mitchell Hashimoto<br> |
| 19 | Licensed under the MPL 2.0 License. | 19 | Licensed under the MPL 2.0 License. |
| 20 | HTML | 20 | HTML |
| 21 | |||
| 22 | def get_latest_version(opts) | ||
| 23 | contents = get_github_file_contents('hashicorp', 'vagrant', 'website/config.rb', opts) | ||
| 24 | contents.scan(/version\s+=\s+"([0-9.]+)"/)[0][0] | ||
| 25 | end | ||
| 21 | end | 26 | end |
| 22 | end | 27 | end |
| @@ -32,5 +32,9 @@ module Docs · 31 unmodified lines | |||
| 32 | self.root_path = '/guide/index.html' | 32 | self.root_path = '/guide/index.html' |
| 33 | self.initial_paths = %w(/api/index.html) | 33 | self.initial_paths = %w(/api/index.html) |
| 34 | end | 34 | end |
| 35 | |||
| 36 | def get_latest_version(opts) | ||
| 37 | get_latest_github_release('vuejs', 'vue', opts) | ||
| 38 | end | ||
| 35 | end | 39 | end |
| 36 | end | 40 | end |
| @@ -20,5 +20,10 @@ module Docs · 19 unmodified lines | |||
| 20 | Licensed under the Creative Commons Attribution 4.0 International License.<br> | 20 | Licensed under the Creative Commons Attribution 4.0 International License.<br> |
| 21 | Vulkan and the Vulkan logo are registered trademarks of the Khronos Group Inc. | 21 | Vulkan and the Vulkan logo are registered trademarks of the Khronos Group Inc. |
| 22 | HTML | 22 | HTML |
| 23 | |||
| 24 | def get_latest_version(opts) | ||
| 25 | tags = get_github_tags('KhronosGroup', 'Vulkan-Docs', opts) | ||
| 26 | tags[0]['name'][1..-1] | ||
| 27 | end | ||
| 23 | end | 28 | end |
| 24 | end | 29 | end |
| @@ -68,5 +68,9 @@ module Docs · 67 unmodified lines | |||
| 68 | Licensed under the MIT License. | 68 | Licensed under the MIT License. |
| 69 | HTML | 69 | HTML |
| 70 | end | 70 | end |
| 71 | |||
| 72 | def get_latest_version(opts) | ||
| 73 | get_npm_version('webpack', opts) | ||
| 74 | end | ||
| 71 | end | 75 | end |
| 72 | end | 76 | end |
| @@ -20,5 +20,9 @@ module Docs · 19 unmodified lines | |||
| 20 | © 2016–present Yarn Contributors<br> | 20 | © 2016–present Yarn Contributors<br> |
| 21 | Licensed under the BSD License. | 21 | Licensed under the BSD License. |
| 22 | HTML | 22 | HTML |
| 23 | |||
| 24 | def get_latest_version(opts) | ||
| 25 | get_latest_github_release('yarnpkg', 'yarn', opts) | ||
| 26 | end | ||
| 23 | end | 27 | end |
| 24 | end | 28 | end |
| @@ -34,5 +34,9 @@ module Docs · 33 unmodified lines | |||
| 34 | 34 | ||
| 35 | options[:container] = '.grid_9' | 35 | options[:container] = '.grid_9' |
| 36 | end | 36 | end |
| 37 | |||
| 38 | def get_latest_version(opts) | ||
| 39 | get_latest_github_release('yiisoft', 'yii2', opts) | ||
| 40 | end | ||
| 37 | end | 41 | end |
| 38 | end | 42 | end |