1
0

julia.rb 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. module Docs
  2. class Julia < UrlScraper
  3. self.links = {
  4. home: 'https://julialang.org/',
  5. code: 'https://github.com/JuliaLang/julia'
  6. }
  7. options[:only_patterns] = [/\Amanual\//, /\Astdlib\//]
  8. options[:attribution] = <<-HTML
  9. &copy; 2009&ndash;2018 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors<br>
  10. Licensed under the MIT License.
  11. HTML
  12. version '1.0' do
  13. self.release = '1.0.1'
  14. self.base_url = "https://docs.julialang.org/en/v#{release}/"
  15. self.type = 'julia'
  16. html_filters.push 'julia/entries', 'julia/clean_html'
  17. options[:container] = '#docs'
  18. end
  19. version '0.7' do
  20. self.release = '0.7.0'
  21. self.base_url = "https://docs.julialang.org/en/v#{release}/"
  22. self.type = 'julia'
  23. html_filters.push 'julia/entries', 'julia/clean_html'
  24. options[:container] = '#docs'
  25. end
  26. version '0.6' do
  27. self.release = '0.6.2'
  28. self.base_url = "https://docs.julialang.org/en/v#{release}/"
  29. self.type = 'julia'
  30. html_filters.push 'julia/entries', 'julia/clean_html'
  31. options[:container] = '#docs'
  32. end
  33. version '0.5' do
  34. self.release = '0.5.2'
  35. self.base_url = "https://docs.julialang.org/en/v#{release}/"
  36. self.type = 'sphinx_simple'
  37. html_filters.push 'julia/entries_sphinx', 'julia/clean_html_sphinx', 'sphinx/clean_html'
  38. end
  39. def get_latest_version(opts)
  40. get_latest_github_release('JuliaLang', 'julia', opts)['tag_name'][1..-1]
  41. end
  42. end
  43. end