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
Constant Summary collapse
- DAY_IN_SECONDS =
T.let(24 * 60 * 60, Integer)
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_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.
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 59 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 = @raise_on_ignored = raise_on_ignored # It can be used by sub classes to pass options to the registry client = @latest_version = T.let(nil, T.nilable(Dependabot::Version)) @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.
42 43 44 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 42 def end |
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
33 34 35 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 33 def credentials @credentials end |
#dependency ⇒ Object (readonly)
Returns the value of attribute dependency.
27 28 29 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 27 def dependency @dependency end |
#dependency_files ⇒ Object (readonly)
Returns the value of attribute dependency_files.
30 31 32 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 30 def dependency_files @dependency_files end |
#ignored_versions ⇒ Object (readonly)
Returns the value of attribute ignored_versions.
36 37 38 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 36 def ignored_versions @ignored_versions end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
45 46 47 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 45 def end |
#security_advisories ⇒ Object (readonly)
Returns the value of attribute security_advisories.
39 40 41 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 39 def security_advisories @security_advisories end |
Instance Method Details
#available_versions ⇒ Object
112 113 114 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 112 def available_versions package_details&.releases 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
97 98 99 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 97 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
105 106 107 |
# File 'lib/dependabot/package/package_latest_version_finder.rb', line 105 def lowest_security_fix_version(language_version: nil) @lowest_security_fix_version ||= fetch_lowest_security_fix_version(language_version: language_version) end |