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