reactivex: implement get_latest_version

pull/970/head
Jasper van Merle 6 years ago
parent 3e1e65efec
commit c88ae2c1e1

@ -262,5 +262,11 @@ module Docs
json = fetch_json("https://api.github.com/repos/#{owner}/#{repo}/contents/#{path}", opts)
Base64.decode64(json['content'])
end
def get_latest_github_commit_date(owner, repo, opts)
commits = fetch_json("https://api.github.com/repos/#{owner}/#{repo}/commits", opts)
timestamp = commits[0]['commit']['author']['date']
Date.iso8601(timestamp).to_time.to_i
end
end
end

@ -1,7 +1,7 @@
module Docs
class Reactivex < UrlScraper
self.type = 'reactivex'
self.name = 'ReactiveX'
self.type = 'reactivex'
self.base_url = 'http://reactivex.io/'
self.root_path = 'intro.html'
self.links = {
@ -19,5 +19,9 @@ module Docs
&copy; ReactiveX contributors<br>
Licensed under the Apache License 2.0.
HTML
def get_latest_version(opts)
get_latest_github_commit_date('ReactiveX', 'reactivex.github.io', opts)
end
end
end

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Loading…
Cancel
Save