Fix GNU Make, Rails and Terraform get_latest_version

This commit is contained in:
Enoc 2022-01-08 14:56:38 -06:00
parent 3412d980aa
commit 437485140d
3 changed files with 5 additions and 4 deletions

View file

@ -26,7 +26,7 @@ module Docs
HTML
def get_latest_version(opts)
body = fetch(self.base_url, opts)
body = fetch("https://www.gnu.org/software/make/manual/html_node/", opts)
body.scan(/version \d*\.?\d*/)[0].sub('version', '')
end

View file

@ -117,7 +117,8 @@ module Docs
def get_latest_version(opts)
doc = fetch_doc('https://rubyonrails.org/', opts)
doc.at_css('.version p a').content.scan(/\d\.\d*\.*\d*\.*\d*/)[0]
doc
doc.at_css('.heading__button span').content.scan(/\d\.\d*\.*\d*\.*\d*/)[0]
end
end
end

View file

@ -20,8 +20,8 @@ module Docs
HTML
def get_latest_version(opts)
contents = get_github_file_contents('hashicorp', 'terraform-website', 'content/config.rb', opts)
contents.scan(/version\s+=\s+"([0-9.]+)"/)[0][0]
contents = get_latest_github_release('hashicorp', 'terraform', opts)
contents.sub("v", "")
end
end
end