Module: ManifestUpdater
- Defined in:
- lib/spm_version_updates/manifest_updater.rb
Overview
Rewrites supported Package.swift dependency requirements for update records.
Defined Under Namespace
Classes: Result
Constant Summary collapse
- SUPPORTED_KINDS =
%w(exactVersion upToNextMajorVersion upToNextMinorVersion versionRange).freeze
Class Method Summary collapse
Class Method Details
.rewrite(content, updates) ⇒ Object
18 19 20 |
# File 'lib/spm_version_updates/manifest_updater.rb', line 18 def self.rewrite(content, updates) Rewriter.new(content, updates).rewrite end |
.update_file(manifest_path, updates) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/spm_version_updates/manifest_updater.rb', line 22 def self.update_file(manifest_path, updates) original = File.read(manifest_path) result = rewrite(original, updates) File.write(manifest_path, result.content) if result.changed? result end |