Remove hardcoded username and fix broken methods

This commit is contained in:
Jasper van Merle 2019-06-11 23:01:37 +02:00
parent 16061956ce
commit 4ce7dbcfd5
8 changed files with 11 additions and 15 deletions

View file

@ -61,7 +61,7 @@ In addition to the [guidelines for contributing code](#contributing-code-and-fea
Please don't submit a pull request updating the version number of a documentation, unless a change is required in the scraper and you've verified that it works.
To ask that an existing documentation be updated, first check the last two [Documentation versions reports](https://github.com/freeCodeCamp/devdocs/issues?utf8=%E2%9C%93&q=Documentation+versions+report+is%3Aissue+author%3Adevdocs-bot+sort%3Aupdated-desc). Only create an issue if the documentation has been wrongly marked as up-to-date for at least 2 reports (a new report is automatically created every month).
To ask that an existing documentation be updated, first check the last two [Documentation versions reports](https://github.com/freeCodeCamp/devdocs/issues?utf8=%E2%9C%93&q=Documentation+versions+report+is%3Aissue+author%3Adevdocs-bot+sort%3Aupdated-desc). Only create an issue if the documentation has been wrongly marked as up-to-date.
## Coding conventions

View file

@ -19,7 +19,7 @@ module Docs
HTML
def get_latest_version(opts)
doc = fetch_doc('https://caolan.github.io/async/', opts)
doc = fetch_doc('https://caolan.github.io/async/v3/', opts)
doc.at_css('#version-dropdown > a').content.strip[1..-1]
end
end

View file

@ -100,13 +100,8 @@ module Docs
end
def get_latest_version(opts)
doc = fetch_doc('http://cgit.drupalcode.org/drupal', opts)
version = doc.at_css('td.form > form > select > option[selected]').content
version = version.scan(/([0-9.]+)/)[0][0]
version = version[0...-1] if version.end_with?('.')
version
json = fetch_json('https://packagist.org/packages/drupal/drupal.json', opts)
json['package']['versions'].keys.find {|version| !version.end_with?('-dev')}
end
end
end

View file

@ -45,8 +45,9 @@ module Docs
end
def get_latest_version(opts)
body = fetch('https://perldoc.perl.org/static/perlversion.js', opts)
body.scan(/>Perl ([0-9.]+)/)[0][0]
doc = fetch_doc('https://perldoc.perl.org/', opts)
header = doc.at_css('h2.h1').content
header.scan(/Perl ([0-9.]+)/)[0][0]
end
end
end

View file

@ -32,7 +32,7 @@ module Docs
def get_latest_version(opts)
doc = fetch_doc('https://docs.phalconphp.com/', opts)
doc.at_css('.custom-select__version').content.strip.sub(/Version /, '')
doc.at_css('.header__lang.expand > div > ul > li > a').content
end
end
end

View file

@ -25,7 +25,7 @@ module Docs
HTML
def get_latest_version(opts)
get_github_file_contents('sass', 'sass', 'VERSION', opts).strip
get_latest_github_release('sass', 'libsass', opts)['tag_name']
end
end
end

View file

@ -23,7 +23,7 @@ module Docs
def get_latest_version(opts)
doc = fetch_doc('http://www.statsmodels.org/stable/', opts)
doc.at_css('.sphinxsidebarwrapper h3 + p > b').content
doc.at_css('.sphinxsidebarwrapper h3 + p > b').content[1..-1]
end
end
end

View file

@ -139,7 +139,7 @@ class UpdatesCLI < Thor
def upload_results(outdated_results, up_to_date_results, failed_results)
# We can't create issues without a GitHub token
unless options.key?(:github_token)
logger.error('Please specify a GitHub token with the public_repo permission for devdocs-bot with the --github-token parameter')
logger.error("Please specify a GitHub token with the public_repo permission for #{UPLOAD_USER} with the --github-token parameter")
return
end