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.
57 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 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 57 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.
40 41 42 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 40 def @cooldown_options end |
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
31 32 33 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 31 def credentials @credentials end |
#dependency ⇒ Object (readonly)
Returns the value of attribute dependency.
25 26 27 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 25 def dependency @dependency end |
#dependency_files ⇒ Object (readonly)
Returns the value of attribute dependency_files.
28 29 30 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 28 def dependency_files @dependency_files end |
#ignored_versions ⇒ Object (readonly)
Returns the value of attribute ignored_versions.
34 35 36 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 34 def ignored_versions @ignored_versions end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
43 44 45 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 43 def @options end |
#security_advisories ⇒ Object (readonly)
Returns the value of attribute security_advisories.
37 38 39 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 37 def security_advisories @security_advisories end |
Instance Method Details
#available_versions ⇒ Object
127 128 129 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 127 def available_versions package_details&.releases end |
#latest_release(language_version: nil) ⇒ Object
104 105 106 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 104 def latest_release(language_version: nil) @latest_release ||= fetch_latest_release(language_version: language_version) end |
#latest_tag(language_version: nil) ⇒ Object
96 97 98 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 96 def latest_tag(language_version: nil) latest_release(language_version: language_version)&.tag end |
#latest_version(language_version: nil) ⇒ Object
88 89 90 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 88 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
112 113 114 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 112 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
120 121 122 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 120 def lowest_security_fix_version(language_version: nil) @lowest_security_fix_version ||= fetch_lowest_security_fix_version(language_version: language_version) end |