diff options
author | Andre Arko <andre@arko.net> | 2014-04-01 17:09:39 +0800 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2014-04-01 17:09:39 +0800 |
commit | 9007c941b4cb1fb03cbb188f23105e798d2736cf (patch) | |
tree | f85295b78ed038452b8bd4f837aaa52a0444549d | |
parent | 94fb577eb5ba7f6508f49526a31f21e2783be3b2 (diff) | |
download | bundler-rubygems22_exts.tar.gz |
handle extensions from Rubygems 2.2, with testrubygems22_exts
fixes #2847
-rw-r--r-- | lib/bundler/source/rubygems.rb | 10 | ||||
-rw-r--r-- | spec/install/gems/sudo_spec.rb | 10 |
2 files changed, 17 insertions, 3 deletions
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb index ce40cbc6c3..5179680ce0 100644 --- a/lib/bundler/source/rubygems.rb +++ b/lib/bundler/source/rubygems.rb @@ -100,9 +100,13 @@ module Bundler # SUDO HAX if Bundler.requires_sudo? Bundler.rubygems.repository_subdirectories.each do |name| - src = "#{install_path}/#{name}/*" - dst = "#{Bundler.rubygems.gem_dir}/#{name}/" - Bundler.mkdir_p dist + src = File.join(install_path, name, "*") + dst = File.join(Bundler.rubygems.gem_dir, name) + if name == "extensions" + src = File.join(src, "*/*") + dst = File.dirname(File.join(dst, Dir.glob(src).first.gsub(src[0..-6], ''))) + end + Bundler.mkdir_p dst Bundler.sudo "cp -R #{src} #{dst}" if Dir[src].any? end diff --git a/spec/install/gems/sudo_spec.rb b/spec/install/gems/sudo_spec.rb index 4985fafd3c..2fccfc0871 100644 --- a/spec/install/gems/sudo_spec.rb +++ b/spec/install/gems/sudo_spec.rb @@ -82,6 +82,16 @@ describe "when using sudo", :sudo => true do expect(bundle_path.join("gems/rack-1.0.0").stat.uid).to eq(0) should_be_installed "rack 1.0" end + + it "installs extensions/ compiled by Rubygems 2.2", :rubygems => "2.2" do + install_gemfile <<-G + source "file://#{gem_repo1}" + gem "very_simple_binary" + G + + binary = Dir.glob(system_gem_path("extensions/*/*/very_simple_binary-1.0/very_simple_binary_c.bundle")).first + expect(File.exist?(binary)).to be + end end describe "and BUNDLE_PATH is not writable" do |