Class: Dependabot::PreCommit::UpdateChecker::LatestVersionFinder
- Inherits:
-
Dependabot::Package::PackageLatestVersionFinder
- Object
- Dependabot::Package::PackageLatestVersionFinder
- Dependabot::PreCommit::UpdateChecker::LatestVersionFinder
- Extended by:
- T::Sig
- Includes:
- GitCooldownDateResolver
- Defined in:
- lib/dependabot/pre_commit/update_checker/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.
-
#ignored_versions ⇒ Object
readonly
Returns the value of attribute ignored_versions.
-
#raise_on_ignored ⇒ Object
readonly
Returns the value of attribute raise_on_ignored.
Instance Method Summary collapse
- #cooldown_credentials ⇒ Object
- #cooldown_source_url ⇒ Object
-
#initialize(dependency:, dependency_files:, credentials:, ignored_versions:, raise_on_ignored:, options: {}, cooldown_options: nil) ⇒ LatestVersionFinder
constructor
A new instance of LatestVersionFinder.
- #latest_release_version ⇒ Object
- #latest_version_tag ⇒ Object
- #package_details ⇒ Object
Constructor Details
#initialize(dependency:, dependency_files:, credentials:, ignored_versions:, raise_on_ignored:, options: {}, cooldown_options: nil) ⇒ LatestVersionFinder
Returns a new instance of LatestVersionFinder.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/dependabot/pre_commit/update_checker/latest_version_finder.rb', line 37 def initialize( dependency:, dependency_files:, credentials:, ignored_versions:, raise_on_ignored:, options: {}, cooldown_options: nil ) @dependency = dependency @dependency_files = dependency_files @credentials = credentials @ignored_versions = ignored_versions @raise_on_ignored = raise_on_ignored @options = @cooldown_options = @cooldown_selected_tag = T.let(nil, T.nilable(T::Hash[Symbol, T.untyped])) @cooldown_rejected_all = T.let(false, T::Boolean) @git_helper = T.let(git_helper, Dependabot::PreCommit::Helpers::Githelper) super( dependency: dependency, dependency_files: dependency_files, credentials: credentials, ignored_versions: ignored_versions, security_advisories: [], cooldown_options: , raise_on_ignored: raise_on_ignored, options: ) end |
Instance Attribute Details
#cooldown_options ⇒ Object (readonly)
Returns the value of attribute cooldown_options.
76 77 78 |
# File 'lib/dependabot/pre_commit/update_checker/latest_version_finder.rb', line 76 def @cooldown_options end |
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
73 74 75 |
# File 'lib/dependabot/pre_commit/update_checker/latest_version_finder.rb', line 73 def credentials @credentials end |
#dependency ⇒ Object (readonly)
Returns the value of attribute dependency.
70 71 72 |
# File 'lib/dependabot/pre_commit/update_checker/latest_version_finder.rb', line 70 def dependency @dependency end |
#ignored_versions ⇒ Object (readonly)
Returns the value of attribute ignored_versions.
79 80 81 |
# File 'lib/dependabot/pre_commit/update_checker/latest_version_finder.rb', line 79 def ignored_versions @ignored_versions end |
#raise_on_ignored ⇒ Object (readonly)
Returns the value of attribute raise_on_ignored.
82 83 84 |
# File 'lib/dependabot/pre_commit/update_checker/latest_version_finder.rb', line 82 def raise_on_ignored @raise_on_ignored end |
Instance Method Details
#cooldown_credentials ⇒ Object
110 111 112 |
# File 'lib/dependabot/pre_commit/update_checker/latest_version_finder.rb', line 110 def cooldown_credentials @credentials end |
#cooldown_source_url ⇒ Object
105 106 107 |
# File 'lib/dependabot/pre_commit/update_checker/latest_version_finder.rb', line 105 def cooldown_source_url @git_helper.git_commit_checker.dependency_source_details&.fetch(:url) end |
#latest_release_version ⇒ Object
88 89 90 91 92 93 94 95 |
# File 'lib/dependabot/pre_commit/update_checker/latest_version_finder.rb', line 88 def latest_release_version release = available_release return nil unless release Dependabot.logger.info("Available release version/ref is #{release}") filter_release_with_cooldown(release) end |
#latest_version_tag ⇒ Object
98 99 100 101 102 |
# File 'lib/dependabot/pre_commit/update_checker/latest_version_finder.rb', line 98 def latest_version_tag return nil if @cooldown_rejected_all @cooldown_selected_tag || available_latest_version_tag end |
#package_details ⇒ Object
85 |
# File 'lib/dependabot/pre_commit/update_checker/latest_version_finder.rb', line 85 def package_details; end |