Class: Dependabot::UpdateCheckers::Elm::ElmPackage
- Defined in:
- lib/dependabot/update_checkers/elm/elm_package.rb,
lib/dependabot/update_checkers/elm/elm_package/cli_parser.rb,
lib/dependabot/update_checkers/elm/elm_package/requirements_updater.rb,
lib/dependabot/update_checkers/elm/elm_package/elm_18_version_resolver.rb,
lib/dependabot/update_checkers/elm/elm_package/elm_19_version_resolver.rb
Defined Under Namespace
Classes: CliParser, Elm18VersionResolver, Elm19VersionResolver, RequirementsUpdater
Instance Attribute Summary
Attributes inherited from Base
#credentials, #dependency, #dependency_files, #ignored_versions, #requirements_update_strategy
Instance Method Summary collapse
-
#can_update?(requirements_to_unlock:) ⇒ Boolean
Overwrite the base class to allow multi-dependency update PRs for dependencies for which we don’t have a version.
- #latest_resolvable_version ⇒ Object
- #latest_resolvable_version_with_no_unlock ⇒ Object
- #latest_version ⇒ Object
- #updated_requirements ⇒ Object
Methods inherited from Base
#initialize, #requirement_class, #requirements_unlocked_or_can_be?, #up_to_date?, #updated_dependencies, #version_class
Constructor Details
This class inherits a constructor from Dependabot::UpdateCheckers::Base
Instance Method Details
#can_update?(requirements_to_unlock:) ⇒ Boolean
Overwrite the base class to allow multi-dependency update PRs for dependencies for which we don’t have a version.
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/dependabot/update_checkers/elm/elm_package.rb', line 22 def can_update?(requirements_to_unlock:) if dependency.appears_in_lockfile? version_can_update?(requirements_to_unlock: requirements_to_unlock) elsif requirements_to_unlock == :none false elsif requirements_to_unlock == :own requirements_can_update? elsif requirements_to_unlock == :all updated_dependencies_after_full_unlock.any? end end |
#latest_resolvable_version ⇒ Object
34 35 36 37 38 |
# File 'lib/dependabot/update_checkers/elm/elm_package.rb', line 34 def latest_resolvable_version @latest_resolvable_version ||= version_resolver. latest_resolvable_version(unlock_requirement: :own) end |
#latest_resolvable_version_with_no_unlock ⇒ Object
40 41 42 43 44 45 |
# File 'lib/dependabot/update_checkers/elm/elm_package.rb', line 40 def latest_resolvable_version_with_no_unlock # Irrelevant, since Elm has a single dependency file (well, there's # also `exact-dependencies.json`, but it's not recommended that that # is committed). nil end |
#latest_version ⇒ Object
16 17 18 |
# File 'lib/dependabot/update_checkers/elm/elm_package.rb', line 16 def latest_version @latest_version ||= candidate_versions.max end |
#updated_requirements ⇒ Object
47 48 49 50 51 52 |
# File 'lib/dependabot/update_checkers/elm/elm_package.rb', line 47 def updated_requirements RequirementsUpdater.new( requirements: dependency.requirements, latest_resolvable_version: latest_resolvable_version ).updated_requirements end |