Class: Dependabot::NpmAndYarn::FileUpdater::NpmLockfileUpdater

Inherits:
Object
  • Object
show all
Defined in:
lib/dependabot/npm_and_yarn/file_updater/npm_lockfile_updater.rb

Instance Method Summary collapse

Constructor Details

#initialize(lockfile:, dependencies:, dependency_files:, credentials:) ⇒ NpmLockfileUpdater

Returns a new instance of NpmLockfileUpdater.



20
21
22
23
24
25
# File 'lib/dependabot/npm_and_yarn/file_updater/npm_lockfile_updater.rb', line 20

def initialize(lockfile:, dependencies:, dependency_files:, credentials:)
  @lockfile = lockfile
  @dependencies = dependencies
  @dependency_files = dependency_files
  @credentials = credentials
end

Instance Method Details

#updated_lockfileObject



27
28
29
30
31
# File 'lib/dependabot/npm_and_yarn/file_updater/npm_lockfile_updater.rb', line 27

def updated_lockfile
  updated_file = lockfile.dup
  updated_file.content = updated_lockfile_content
  updated_file
end