Unified · Split
| @@ -262,5 +262,11 @@ module Docs · 261 unmodified lines | |||
| 262 | json = fetch_json("https://api.github.com/repos/#{owner}/#{repo}/contents/#{path}", opts) | 262 | json = fetch_json("https://api.github.com/repos/#{owner}/#{repo}/contents/#{path}", opts) |
| 263 | Base64.decode64(json['content']) | 263 | Base64.decode64(json['content']) |
| 264 | end | 264 | end |
| 265 | |||
| 266 | def get_latest_github_commit_date(owner, repo, opts) | ||
| 267 | commits = fetch_json("https://api.github.com/repos/#{owner}/#{repo}/commits", opts) | ||
| 268 | timestamp = commits[0]['commit']['author']['date'] | ||
| 269 | Date.iso8601(timestamp).to_time.to_i | ||
| 270 | end | ||
| 265 | end | 271 | end |
| 266 | end | 272 | end |
| @@ -1,7 +1,7 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Reactivex < UrlScraper | 2 | class Reactivex < UrlScraper |
| 3 | self.type = 'reactivex' | ||
| 4 | self.name = 'ReactiveX' | 3 | self.name = 'ReactiveX' |
| 4 | self.type = 'reactivex' | ||
| 5 | self.base_url = 'http://reactivex.io/' | 5 | self.base_url = 'http://reactivex.io/' |
| 6 | self.root_path = 'intro.html' | 6 | self.root_path = 'intro.html' |
| 7 | self.links = { | 7 | self.links = { |
| @@ -19,5 +19,9 @@ module Docs · 11 unmodified lines | |||
| 19 | © ReactiveX contributors<br> | 19 | © ReactiveX contributors<br> |
| 20 | Licensed under the Apache License 2.0. | 20 | Licensed under the Apache License 2.0. |
| 21 | HTML | 21 | HTML |
| 22 | |||
| 23 | def get_latest_version(opts) | ||
| 24 | get_latest_github_commit_date('ReactiveX', 'reactivex.github.io', opts) | ||
| 25 | end | ||
| 22 | end | 26 | end |
| 23 | end | 27 | end |
File renamed without changes.
File renamed without changes.