rethinkdb.rb 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. module Docs
  2. class Rethinkdb < UrlScraper
  3. self.name = 'RethinkDB'
  4. self.type = 'rethinkdb'
  5. self.release = '2.3.2'
  6. self.links = {
  7. home: 'https://rethinkdb.com/',
  8. code: 'https://github.com/rethinkdb/rethinkdb'
  9. }
  10. html_filters.push 'rethinkdb/entries', 'rethinkdb/clean_html'
  11. options[:trailing_slash] = false
  12. options[:container] = '.docs-article'
  13. options[:attribution] = <<-HTML
  14. &copy; RethinkDB contributors<br>
  15. Licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
  16. HTML
  17. version 'JavaScript' do
  18. self.base_url = 'https://rethinkdb.com/api/javascript/'
  19. options[:fix_urls] = ->(url) do
  20. url.sub! %r{rethinkdb.com/api/(?!javascript|ruby|python|java)}, 'rethinkdb.com/api/javascript/'
  21. end
  22. end
  23. version 'Ruby' do
  24. self.base_url = 'https://rethinkdb.com/api/ruby/'
  25. options[:fix_urls] = ->(url) do
  26. url.sub! %r{rethinkdb.com/api/(?!javascript|ruby|python|java)}, 'rethinkdb.com/api/ruby/'
  27. end
  28. end
  29. version 'Python' do
  30. self.base_url = 'https://rethinkdb.com/api/python/'
  31. options[:fix_urls] = ->(url) do
  32. url.sub! %r{rethinkdb.com/api/(?!javascript|ruby|python|java)}, 'rethinkdb.com/api/python/'
  33. end
  34. end
  35. version 'Java' do
  36. self.base_url = 'https://rethinkdb.com/api/java/'
  37. options[:fix_urls] = ->(url) do
  38. url.sub! %r{rethinkdb.com/api/(?!javascript|ruby|python|java)}, 'rethinkdb.com/api/java/'
  39. end
  40. end
  41. end
  42. end