Class: Dependabot::MetadataFinders::Base::ChangelogFinder
- Inherits:
-
Object
- Object
- Dependabot::MetadataFinders::Base::ChangelogFinder
- Defined in:
- lib/dependabot/metadata_finders/base/changelog_finder.rb
Constant Summary collapse
- CHANGELOG_NAMES =
Earlier entries are preferred
%w( changelog news changes history release whatsnew releases ).freeze
Instance Attribute Summary collapse
-
#credentials ⇒ Object
readonly
Returns the value of attribute credentials.
-
#dependency ⇒ Object
readonly
Returns the value of attribute dependency.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#suggested_changelog_url ⇒ Object
readonly
Returns the value of attribute suggested_changelog_url.
Instance Method Summary collapse
- #changelog_text ⇒ Object
- #changelog_url ⇒ Object
-
#initialize(source:, dependency:, credentials:, suggested_changelog_url: nil) ⇒ ChangelogFinder
constructor
A new instance of ChangelogFinder.
- #upgrade_guide_text ⇒ Object
- #upgrade_guide_url ⇒ Object
Constructor Details
#initialize(source:, dependency:, credentials:, suggested_changelog_url: nil) ⇒ ChangelogFinder
Returns a new instance of ChangelogFinder.
25 26 27 28 29 30 31 |
# File 'lib/dependabot/metadata_finders/base/changelog_finder.rb', line 25 def initialize(source:, dependency:, credentials:, suggested_changelog_url: nil) @source = source @dependency = dependency @credentials = credentials @suggested_changelog_url = suggested_changelog_url end |
Instance Attribute Details
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
23 24 25 |
# File 'lib/dependabot/metadata_finders/base/changelog_finder.rb', line 23 def credentials @credentials end |
#dependency ⇒ Object (readonly)
Returns the value of attribute dependency.
23 24 25 |
# File 'lib/dependabot/metadata_finders/base/changelog_finder.rb', line 23 def dependency @dependency end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
23 24 25 |
# File 'lib/dependabot/metadata_finders/base/changelog_finder.rb', line 23 def source @source end |
#suggested_changelog_url ⇒ Object (readonly)
Returns the value of attribute suggested_changelog_url.
23 24 25 |
# File 'lib/dependabot/metadata_finders/base/changelog_finder.rb', line 23 def suggested_changelog_url @suggested_changelog_url end |
Instance Method Details
#changelog_text ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/dependabot/metadata_finders/base/changelog_finder.rb', line 37 def changelog_text return unless full_changelog_text ChangelogPruner.new( dependency: dependency, changelog_text: full_changelog_text ).pruned_text end |
#changelog_url ⇒ Object
33 34 35 |
# File 'lib/dependabot/metadata_finders/base/changelog_finder.rb', line 33 def changelog_url changelog&.html_url end |
#upgrade_guide_text ⇒ Object
50 51 52 53 54 |
# File 'lib/dependabot/metadata_finders/base/changelog_finder.rb', line 50 def upgrade_guide_text return unless upgrade_guide @upgrade_guide_text ||= fetch_file_text(upgrade_guide) end |
#upgrade_guide_url ⇒ Object
46 47 48 |
# File 'lib/dependabot/metadata_finders/base/changelog_finder.rb', line 46 def upgrade_guide_url upgrade_guide&.html_url end |