mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[rubygems/rubygems] Fix generated standalone script for default gems
The installer is actually rewriting the spec's full gem path to be the
one of the newly installed gem, however the accessor was not properly
working for `StubSpecification` instances, and default gems are always
of this type, because they are always present locally.
Fix the accessor to properly update the underlying full specification.
efa41babfa
This commit is contained in:
parent
f5b88d93ae
commit
0a6b9924bd
2 changed files with 12 additions and 1 deletions
|
@ -67,6 +67,10 @@ module Bundler
|
||||||
stub.full_gem_path
|
stub.full_gem_path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def full_gem_path=(path)
|
||||||
|
stub.full_gem_path = path
|
||||||
|
end
|
||||||
|
|
||||||
def full_require_paths
|
def full_require_paths
|
||||||
stub.full_require_paths
|
stub.full_require_paths
|
||||||
end
|
end
|
||||||
|
|
|
@ -147,9 +147,16 @@ RSpec.shared_examples "bundle install --standalone" do
|
||||||
bundle "lock", :dir => cwd, :artifice => "compact_index"
|
bundle "lock", :dir => cwd, :artifice => "compact_index"
|
||||||
end
|
end
|
||||||
|
|
||||||
it "works" do
|
it "works and points to the vendored copies, not to the default copies" do
|
||||||
bundle "config set --local path #{bundled_app("bundle")}"
|
bundle "config set --local path #{bundled_app("bundle")}"
|
||||||
bundle :install, :standalone => true, :dir => cwd, :artifice => "compact_index", :env => { "BUNDLER_GEM_DEFAULT_DIR" => system_gem_path.to_s }
|
bundle :install, :standalone => true, :dir => cwd, :artifice => "compact_index", :env => { "BUNDLER_GEM_DEFAULT_DIR" => system_gem_path.to_s }
|
||||||
|
|
||||||
|
load_path_lines = bundled_app("bundle/bundler/setup.rb").read.split("\n").select {|line| line.start_with?("$:.unshift") }
|
||||||
|
|
||||||
|
expect(load_path_lines).to eq [
|
||||||
|
'$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{RbConfig::CONFIG["ruby_version"]}/gems/bar-1.0.0/lib")',
|
||||||
|
'$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{RbConfig::CONFIG["ruby_version"]}/gems/foo-1.0.0/lib")',
|
||||||
|
]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue