[rubygems/rubygems] Consistently use "lockfile" over "lock file"

https://github.com/rubygems/rubygems/commit/e891be9197
This commit is contained in:
David Rodríguez 2025-03-12 18:16:57 +01:00 committed by Hiroshi SHIBATA
parent 33201adf68
commit bb1b5877a7
Notes: git 2025-03-24 04:25:33 +00:00
17 changed files with 22 additions and 22 deletions

View File

@ -813,9 +813,9 @@ module Bundler
[@new_platforms.any?, "you are adding a new platform to your lockfile"], [@new_platforms.any?, "you are adding a new platform to your lockfile"],
[@path_changes, "the gemspecs for path gems changed"], [@path_changes, "the gemspecs for path gems changed"],
[@local_changes, "the gemspecs for git local gems changed"], [@local_changes, "the gemspecs for git local gems changed"],
[@missing_lockfile_dep, "your lock file is missing \"#{@missing_lockfile_dep}\""], [@missing_lockfile_dep, "your lockfile is missing \"#{@missing_lockfile_dep}\""],
[@unlocking_bundler, "an update to the version of Bundler itself was requested"], [@unlocking_bundler, "an update to the version of Bundler itself was requested"],
[@locked_spec_with_missing_deps, "your lock file includes \"#{@locked_spec_with_missing_deps}\" but not some of its dependencies"], [@locked_spec_with_missing_deps, "your lockfile includes \"#{@locked_spec_with_missing_deps}\" but not some of its dependencies"],
[@locked_spec_with_invalid_deps, "your lockfile does not satisfy dependencies of \"#{@locked_spec_with_invalid_deps}\""], [@locked_spec_with_invalid_deps, "your lockfile does not satisfy dependencies of \"#{@locked_spec_with_invalid_deps}\""],
].select(&:first).map(&:last).join(", ") ].select(&:first).map(&:last).join(", ")
end end

View File

@ -196,7 +196,7 @@ module Bundler
# If in frozen mode, we fallback to a non-installable candidate because by # If in frozen mode, we fallback to a non-installable candidate because by
# doing this we avoid re-resolving and potentially end up changing the # doing this we avoid re-resolving and potentially end up changing the
# lock file, which is not allowed. In that case, we will give a proper error # lockfile, which is not allowed. In that case, we will give a proper error
# about the mismatch higher up the stack, right before trying to install the # about the mismatch higher up the stack, right before trying to install the
# bad gem. # bad gem.
def choose_compatible(candidates, fallback_to_non_installable: Bundler.frozen_bundle?) def choose_compatible(candidates, fallback_to_non_installable: Bundler.frozen_bundle?)

View File

@ -195,7 +195,7 @@ module Bundler
@sources[name] @sources[name]
end end
# @param [Hash] The options that are present in the lock file # @param [Hash] The options that are present in the lockfile
# @return [API::Source] the instance of the class that handles the source # @return [API::Source] the instance of the class that handles the source
# type passed in locked_opts # type passed in locked_opts
def from_lock(locked_opts) def from_lock(locked_opts)

View File

@ -67,7 +67,7 @@ module Bundler
# to check out same version of gem later. # to check out same version of gem later.
# #
# There options are passed when the source plugin is created from the # There options are passed when the source plugin is created from the
# lock file. # lockfile.
# #
# @return [Hash] # @return [Hash]
def options_to_lock def options_to_lock

View File

@ -17,7 +17,7 @@ module Bundler
# Some candidates may also keep some information explicitly about the # Some candidates may also keep some information explicitly about the
# package they refer to. These candidates are referred to as "canonical" and # package they refer to. These candidates are referred to as "canonical" and
# are used when materializing resolution results back into RubyGems # are used when materializing resolution results back into RubyGems
# specifications that can be installed, written to lock files, and so on. # specifications that can be installed, written to lockfiles, and so on.
# #
class Candidate class Candidate
include Comparable include Comparable

View File

@ -33,7 +33,7 @@ RSpec.describe Bundler::Definition do
before { Bundler::Definition.no_lock = true } before { Bundler::Definition.no_lock = true }
after { Bundler::Definition.no_lock = false } after { Bundler::Definition.no_lock = false }
it "does not create a lock file" do it "does not create a lockfile" do
subject.lock subject.lock
expect(bundled_app_lock).not_to be_file expect(bundled_app_lock).not_to be_file
end end

View File

@ -59,7 +59,7 @@ RSpec.describe Bundler::SharedHelpers do
before { allow(subject).to receive(:default_gemfile).and_return(gemfile_path) } before { allow(subject).to receive(:default_gemfile).and_return(gemfile_path) }
it "returns the lock file path" do it "returns the lockfile path" do
expect(subject.default_lockfile).to eq(expected_lockfile_path) expect(subject.default_lockfile).to eq(expected_lockfile_path)
end end
end end

View File

@ -258,7 +258,7 @@ RSpec.describe "bundle check" do
expect(err).not_to include("Unfortunately, a fatal error has occurred. ") expect(err).not_to include("Unfortunately, a fatal error has occurred. ")
end end
it "fails when there's no lock file and frozen is set" do it "fails when there's no lockfile and frozen is set" do
install_gemfile <<-G install_gemfile <<-G
source "https://gem.repo1" source "https://gem.repo1"
gem "foo" gem "foo"

View File

@ -49,7 +49,7 @@ RSpec.describe "bundle install with gem sources" do
expect(bundled_app(".bundle")).not_to exist expect(bundled_app(".bundle")).not_to exist
end end
it "creates lock files based on the Gemfile name" do it "creates lockfiles based on the Gemfile name" do
gemfile bundled_app("OmgFile"), <<-G gemfile bundled_app("OmgFile"), <<-G
source "https://gem.repo1" source "https://gem.repo1"
gem "myrack", "1.0" gem "myrack", "1.0"

View File

@ -80,7 +80,7 @@ RSpec.describe "bundle update" do
end end
describe "with --gemfile" do describe "with --gemfile" do
it "creates lock files based on the Gemfile name" do it "creates lockfiles based on the Gemfile name" do
gemfile bundled_app("OmgFile"), <<-G gemfile bundled_app("OmgFile"), <<-G
source "https://gem.repo1" source "https://gem.repo1"
gem "myrack", "1.0" gem "myrack", "1.0"

View File

@ -321,7 +321,7 @@ RSpec.describe "install in deployment or frozen mode" do
L L
bundle :install, env: { "BUNDLE_FROZEN" => "true" }, raise_on_error: false, artifice: "compact_index" bundle :install, env: { "BUNDLE_FROZEN" => "true" }, raise_on_error: false, artifice: "compact_index"
expect(err).to include("Your lock file is missing \"bar\", but the lockfile can't be updated because frozen mode is set") expect(err).to include("Your lockfile is missing \"bar\", but the lockfile can't be updated because frozen mode is set")
end end
it "explodes if a path gem is missing" do it "explodes if a path gem is missing" do

View File

@ -273,7 +273,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
expect(the_bundle).to include_gems("depends_on_myrack 1.0.1", "myrack 1.0.0", source: "remote3") expect(the_bundle).to include_gems("depends_on_myrack 1.0.1", "myrack 1.0.0", source: "remote3")
# In https://github.com/bundler/bundler/issues/3585 this failed # In https://github.com/bundler/bundler/issues/3585 this failed
# when there is already a lock file, and the gems are missing, so try again # when there is already a lockfile, and the gems are missing, so try again
system_gems [] system_gems []
bundle :install, artifice: "compact_index" bundle :install, artifice: "compact_index"
@ -482,7 +482,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
expect(the_bundle).to include_gems("depends_on_myrack 1.0.1", "myrack 1.0.0") expect(the_bundle).to include_gems("depends_on_myrack 1.0.1", "myrack 1.0.0")
# In https://github.com/rubygems/bundler/issues/3585 this failed # In https://github.com/rubygems/bundler/issues/3585 this failed
# when there is already a lock file, and the gems are missing, so try again # when there is already a lockfile, and the gems are missing, so try again
system_gems [] system_gems []
bundle :install, artifice: "compact_index" bundle :install, artifice: "compact_index"

View File

@ -91,7 +91,7 @@ RSpec.describe "bundle install with specific platforms" do
#{Bundler::VERSION} #{Bundler::VERSION}
L L
# force strict usage of the lock file by setting frozen mode # force strict usage of the lockfile by setting frozen mode
bundle "config set --local frozen true" bundle "config set --local frozen true"
# make sure the platform that got actually installed with the old bundler is used # make sure the platform that got actually installed with the old bundler is used

View File

@ -394,7 +394,7 @@ RSpec.describe "bundle install with install-time dependencies" do
end end
end end
context "with a Gemfile and lock file that don't resolve under the current platform" do context "with a Gemfile and lockfile that don't resolve under the current platform" do
before do before do
build_repo4 do build_repo4 do
build_gem "sorbet", "0.5.10554" do |s| build_gem "sorbet", "0.5.10554" do |s|

View File

@ -24,7 +24,7 @@ RSpec.describe "process lock spec" do
context "when creating a lock raises Errno::ENOTSUP" do context "when creating a lock raises Errno::ENOTSUP" do
before { allow(File).to receive(:open).and_raise(Errno::ENOTSUP) } before { allow(File).to receive(:open).and_raise(Errno::ENOTSUP) }
it "skips creating the lock file and yields" do it "skips creating the lockfile and yields" do
processed = false processed = false
Bundler::ProcessLock.lock(default_bundle_path) { processed = true } Bundler::ProcessLock.lock(default_bundle_path) { processed = true }
@ -35,7 +35,7 @@ RSpec.describe "process lock spec" do
context "when creating a lock raises Errno::EPERM" do context "when creating a lock raises Errno::EPERM" do
before { allow(File).to receive(:open).and_raise(Errno::EPERM) } before { allow(File).to receive(:open).and_raise(Errno::EPERM) }
it "skips creating the lock file and yields" do it "skips creating the lockfile and yields" do
processed = false processed = false
Bundler::ProcessLock.lock(default_bundle_path) { processed = true } Bundler::ProcessLock.lock(default_bundle_path) { processed = true }
@ -46,7 +46,7 @@ RSpec.describe "process lock spec" do
context "when creating a lock raises Errno::EROFS" do context "when creating a lock raises Errno::EROFS" do
before { allow(File).to receive(:open).and_raise(Errno::EROFS) } before { allow(File).to receive(:open).and_raise(Errno::EROFS) }
it "skips creating the lock file and yields" do it "skips creating the lockfile and yields" do
processed = false processed = false
Bundler::ProcessLock.lock(default_bundle_path) { processed = true } Bundler::ProcessLock.lock(default_bundle_path) { processed = true }

View File

@ -2030,7 +2030,7 @@ RSpec.describe "the lockfile format" do
L L
bundle "install --verbose" bundle "install --verbose"
expect(out).to include("re-resolving dependencies because your lock file includes \"minitest-bisect\" but not some of its dependencies") expect(out).to include("re-resolving dependencies because your lockfile includes \"minitest-bisect\" but not some of its dependencies")
expect(lockfile).to eq <<~L expect(lockfile).to eq <<~L
GEM GEM

View File

@ -67,7 +67,7 @@ RSpec.describe "real source plugins" do
expect(the_bundle).to include_gems("a-path-gem 1.0") expect(the_bundle).to include_gems("a-path-gem 1.0")
end end
it "writes to lock file" do it "writes to lockfile" do
bundle "install" bundle "install"
checksums = checksums_section_when_enabled do |c| checksums = checksums_section_when_enabled do |c|
@ -336,7 +336,7 @@ RSpec.describe "real source plugins" do
expect(the_bundle).to include_gems("ma-gitp-gem 1.0") expect(the_bundle).to include_gems("ma-gitp-gem 1.0")
end end
it "writes to lock file" do it "writes to lockfile" do
revision = revision_for(lib_path("ma-gitp-gem-1.0")) revision = revision_for(lib_path("ma-gitp-gem-1.0"))
bundle "install" bundle "install"