1
0

lua.rb 990 B

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