Class: GemUpdater::ChangelogParser::GithubParser
- Inherits:
-
Object
- Object
- GemUpdater::ChangelogParser::GithubParser
- Defined in:
- lib/gem_updater/changelog_parser/github_parser.rb
Overview
ChangelogParser is responsible for parsing a changelog hosted on github.
Constant Summary collapse
- REACT_DATA_XPATH =
'//script[@data-target="react-app.embeddedData"]'- REACT_PAYLOAD_TOC_PATH =
%w[payload blob headerInfo toc].freeze
Instance Attribute Summary collapse
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#changelog ⇒ String
Finds anchor in changelog, otherwise return the base uri.
-
#initialize(uri:, version:) ⇒ GithubParser
constructor
A new instance of GithubParser.
Constructor Details
#initialize(uri:, version:) ⇒ GithubParser
Returns a new instance of GithubParser.
17 18 19 20 |
# File 'lib/gem_updater/changelog_parser/github_parser.rb', line 17 def initialize(uri:, version:) @uri = uri @version = version end |
Instance Attribute Details
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
13 14 15 |
# File 'lib/gem_updater/changelog_parser/github_parser.rb', line 13 def uri @uri end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
13 14 15 |
# File 'lib/gem_updater/changelog_parser/github_parser.rb', line 13 def version @version end |
Instance Method Details
#changelog ⇒ String
Finds anchor in changelog, otherwise return the base uri.
25 26 27 |
# File 'lib/gem_updater/changelog_parser/github_parser.rb', line 25 def changelog uri + find_anchor(document).to_s end |