Skip to content

Commit 4ce7dbc

Browse files
committed
Remove hardcoded username and fix broken methods
1 parent 1606195 commit 4ce7dbc

File tree

8 files changed

+11
-15
lines changed

8 files changed

+11
-15
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ In addition to the [guidelines for contributing code](#contributing-code-and-fea
6161

6262
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.
6363

64-
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).
64+
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.
6565

6666
## Coding conventions
6767

lib/docs/scrapers/async.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Async < UrlScraper
1919
HTML
2020

2121
def get_latest_version(opts)
22-
doc = fetch_doc('https://caolan.github.io/async/', opts)
22+
doc = fetch_doc('https://caolan.github.io/async/v3/', opts)
2323
doc.at_css('#version-dropdown > a').content.strip[1..-1]
2424
end
2525
end

lib/docs/scrapers/drupal.rb

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,8 @@ class Drupal < UrlScraper
100100
end
101101

102102
def get_latest_version(opts)
103-
doc = fetch_doc('http://cgit.drupalcode.org/drupal', opts)
104-
105-
version = doc.at_css('td.form > form > select > option[selected]').content
106-
version = version.scan(/([0-9.]+)/)[0][0]
107-
version = version[0...-1] if version.end_with?('.')
108-
109-
version
103+
json = fetch_json('https://packagist.org/packages/drupal/drupal.json', opts)
104+
json['package']['versions'].keys.find {|version| !version.end_with?('-dev')}
110105
end
111106
end
112107
end

lib/docs/scrapers/perl.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ class Perl < FileScraper
4545
end
4646

4747
def get_latest_version(opts)
48-
body = fetch('https://perldoc.perl.org/static/perlversion.js', opts)
49-
body.scan(/>Perl ([0-9.]+)/)[0][0]
48+
doc = fetch_doc('https://perldoc.perl.org/', opts)
49+
header = doc.at_css('h2.h1').content
50+
header.scan(/Perl ([0-9.]+)/)[0][0]
5051
end
5152
end
5253
end

lib/docs/scrapers/phalcon.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Phalcon < UrlScraper
3232

3333
def get_latest_version(opts)
3434
doc = fetch_doc('https://docs.phalconphp.com/', opts)
35-
doc.at_css('.custom-select__version').content.strip.sub(/Version /, '')
35+
doc.at_css('.header__lang.expand > div > ul > li > a').content
3636
end
3737
end
3838
end

lib/docs/scrapers/sass.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Sass < UrlScraper
2525
HTML
2626

2727
def get_latest_version(opts)
28-
get_github_file_contents('sass', 'sass', 'VERSION', opts).strip
28+
get_latest_github_release('sass', 'libsass', opts)['tag_name']
2929
end
3030
end
3131
end

lib/docs/scrapers/statsmodels.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Statsmodels < UrlScraper
2323

2424
def get_latest_version(opts)
2525
doc = fetch_doc('http://www.statsmodels.org/stable/', opts)
26-
doc.at_css('.sphinxsidebarwrapper h3 + p > b').content
26+
doc.at_css('.sphinxsidebarwrapper h3 + p > b').content[1..-1]
2727
end
2828
end
2929
end

lib/tasks/updates.thor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class UpdatesCLI < Thor
139139
def upload_results(outdated_results, up_to_date_results, failed_results)
140140
# We can't create issues without a GitHub token
141141
unless options.key?(:github_token)
142-
logger.error('Please specify a GitHub token with the public_repo permission for devdocs-bot with the --github-token parameter')
142+
logger.error("Please specify a GitHub token with the public_repo permission for #{UPLOAD_USER} with the --github-token parameter")
143143
return
144144
end
145145

0 commit comments

Comments
 (0)