Class: Dependabot::Bun::FileUpdater::BunLockfileUpdater
- Inherits:
-
Object
- Object
- Dependabot::Bun::FileUpdater::BunLockfileUpdater
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/bun/file_updater/bun_lockfile_updater.rb
Instance Method Summary collapse
-
#initialize(dependencies:, dependency_files:, repo_contents_path:, credentials:) ⇒ BunLockfileUpdater
constructor
A new instance of BunLockfileUpdater.
- #updated_bun_lock_content(bun_lock) ⇒ Object
Constructor Details
#initialize(dependencies:, dependency_files:, repo_contents_path:, credentials:) ⇒ BunLockfileUpdater
Returns a new instance of BunLockfileUpdater.
29 30 31 32 33 34 |
# File 'lib/dependabot/bun/file_updater/bun_lockfile_updater.rb', line 29 def initialize(dependencies:, dependency_files:, repo_contents_path:, credentials:) @dependencies = dependencies @dependency_files = dependency_files @repo_contents_path = repo_contents_path @credentials = credentials end |
Instance Method Details
#updated_bun_lock_content(bun_lock) ⇒ Object
37 38 39 40 41 42 43 44 45 |
# File 'lib/dependabot/bun/file_updater/bun_lockfile_updater.rb', line 37 def updated_bun_lock_content(bun_lock) @updated_bun_lock_content ||= T.let({}, T.nilable(T::Hash[String, String])) return T.must(@updated_bun_lock_content[bun_lock.name]) if @updated_bun_lock_content[bun_lock.name] new_content = run_bun_update(bun_lock: bun_lock) @updated_bun_lock_content[bun_lock.name] = new_content rescue SharedHelpers::HelperSubprocessFailed => e handle_bun_lock_updater_error(e, bun_lock) end |