forked from freeCodeCamp/devdocs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinfluxdata.rb
54 lines (45 loc) · 2.14 KB
/
influxdata.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
module Docs
class Influxdata < UrlScraper
self.name = 'InfluxData'
self.type = 'simple'
self.release = '1.3'
self.base_url = 'https://docs.influxdata.com/'
self.links = {
home: 'https://www.influxdata.com/',
code: 'https://github.com/influxdata/influxdb'
}
html_filters.push 'influxdata/entries', 'influxdata/clean_html', 'title'
options[:trailing_slash] = true
options[:root_title] = 'InfluxData Documentation'
options[:title] = false
options[:only_patterns] = [/(telegraf|influxdb|chronograf|kapacitor)\/v#{release}/]
options[:skip_patterns] = [/enterprise/]
options[:skip] = [
"influxdb/v#{release}/sample_data/data_download/",
"influxdb/v#{release}/tools/grafana/",
"influxdb/v#{release}/about/",
"influxdb/v#{release}/external_resources/",
"influxdb/v#{release}/administration/security_best_practices/"
]
options[:replace_paths] = {
"telegraf/v#{release}/introduction/getting-started-telegraf/" => "telegraf/v#{release}/introduction/getting_started/",
"influxdb/v#{release}/write_protocols/line/" => "influxdb/v#{release}/write_protocols/line_protocol_tutorial/",
"influxdb/v#{release}/write_protocols/graphite/" => "influxdb/v#{release}/tools/graphite/",
"influxdb/v#{release}/clients/api/" => "influxdb/v#{release}/tools/api_client_libraries/",
"influxdb/v#{release}/concepts/010_vs_011/" => "influxdb/v#{release}/administration/differences/",
"influxdb/v#{release}/write_protocols/write_syntax/" => "influxdb/v#{release}/write_protocols/line_protocol_reference/",
"influxdb/v#{release}/write_protocols/udp/" => "influxdb/v#{release}/tools/udp/"
}
options[:fix_urls] = ->(url) do
url.sub! %r{/influxdb/v([\d\.]+)/.+/influxdb/v[\d\.]+/}, '/influxdb/v\1/'
url
end
options[:attribution] = <<-HTML
© 2015 InfluxData, Inc.<br>
Licensed under the MIT license.
HTML
def get_latest_version(opts)
get_latest_github_release('influxdata', 'influxdb', opts)
end
end
end