devdocs/lib/docs/scrapers/clojure.rb

42 lines
1.1 KiB
Ruby
Raw Normal View History

2015-02-15 20:14:20 +01:00
module Docs
class Clojure < UrlScraper
self.type = 'clojure'
self.root_path = 'api-index.html'
html_filters.push 'clojure/entries', 'clojure/clean_html'
options[:container] = '#content_view'
options[:only_patterns] = [/\Aclojure\./]
options[:attribution] = <<-HTML
&copy; Rich Hickey<br>
Licensed under the Eclipse Public License 1.0.
HTML
2019-03-20 12:57:07 +01:00
version '1.10' do
self.release = '1.10 (stable)'
2019-03-20 12:57:07 +01:00
self.base_url = 'https://clojure.github.io/clojure/'
end
2018-01-08 00:16:39 +01:00
version '1.9' do
self.release = '1.9 (legacy)'
2019-03-20 12:57:07 +01:00
self.base_url = 'https://clojure.github.io/clojure/branch-clojure-1.9.0/'
2018-01-08 00:16:39 +01:00
end
version '1.8' do
self.release = '1.8 (legacy)'
2018-01-08 00:16:39 +01:00
self.base_url = 'https://clojure.github.io/clojure/branch-clojure-1.8.0/'
end
version '1.7' do
self.release = '1.7 (legacy)'
self.base_url = 'https://clojure.github.io/clojure/branch-clojure-1.7.0/'
end
2019-03-10 03:02:24 +01:00
def get_latest_version(opts)
doc = fetch_doc('http://clojure.github.io/clojure/index.html', opts)
doc.at_css('#header-version').content[1..-1]
end
2015-02-15 20:14:20 +01:00
end
end