Class: Dependabot::Swift::FileUpdater::ManifestUpdater
- Inherits:
-
Object
- Object
- Dependabot::Swift::FileUpdater::ManifestUpdater
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/swift/file_updater/manifest_updater.rb
Instance Method Summary collapse
-
#initialize(content, old_requirements:, new_requirements:) ⇒ ManifestUpdater
constructor
A new instance of ManifestUpdater.
- #updated_manifest_content ⇒ Object
Constructor Details
#initialize(content, old_requirements:, new_requirements:) ⇒ ManifestUpdater
Returns a new instance of ManifestUpdater.
22 23 24 25 26 |
# File 'lib/dependabot/swift/file_updater/manifest_updater.rb', line 22 def initialize(content, old_requirements:, new_requirements:) @content = content @old_requirements = old_requirements @new_requirements = new_requirements end |
Instance Method Details
#updated_manifest_content ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/dependabot/swift/file_updater/manifest_updater.rb', line 29 def updated_manifest_content updated_content = content old_requirements.zip(new_requirements).each do |old, new| = (old) = (T.must(new)) updated_content = RequirementReplacer.new( content: updated_content, declaration: string_value(, :declaration_string), old_requirement: string_value(, :requirement_string), new_requirement: string_value(, :requirement_string) ).updated_content end updated_content end |