Class: Dependabot::Package::PackageLatestVersionFinder
- Inherits:
-
Object
- Object
- Dependabot::Package::PackageLatestVersionFinder
- Extended by:
- T::Helpers, T::Sig
- Defined in:
- lib/dependabot/package/package_latest_version_finder.rb
Instance Attribute Summary collapse
-
#cooldown_options ⇒ Object
readonly
Returns the value of attribute cooldown_options.
-
#credentials ⇒ Object
readonly
Returns the value of attribute credentials.
-
#dependency ⇒ Object
readonly
Returns the value of attribute dependency.
-
#dependency_files ⇒ Object
readonly
Returns the value of attribute dependency_files.
-
#ignored_versions ⇒ Object
readonly
Returns the value of attribute ignored_versions.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#security_advisories ⇒ Object
readonly
Returns the value of attribute security_advisories.
Instance Method Summary collapse
- #available_versions ⇒ Object
-
#initialize(dependency:, dependency_files:, credentials:, ignored_versions:, security_advisories:, cooldown_options: nil, raise_on_ignored: false, options: {}) ⇒ PackageLatestVersionFinder
constructor
A new instance of PackageLatestVersionFinder.
- #latest_release(language_version: nil) ⇒ Object
- #latest_tag(language_version: nil) ⇒ Object
- #latest_version(language_version: nil) ⇒ Object
- #latest_version_with_no_unlock(language_version: nil) ⇒ Object
- #lowest_security_fix_version(language_version: nil) ⇒ Object
Constructor Details
#initialize(dependency:, dependency_files:, credentials:, ignored_versions:, security_advisories:, cooldown_options: nil, raise_on_ignored: false, options: {}) ⇒ PackageLatestVersionFinder
Returns a new instance of PackageLatestVersionFinder.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 58 def initialize( dependency:, dependency_files:, credentials:, ignored_versions:, security_advisories:, cooldown_options: nil, raise_on_ignored: false, options: {} ) @dependency = dependency @dependency_files = dependency_files @credentials = credentials @ignored_versions = ignored_versions @security_advisories = security_advisories @cooldown_options = @raise_on_ignored = raise_on_ignored # It can be used by sub classes to pass options to the registry client @options = @latest_version = T.let(nil, T.nilable(Dependabot::Version)) @latest_release = T.let(nil, T.nilable(Dependabot::Package::PackageRelease)) @latest_version_with_no_unlock = T.let(nil, T.nilable(Dependabot::Version)) @lowest_security_fix_version = T.let(nil, T.nilable(Dependabot::Version)) @package_details = T.let(nil, T.nilable(Dependabot::Package::PackageDetails)) end |
Instance Attribute Details
#cooldown_options ⇒ Object (readonly)
Returns the value of attribute cooldown_options.
41 42 43 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 41 def @cooldown_options end |
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
32 33 34 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 32 def credentials @credentials end |
#dependency ⇒ Object (readonly)
Returns the value of attribute dependency.
26 27 28 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 26 def dependency @dependency end |
#dependency_files ⇒ Object (readonly)
Returns the value of attribute dependency_files.
29 30 31 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 29 def dependency_files @dependency_files end |
#ignored_versions ⇒ Object (readonly)
Returns the value of attribute ignored_versions.
35 36 37 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 35 def ignored_versions @ignored_versions end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
44 45 46 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 44 def @options end |
#security_advisories ⇒ Object (readonly)
Returns the value of attribute security_advisories.
38 39 40 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 38 def security_advisories @security_advisories end |
Instance Method Details
#available_versions ⇒ Object
128 129 130 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 128 def available_versions package_details&.releases end |
#latest_release(language_version: nil) ⇒ Object
105 106 107 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 105 def latest_release(language_version: nil) @latest_release ||= fetch_latest_release(language_version: language_version) end |
#latest_tag(language_version: nil) ⇒ Object
97 98 99 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 97 def latest_tag(language_version: nil) latest_release(language_version: language_version)&.tag end |
#latest_version(language_version: nil) ⇒ Object
89 90 91 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 89 def latest_version(language_version: nil) @latest_version ||= fetch_latest_version(language_version: language_version) end |
#latest_version_with_no_unlock(language_version: nil) ⇒ Object
113 114 115 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 113 def latest_version_with_no_unlock(language_version: nil) @latest_version_with_no_unlock ||= fetch_latest_version_with_no_unlock(language_version: language_version) end |
#lowest_security_fix_version(language_version: nil) ⇒ Object
121 122 123 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 121 def lowest_security_fix_version(language_version: nil) @lowest_security_fix_version ||= fetch_lowest_security_fix_version(language_version: language_version) end |