|
@@ -3,7 +3,7 @@ module Docs
|
|
|
self.name = 'RethinkDB'
|
|
self.name = 'RethinkDB'
|
|
|
self.type = 'rethinkdb'
|
|
self.type = 'rethinkdb'
|
|
|
self.base_url = 'https://rethinkdb.com/'
|
|
self.base_url = 'https://rethinkdb.com/'
|
|
|
- self.release = '2.3.5'
|
|
|
|
|
|
|
+ self.release = '2.4.1'
|
|
|
self.root_path = 'docs/'
|
|
self.root_path = 'docs/'
|
|
|
self.links = {
|
|
self.links = {
|
|
|
home: 'https://rethinkdb.com/',
|
|
home: 'https://rethinkdb.com/',
|
|
@@ -13,14 +13,18 @@ module Docs
|
|
|
html_filters.push 'rethinkdb/entries', 'rethinkdb/clean_html'
|
|
html_filters.push 'rethinkdb/entries', 'rethinkdb/clean_html'
|
|
|
|
|
|
|
|
options[:trailing_slash] = true
|
|
options[:trailing_slash] = true
|
|
|
|
|
+
|
|
|
options[:container] = '.documentation'
|
|
options[:container] = '.documentation'
|
|
|
|
|
|
|
|
options[:only_patterns] = [/\Adocs/]
|
|
options[:only_patterns] = [/\Adocs/]
|
|
|
|
|
+
|
|
|
options[:skip_patterns] = [/docs\/install(\-drivers)?\/./]
|
|
options[:skip_patterns] = [/docs\/install(\-drivers)?\/./]
|
|
|
|
|
+
|
|
|
options[:skip] = %w(
|
|
options[:skip] = %w(
|
|
|
docs/build/
|
|
docs/build/
|
|
|
docs/tutorials/elections/
|
|
docs/tutorials/elections/
|
|
|
- docs/tutorials/superheroes/)
|
|
|
|
|
|
|
+ docs/tutorials/superheroes/
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
MULTILANG_DOCS = %w(
|
|
MULTILANG_DOCS = %w(
|
|
|
changefeeds
|
|
changefeeds
|
|
@@ -33,31 +37,66 @@ module Docs
|
|
|
rabbitmq
|
|
rabbitmq
|
|
|
secondary-indexes
|
|
secondary-indexes
|
|
|
sql-to-reql
|
|
sql-to-reql
|
|
|
- storing-binary)
|
|
|
|
|
|
|
+ storing-binary
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
options[:attribution] = <<-HTML
|
|
options[:attribution] = <<-HTML
|
|
|
© RethinkDB contributors<br>
|
|
© RethinkDB contributors<br>
|
|
|
Licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
|
Licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
|
|
HTML
|
|
HTML
|
|
|
|
|
|
|
|
- %w(JavaScript Ruby Python Java).each do |name|
|
|
|
|
|
- path = name.downcase
|
|
|
|
|
- instance_eval <<-CODE
|
|
|
|
|
- version '#{name}' do
|
|
|
|
|
- self.initial_paths = %w(api/#{path}/)
|
|
|
|
|
|
|
+ version 'javascript' do
|
|
|
|
|
+ self.initial_paths = %w(api/javascript/)
|
|
|
|
|
|
|
|
- options[:only_patterns] += [/\\Aapi\\/#{path}\\//]
|
|
|
|
|
|
|
+ options[:only_patterns] += [/\Aapi\/javascript\//]
|
|
|
|
|
|
|
|
- options[:fix_urls] = ->(url) do
|
|
|
|
|
- url.sub! %r{rethinkdb.com/docs/(#{MULTILANG_DOCS.join('|')})\\z}, 'rethinkdb.com/docs/\\1/#{path}/'
|
|
|
|
|
- url.sub! %r{rethinkdb.com/docs/(#{MULTILANG_DOCS.join('|')})/(?!#{path}/).*}, 'rethinkdb.com/docs/\\1/#{path}/'
|
|
|
|
|
- url.sub! %r{rethinkdb.com/api/(?!javascript|ruby|python|java)}, 'rethinkdb.com/api/#{path}/'
|
|
|
|
|
- url
|
|
|
|
|
- end
|
|
|
|
|
- end
|
|
|
|
|
- CODE
|
|
|
|
|
|
|
+ options[:fix_urls] = ->(url) do
|
|
|
|
|
+ url.sub! %r{rethinkdb.com/docs/(#{MULTILANG_DOCS.join('|')})\\z}, 'rethinkdb.com/docs/\\1/javascript/'
|
|
|
|
|
+ url.sub! %r{rethinkdb.com/docs/(#{MULTILANG_DOCS.join('|')})/(?!javascript/).*}, 'rethinkdb.com/docs/\\1/javascript/'
|
|
|
|
|
+ url.sub! %r{rethinkdb.com/api/(?!javascript|ruby|python|java)}, 'rethinkdb.com/api/javascript/'
|
|
|
|
|
+ url
|
|
|
|
|
+ end
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
+ version 'ruby' do
|
|
|
|
|
+ self.initial_paths = %w(api/ruby/)
|
|
|
|
|
+
|
|
|
|
|
+ options[:only_patterns] += [/\Aapi\/ruby\//]
|
|
|
|
|
+
|
|
|
|
|
+ options[:fix_urls] = ->(url) do
|
|
|
|
|
+ url.sub! %r{rethinkdb.com/docs/(#{MULTILANG_DOCS.join('|')})\\z}, 'rethinkdb.com/docs/\\1/ruby/'
|
|
|
|
|
+ url.sub! %r{rethinkdb.com/docs/(#{MULTILANG_DOCS.join('|')})/(?!ruby/).*}, 'rethinkdb.com/docs/\\1/ruby/'
|
|
|
|
|
+ url.sub! %r{rethinkdb.com/api/(?!javascript|ruby|python|java)}, 'rethinkdb.com/api/ruby/'
|
|
|
|
|
+ url
|
|
|
|
|
+ end
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
|
|
+ version 'python' do
|
|
|
|
|
+ self.initial_paths = %w(api/python/)
|
|
|
|
|
+
|
|
|
|
|
+ options[:only_patterns] += [/\Aapi\/python\//]
|
|
|
|
|
+
|
|
|
|
|
+ options[:fix_urls] = ->(url) do
|
|
|
|
|
+ url.sub! %r{rethinkdb.com/docs/(#{MULTILANG_DOCS.join('|')})\\z}, 'rethinkdb.com/docs/\\1/python/'
|
|
|
|
|
+ url.sub! %r{rethinkdb.com/docs/(#{MULTILANG_DOCS.join('|')})/(?!python/).*}, 'rethinkdb.com/docs/\\1/python/'
|
|
|
|
|
+ url.sub! %r{rethinkdb.com/api/(?!javascript|ruby|python|java)}, 'rethinkdb.com/api/python/'
|
|
|
|
|
+ url
|
|
|
|
|
+ end
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
|
|
+ version 'java' do
|
|
|
|
|
+ self.initial_paths = %w(api/java/)
|
|
|
|
|
+
|
|
|
|
|
+ options[:only_patterns] += [/\Aapi\/java\//]
|
|
|
|
|
+
|
|
|
|
|
+ options[:fix_urls] = ->(url) do
|
|
|
|
|
+ url.sub! %r{rethinkdb.com/docs/(#{MULTILANG_DOCS.join('|')})\\z}, 'rethinkdb.com/docs/\\1/java/'
|
|
|
|
|
+ url.sub! %r{rethinkdb.com/docs/(#{MULTILANG_DOCS.join('|')})/(?!java/).*}, 'rethinkdb.com/docs/\\1/java/'
|
|
|
|
|
+ url.sub! %r{rethinkdb.com/api/(?!javascript|ruby|python|java)}, 'rethinkdb.com/api/java/'
|
|
|
|
|
+ url
|
|
|
|
|
+ end
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
def get_latest_version(opts)
|
|
def get_latest_version(opts)
|
|
|
get_latest_github_release('rethinkdb', 'rethinkdb', opts)
|
|
get_latest_github_release('rethinkdb', 'rethinkdb', opts)
|
|
|
end
|
|
end
|
|
@@ -68,5 +107,6 @@ module Docs
|
|
|
return false unless super
|
|
return false unless super
|
|
|
response.body !~ /http-equiv="refresh"/i
|
|
response.body !~ /http-equiv="refresh"/i
|
|
|
end
|
|
end
|
|
|
|
|
+
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|