Class: Dependabot::Swift::FileUpdater::LockfileUpdater
- Inherits:
-
Object
- Object
- Dependabot::Swift::FileUpdater::LockfileUpdater
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/swift/file_updater/lockfile_updater.rb
Instance Method Summary collapse
-
#initialize(dependency:, manifest:, repo_contents_path:, credentials:, target_version: nil) ⇒ LockfileUpdater
constructor
A new instance of LockfileUpdater.
- #updated_lockfile_content ⇒ Object
Constructor Details
#initialize(dependency:, manifest:, repo_contents_path:, credentials:, target_version: nil) ⇒ LockfileUpdater
Returns a new instance of LockfileUpdater.
25 26 27 28 29 30 31 |
# File 'lib/dependabot/swift/file_updater/lockfile_updater.rb', line 25 def initialize(dependency:, manifest:, repo_contents_path:, credentials:, target_version: nil) @dependency = dependency @manifest = manifest @repo_contents_path = repo_contents_path @credentials = credentials @target_version = target_version end |
Instance Method Details
#updated_lockfile_content ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/dependabot/swift/file_updater/lockfile_updater.rb', line 34 def updated_lockfile_content SharedHelpers.in_a_temporary_repo_directory(manifest.directory, repo_contents_path) do File.write(manifest.name, manifest.content) SharedHelpers.with_git_configured(credentials: credentials) do try_lockfile_update(dependency.[:identity]) File.read("Package.resolved") end end end |