Class: Dependabot::UpdateCheckers::Elm::ElmPackage::Elm19VersionResolver
- Inherits:
-
Object
- Object
- Dependabot::UpdateCheckers::Elm::ElmPackage::Elm19VersionResolver
show all
- Defined in:
- lib/dependabot/update_checkers/elm/elm_package/elm_19_version_resolver.rb
Defined Under Namespace
Classes: UnrecoverableState
Instance Method Summary
collapse
Constructor Details
#initialize(dependency:, dependency_files:) ⇒ Elm19VersionResolver
18
19
20
21
|
# File 'lib/dependabot/update_checkers/elm/elm_package/elm_19_version_resolver.rb', line 18
def initialize(dependency:, dependency_files:)
@dependency = dependency
@dependency_files = dependency_files
end
|
Instance Method Details
#latest_resolvable_version(unlock_requirement:) ⇒ Object
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/dependabot/update_checkers/elm/elm_package/elm_19_version_resolver.rb', line 23
def latest_resolvable_version(unlock_requirement:)
unless %i(none own all).include?(unlock_requirement)
raise "Invalid unlock setting: #{unlock_requirement}"
end
return current_version if unlock_requirement == :none
fetch_latest_resolvable_version(unlock_requirement)
end
|
#updated_dependencies_after_full_unlock ⇒ Object
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
|
# File 'lib/dependabot/update_checkers/elm/elm_package/elm_19_version_resolver.rb', line 37
def updated_dependencies_after_full_unlock
changed_deps = install_metadata
original_dependency_details.map do |original_dep|
new_version = changed_deps.fetch(original_dep.name, nil)
next unless new_version
old_reqs = original_dep.requirements.map do |req|
requirement_class.new(req[:requirement])
end
next if old_reqs.all? { |req| req.satisfied_by?(new_version) }
new_requirements =
RequirementsUpdater.new(
requirements: original_dep.requirements,
latest_resolvable_version: new_version.to_s
).updated_requirements
Dependency.new(
name: original_dep.name,
version: new_version.to_s,
requirements: new_requirements,
previous_version: original_dep.version,
previous_requirements: original_dep.requirements,
package_manager: original_dep.package_manager
)
end.compact
end
|