1
0

lua.rb 930 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. module Docs
  2. class Lua < UrlScraper
  3. self.type = 'lua'
  4. self.root_path = 'manual.html'
  5. html_filters.push 'lua/clean_html', 'lua/entries'
  6. options[:skip_links] = true
  7. options[:attribution] = <<-HTML
  8. &copy; 1994&ndash;2020 Lua.org, PUC-Rio.<br>
  9. Licensed under the MIT License.
  10. HTML
  11. version '5.4' do
  12. self.release = '5.4.1'
  13. self.base_url = 'https://www.lua.org/manual/5.4/'
  14. end
  15. version '5.3' do
  16. self.release = '5.3.6'
  17. self.base_url = 'https://www.lua.org/manual/5.3/'
  18. end
  19. version '5.2' do
  20. self.release = '5.2.4'
  21. self.base_url = 'https://www.lua.org/manual/5.2/'
  22. end
  23. version '5.1' do
  24. self.release = '5.1.5'
  25. self.base_url = 'https://www.lua.org/manual/5.1/'
  26. end
  27. def get_latest_version(opts)
  28. doc = fetch_doc('https://www.lua.org/manual/', opts)
  29. doc.at_css('p.menubar > a').content
  30. end
  31. end
  32. end