class Bundler::Definition

def lock(file_or_preserve_unknown_sections = false, preserve_unknown_sections_or_unused = false)

def lock(file_or_preserve_unknown_sections = false, preserve_unknown_sections_or_unused = false)
  if [true, false, nil].include?(file_or_preserve_unknown_sections)
    target_lockfile = lockfile
    preserve_unknown_sections = file_or_preserve_unknown_sections
  else
    target_lockfile = file_or_preserve_unknown_sections
    preserve_unknown_sections = preserve_unknown_sections_or_unused
    suggestion = if target_lockfile == lockfile
      "To fix this warning, remove it from the `Definition#lock` call."
    else
      "Instead, instantiate a new definition passing `#{target_lockfile}`, and call `lock` without a file argument on that definition"
    end
    msg = "`Definition#lock` was passed a target file argument. #{suggestion}"
    Bundler::SharedHelpers.major_deprecation 2, msg
  end
  write_lock(target_lockfile, preserve_unknown_sections)
end