Method: Pod::Lockfile#write_to_disk

Defined in:
lib/cocoapods-core/lockfile.rb

#write_to_disk(path) ⇒ void

This method returns an undefined value.

Writes the Lockfile to the given path.

Parameters:

  • path (Pathname)

    the path where the lockfile should be saved.

[View source]

334
335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/cocoapods-core/lockfile.rb', line 334

def write_to_disk(path)
  path.dirname.mkpath unless path.dirname.exist?
  self.defined_in_file = path
  # rubocop:disable Lint/RescueException
  # rubocop:disable Lint/HandleExceptions
  begin
    existing = Lockfile.from_file(path)
    return if existing == self
  rescue Exception
  end
  path.open('w') { |f| f.write(to_yaml) }
  # rubocop:enable Lint/HandleExceptions
  # rubocop:enable Lint/RescueException
end