Skip to content

Commit

Permalink
FIX finding github anchor (#172)
Browse files Browse the repository at this point in the history
Github changed their css class.
  • Loading branch information
MaximeD authored Sep 30, 2023
1 parent 3fe993d commit 1c02832
Show file tree
Hide file tree
Showing 7 changed files with 148 additions and 352 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# master (unreleased)

Changed:
* know rely on rubygems metadata to get the changelog uri.
* rely on rubygems metadata to get the changelog uri.
It means that for any gem not hosted on rubygems, the changelog won’t be found.

Deprecated:
Expand Down
2 changes: 1 addition & 1 deletion lib/gem_updater/changelog_parser/github_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def document
# @param doc [Nokogiri::HTML4::Document] document
# @return [String, nil] anchor's href
def find_anchor(doc)
anchor = doc.xpath('//a[contains(@class, "anchor")]').find do |element|
anchor = doc.xpath('//a[contains(@class, "heading-link")]').find do |element|
element.attr('href').match(version.delete('.'))
end
return unless anchor
Expand Down
4 changes: 2 additions & 2 deletions spec/acceptance/gem_update_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
* regexp_parser 2.6.1 → 2.8.1
[changelog](https://github.com/ammar/regexp_parser/blob/master/CHANGELOG.md#281---2023-06-10---janosch-müller)
* rubocop 1.38.0 → 1.56.3
[changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md#1563-2023-09-11)
* rubocop 1.38.0 → 1.56.4
[changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
OUTPUT
end
Expand Down
403 changes: 98 additions & 305 deletions spec/fixtures/vcr/acceptance.yml

Large diffs are not rendered by default.

27 changes: 14 additions & 13 deletions spec/fixtures/vcr/changelog_parser/github_parser/not_found.yml

Large diffs are not rendered by default.

31 changes: 16 additions & 15 deletions spec/fixtures/vcr/changelog_parser/github_parser/with_anchor.yml

Large diffs are not rendered by default.

31 changes: 16 additions & 15 deletions spec/fixtures/vcr/changelog_parser/github_parser/without_anchor.yml

Large diffs are not rendered by default.

0 comments on commit 1c02832

Please sign in to comment.