julia.rb 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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(options, &block)
  40. get_latest_github_release('JuliaLang', 'julia', options) do |release|
  41. block.call release['tag_name'][1..-1]
  42. end
  43. end
  44. end
  45. end