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.
127 128 129 130 |
# File 'lib/gem_updater/source_page_parser.rb', line 127 def initialize(doc, version) @doc = doc @version = version end |
Instance Attribute Details
#doc ⇒ Object (readonly)
Returns the value of attribute doc.
123 124 125 |
# File 'lib/gem_updater/source_page_parser.rb', line 123 def doc @doc end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
123 124 125 |
# File 'lib/gem_updater/source_page_parser.rb', line 123 def version @version end |
Instance Method Details
#changelog ⇒ String
Finds url of changelog.
135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/gem_updater/source_page_parser.rb', line 135 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 |