requirejs.rb 928 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. module Docs
  2. class Requirejs < UrlScraper
  3. self.name = 'RequireJS'
  4. self.type = 'simple'
  5. self.release = '2.3.5'
  6. self.base_url = 'http://requirejs.org/docs/'
  7. self.links = {
  8. home: 'http://requirejs.org/',
  9. code: 'https://github.com/requirejs/requirejs'
  10. }
  11. self.root_path = 'api.html'
  12. self.initial_paths = %w(
  13. optimization.html
  14. jquery.html
  15. node.html
  16. dojo.html
  17. commonjs.html
  18. errors.html
  19. plugins.html
  20. why.html
  21. whyamd.html)
  22. html_filters.push 'requirejs/clean_html', 'requirejs/entries'
  23. options[:container] = '#content'
  24. options[:follow_links] = false
  25. options[:only] = self.initial_paths
  26. options[:attribution] = <<-HTML
  27. &copy; jQuery Foundation and other contributors<br>
  28. Licensed under the MIT License.
  29. HTML
  30. def get_latest_version(opts)
  31. get_npm_version('requirejs', opts)
  32. end
  33. end
  34. end