Class: GemUpdater::SourcePageParser::GitHubParser
- Inherits:
-
GemUpdater::SourcePageParser
- Object
- GemUpdater::SourcePageParser
- GemUpdater::SourcePageParser::GitHubParser
- Defined in:
- lib/gem_updater/source_page_parser.rb
Overview
GitHubParser is responsible for parsing source code hosted on github.com.
Constant Summary collapse
- BASE_URL =
'https://github.com'.freeze
Constants inherited from GemUpdater::SourcePageParser
CHANGELOG_NAMES, HOSTS, MARKUP_FILES
Instance Attribute Summary collapse
-
#doc ⇒ Object
readonly
Returns the value of attribute doc.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Attributes inherited from GemUpdater::SourcePageParser
Instance Method Summary collapse
-
#changelog ⇒ String
Finds url of changelog.
-
#initialize(doc, version) ⇒ GitHubParser
constructor
A new instance of GitHubParser.
Constructor Details
#initialize(doc, version) ⇒ GitHubParser
Returns a new instance of GitHubParser.
124 125 126 127 |
# File 'lib/gem_updater/source_page_parser.rb', line 124 def initialize(doc, version) @doc = doc @version = version end |
Instance Attribute Details
#doc ⇒ Object (readonly)
Returns the value of attribute doc.
120 121 122 |
# File 'lib/gem_updater/source_page_parser.rb', line 120 def doc @doc end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
120 121 122 |
# File 'lib/gem_updater/source_page_parser.rb', line 120 def version @version end |
Instance Method Details
#changelog ⇒ String
Finds url of changelog.
132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
# File 'lib/gem_updater/source_page_parser.rb', line 132 def changelog url = find_changelog_link if url full_url = BASE_URL + url if changelog_may_contain_anchor?(full_url) anchor = find_anchor(full_url) full_url += anchor if anchor end full_url end end |