Class: Dependabot::Swift::UpdateChecker::RequirementsUpdater

Inherits:
Object
  • Object
show all
Defined in:
lib/dependabot/swift/update_checker/requirements_updater.rb

Instance Method Summary collapse

Constructor Details

#initialize(requirements:, target_version:) ⇒ RequirementsUpdater

Returns a new instance of RequirementsUpdater.



12
13
14
15
16
17
18
# File 'lib/dependabot/swift/update_checker/requirements_updater.rb', line 12

def initialize(requirements:, target_version:)
  @requirements = requirements

  return unless target_version && Version.correct?(target_version)

  @target_version = Version.new(target_version)
end

Instance Method Details

#updated_requirementsObject



20
21
22
23
24
# File 'lib/dependabot/swift/update_checker/requirements_updater.rb', line 20

def updated_requirements
  NativeRequirement.map_requirements(requirements) do |requirement|
    requirement.update_if_needed(target_version)
  end
end