ruby-changes:54787
From: hsbt <ko1@a...>
Date: Tue, 5 Feb 2019 13:58:51 +0900 (JST)
Subject: [ruby-changes:54787] hsbt:r67006 (trunk): Ignore to add bundler lib direcotry if it is same as rubylibdir.
hsbt 2019-02-05 13:58:46 +0900 (Tue, 05 Feb 2019) New Revision: 67006 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67006 Log: Ignore to add bundler lib direcotry if it is same as rubylibdir. [Bug #15469][ruby-core:90742] Modified files: trunk/lib/bundler/shared_helpers.rb trunk/spec/bundler/bundler/shared_helpers_spec.rb Index: lib/bundler/shared_helpers.rb =================================================================== --- lib/bundler/shared_helpers.rb (revision 67005) +++ lib/bundler/shared_helpers.rb (revision 67006) @@ -340,7 +340,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/shared_helpers.rb#L340 def set_rubylib rubylib = (ENV["RUBYLIB"] || "").split(File::PATH_SEPARATOR) - rubylib.unshift bundler_ruby_lib + rubylib.unshift bundler_ruby_lib unless RbConfig::CONFIG["rubylibdir"] == bundler_ruby_lib Bundler::SharedHelpers.set_env "RUBYLIB", rubylib.uniq.join(File::PATH_SEPARATOR) end Index: spec/bundler/bundler/shared_helpers_spec.rb =================================================================== --- spec/bundler/bundler/shared_helpers_spec.rb (revision 67005) +++ spec/bundler/bundler/shared_helpers_spec.rb (revision 67006) @@ -261,6 +261,15 @@ RSpec.describe Bundler::SharedHelpers do https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/shared_helpers_spec.rb#L261 subject.set_bundle_environment end + it "ignores if bundler_ruby_lib is same as rubylibdir" do + allow(Bundler::SharedHelpers).to receive(:bundler_ruby_lib).and_return(RbConfig::CONFIG["rubylibdir"]) + + subject.set_bundle_environment + + paths = (ENV["RUBYLIB"]).split(File::PATH_SEPARATOR) + expect(paths.count(RbConfig::CONFIG["rubylibdir"])).to eq(0) + end + it "exits if bundle path contains the unix-like path separator" do if Gem.respond_to?(:path_separator) allow(Gem).to receive(:path_separator).and_return(":") -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/