less.rb 889 B

12345678910111213141516171819202122232425262728293031
  1. module Docs
  2. class Less < UrlScraper
  3. self.type = 'simple'
  4. self.release = '2.7.2'
  5. self.base_url = 'http://lesscss.org'
  6. self.root_path = '/features'
  7. self.initial_paths = %w(/functions)
  8. self.links = {
  9. home: 'http://lesscss.org/',
  10. code: 'https://github.com/less/less.js'
  11. }
  12. html_filters.push 'less/clean_html', 'less/entries', 'title'
  13. options[:title] = 'Less'
  14. options[:container] = 'div[role=main]'
  15. options[:follow_links] = false
  16. options[:trailing_slash] = false
  17. options[:attribution] = <<-HTML
  18. &copy; 2009&ndash;2016 The Core Less Team<br>
  19. Licensed under the Creative Commons Attribution License 3.0.
  20. HTML
  21. def get_latest_version(opts)
  22. doc = fetch_doc('http://lesscss.org/features/', opts)
  23. label = doc.at_css('.footer-links > li').content
  24. label.scan(/([0-9.]+)/)[0][0]
  25. end
  26. end
  27. end