vagrant.rb 777 B

123456789101112131415161718192021222324252627
  1. module Docs
  2. class Vagrant < UrlScraper
  3. self.name = 'Vagrant'
  4. self.type = 'simple'
  5. self.release = '2.2.0'
  6. self.base_url = 'https://www.vagrantup.com/docs/'
  7. self.root_path = 'index.html'
  8. self.links = {
  9. home: 'https://www.vagrantup.com/',
  10. code: 'https://github.com/mitchellh/vagrant'
  11. }
  12. html_filters.push 'vagrant/entries', 'vagrant/clean_html'
  13. options[:skip_patterns] = [/vagrant-cloud/]
  14. options[:attribution] = <<-HTML
  15. &copy; 2010&ndash;2018 Mitchell Hashimoto<br>
  16. Licensed under the MPL 2.0 License.
  17. HTML
  18. def get_latest_version(opts)
  19. contents = get_github_file_contents('hashicorp', 'vagrant', 'website/config.rb', opts)
  20. contents.scan(/version\s+=\s+"([0-9.]+)"/)[0][0]
  21. end
  22. end
  23. end