forked from freeCodeCamp/devdocs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodeceptjs.rb
37 lines (31 loc) · 1019 Bytes
/
codeceptjs.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
module Docs
class Codeceptjs < UrlScraper
self.name = 'CodeceptJS'
self.type = 'simple'
self.root_path = 'index.html'
self.release = '3.0.2'
self.base_url = 'https://codecept.io/'
self.links = {
home: 'https://codecept.io/',
code: 'https://github.com/codeception/codeceptjs'
}
html_filters.push 'codeceptjs/clean_html', 'codeceptjs/entries', 'title'
options[:root_title] = 'CodeceptJS'
options[:title] = false
options[:skip_links] = ->(filter) { !filter.root_page? }
options[:skip_patterns] = [/changelog/, /quickstart\z/]
options[:fix_urls] = -> (url) do
url.sub! %r{\.html\z}, ''
url.sub! %r{custom-helpers\z}, 'helpers'
url
end
options[:trailing_slash] = true
options[:attribution] = <<-HTML
© 2015 DavertMik <davert@codegyre.com> (http://codegyre.com)<br>
Licensed under the MIT License.
HTML
def get_latest_version(opts)
get_npm_version('codeceptjs', opts)
end
end
end