Class: Dependabot::NpmAndYarn::FileUpdater::NpmLockfileUpdater
- Inherits:
-
Object
- Object
- Dependabot::NpmAndYarn::FileUpdater::NpmLockfileUpdater
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/npm_and_yarn/file_updater/npm_lockfile_updater.rb
Instance Method Summary collapse
-
#initialize(lockfile:, dependencies:, dependency_files:, credentials:, security_updates_only: false, release_age_days: nil) ⇒ NpmLockfileUpdater
constructor
A new instance of NpmLockfileUpdater.
- #updated_lockfile ⇒ Object
- #updated_lockfile_reponse(response) ⇒ Object
- #updated_package_json_files ⇒ Object
Constructor Details
#initialize(lockfile:, dependencies:, dependency_files:, credentials:, security_updates_only: false, release_age_days: nil) ⇒ NpmLockfileUpdater
Returns a new instance of NpmLockfileUpdater.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/dependabot/npm_and_yarn/file_updater/npm_lockfile_updater.rb', line 38 def initialize( lockfile:, dependencies:, dependency_files:, credentials:, security_updates_only: false, release_age_days: nil ) @lockfile = lockfile @dependencies = dependencies @dependency_files = dependency_files @credentials = credentials @security_updates_only = security_updates_only @release_age_days = release_age_days end |
Instance Method Details
#updated_lockfile ⇒ Object
55 56 57 58 59 |
# File 'lib/dependabot/npm_and_yarn/file_updater/npm_lockfile_updater.rb', line 55 def updated_lockfile updated_file = lockfile.dup updated_file.content = updated_lockfile_content updated_file end |
#updated_lockfile_reponse(response) ⇒ Object
68 69 70 |
# File 'lib/dependabot/npm_and_yarn/file_updater/npm_lockfile_updater.rb', line 68 def updated_lockfile_reponse(response) handle_npm_updater_error(response) end |
#updated_package_json_files ⇒ Object
62 63 64 65 |
# File 'lib/dependabot/npm_and_yarn/file_updater/npm_lockfile_updater.rb', line 62 def updated_package_json_files updated_lockfile_content @updated_package_json_files || {} end |