jquery_mobile.rb 830 B

12345678910111213141516171819202122232425
  1. module Docs
  2. class JqueryMobile < Jquery
  3. self.name = 'jQuery Mobile'
  4. self.slug = 'jquerymobile'
  5. self.release = '1.4.5'
  6. self.base_url = 'https://api.jquerymobile.com'
  7. self.root_path = '/category/all'
  8. html_filters.insert_before 'jquery/clean_html', 'jquery_mobile/entries'
  9. options[:root_title] = 'jQuery Mobile'
  10. options[:skip] = %w(/tabs /theme)
  11. options[:skip_patterns] += [/\A\/icons/, /cdn-cgi/i]
  12. options[:replace_paths] = { '/select/' => '/selectmenu' }
  13. options[:fix_urls] = ->(url) do
  14. url.sub! 'http://api.jquerymobile.com/', 'https://api.jquerymobile.com/'
  15. end
  16. def get_latest_version(opts)
  17. doc = fetch_doc('https://jquerymobile.com/', opts)
  18. doc.at_css('.download-box > .download-option:last-child > span').content.sub(/Version /, '')
  19. end
  20. end
  21. end