Class: Dependabot::MetadataFinders::Base::ReleaseFinder
- Inherits:
-
Object
- Object
- Dependabot::MetadataFinders::Base::ReleaseFinder
- Defined in:
- lib/dependabot/metadata_finders/base/release_finder.rb
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.
Instance Method Summary collapse
-
#initialize(source:, dependency:, credentials:) ⇒ ReleaseFinder
constructor
A new instance of ReleaseFinder.
- #releases_text ⇒ Object
- #releases_url ⇒ Object
Constructor Details
#initialize(source:, dependency:, credentials:) ⇒ ReleaseFinder
Returns a new instance of ReleaseFinder.
14 15 16 17 18 |
# File 'lib/dependabot/metadata_finders/base/release_finder.rb', line 14 def initialize(source:, dependency:, credentials:) @source = source @dependency = dependency @credentials = credentials end |
Instance Attribute Details
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
12 13 14 |
# File 'lib/dependabot/metadata_finders/base/release_finder.rb', line 12 def credentials @credentials end |
#dependency ⇒ Object (readonly)
Returns the value of attribute dependency.
12 13 14 |
# File 'lib/dependabot/metadata_finders/base/release_finder.rb', line 12 def dependency @dependency end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
12 13 14 |
# File 'lib/dependabot/metadata_finders/base/release_finder.rb', line 12 def source @source end |
Instance Method Details
#releases_text ⇒ Object
32 33 34 35 36 37 |
# File 'lib/dependabot/metadata_finders/base/release_finder.rb', line 32 def releases_text return unless relevant_releases.any? return if relevant_releases.all? { |r| r.body.nil? || r.body == "" } relevant_releases.map { |r| serialize_release(r) }.join("\n\n") end |
#releases_url ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/dependabot/metadata_finders/base/release_finder.rb', line 20 def releases_url return unless source case source.provider when "github" then "#{source.url}/releases" when "gitlab" then "#{source.url}/tags" when "bitbucket" then nil when "azure" then "#{source.url}/tags" else raise "Unexpected repo provider '#{source.provider}'" end end |