History

reactivex: implement get_latest_version

Jasper van Merle committed 7 years ago

Commit c88ae2c1 parent 3e1e65e4 files · +9 −-1Browse files

Unified · Split

4 files
  1. lib/docs/core/doc.rb +6 −0
  2. lib/docs/scrapers/reactivex.rb +5 −1
  3. public/icons/docs/reactivex/16.png +0 −0
  4. public/icons/docs/reactivex/16@2x.png +0 −0
lib/docs/core/doc.rb+6−0
@@ -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 end264 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 end271 end
266end272end
lib/docs/scrapers/reactivex.rb+5−1
@@ -1,7 +1,7 @@
1module Docs1module Docs
2 class Reactivex < UrlScraper2 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 &copy; ReactiveX contributors<br>19 &copy; ReactiveX contributors<br>
20 Licensed under the Apache License 2.0.20 Licensed under the Apache License 2.0.
21 HTML21 HTML
22
23 def get_latest_version(opts)
24 get_latest_github_commit_date('ReactiveX', 'reactivex.github.io', opts)
25 end
22 end26 end
23end27end
public/icons/docs/reactivex/16.pngrenamed from public/icons/docs/reactivex/logo.png+0−0

File renamed without changes.

public/icons/docs/reactivex/16@2x.pngrenamed from public/icons/docs/reactivex/logo@2x.png+0−0

File renamed without changes.