Skip to content

Commit 040082f

Browse files
committed
Update Koa documentation (3.0.0)
1 parent 3794bf6 commit 040082f

File tree

1 file changed

+31
-8
lines changed

1 file changed

+31
-8
lines changed

lib/docs/scrapers/koa.rb

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
module Docs
44
class Koa < Github
5-
self.base_url = 'https://github.com/koajs/koa/blob/master/docs'
6-
self.release = '2.15.0'
7-
8-
self.root_path = 'api/index.md'
95
self.initial_paths = %w[
106
error-handling
117
faq
@@ -30,16 +26,43 @@ class Koa < Github
3026
options[:trailing_slash] = false
3127
options[:container] = '.markdown-body'
3228

33-
options[:fix_urls] = ->(url) do
34-
url.sub! 'https://koajs.com/#error-handling', Koa.base_url + '/error-handling.md'
35-
url
36-
end
29+
3730

3831
options[:attribution] = <<-HTML
3932
&copy; 2020 Koa contributors<br>
4033
Licensed under the MIT License.
4134
HTML
4235

36+
version do
37+
self.base_url = 'https://github.com/koajs/koa/blob/v3.0.0/docs'
38+
self.root_path = 'api/index.md'
39+
self.release = '3.0.0'
40+
options[:fix_urls] = ->(url) do
41+
url.sub! 'https://koajs.com/#error-handling', self.base_url + '/error-handling.md'
42+
url
43+
end
44+
end
45+
46+
version '2' do
47+
self.base_url = 'https://github.com/koajs/koa/blob/v2.16.1/docs'
48+
self.root_path = 'api/index.md'
49+
self.release = '2.16.1'
50+
options[:fix_urls] = ->(url) do
51+
url.sub! 'https://koajs.com/#error-handling', self.base_url + '/error-handling.md'
52+
url
53+
end
54+
end
55+
56+
version '1' do
57+
self.base_url = 'https://github.com/koajs/koa/blob/1.7.1/docs'
58+
self.root_path = 'api/index.md'
59+
self.release = '1.7.1'
60+
options[:fix_urls] = ->(url) do
61+
url.sub! 'https://koajs.com/#error-handling', self.base_url + '/error-handling.md'
62+
url
63+
end
64+
end
65+
4366
def get_latest_version(opts)
4467
get_npm_version('koa', opts)
4568
end

0 commit comments

Comments
 (0)