Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1544 from carlhuda/1532_bundle_clean_force_gemsets

Fixes #1532. Use Gem.bindir and not spec.bindir
  • Loading branch information...
commit 80af162215c3f06392dcb2b71a92e88fb0e51fcd 2 parents 3431d6d + eec8499
@sferik sferik authored
View
2  lib/bundler/runtime.rb
@@ -149,7 +149,7 @@ def clean
md = %r{(.+bundler/gems/.+-[a-f0-9]{7,12})}.match(spec.full_gem_path)
spec_git_paths << md[1] if md
spec_gem_executables << spec.executables.collect do |executable|
- "#{Gem.dir}/#{spec.bindir}/#{executable}"
+ "#{Gem.bindir}/#{executable}"
end
spec_cache_paths << spec.cache_file
spec_gemspec_paths << spec.spec_file
View
22 spec/other/clean_spec.rb
@@ -424,4 +424,26 @@ def should_not_have_gems(*gems)
vendored_gems("bundler/gems/foo-1.0-#{revision[0..6]}").should exist
end
+
+ it "when using --force on system gems, it doesn't remove binaries" do
+ build_repo2
+ update_repo2 do
+ build_gem 'bindir' do |s|
+ s.bindir = "exe"
+ s.executables = "foo"
+ end
+ end
+
+ gemfile <<-G
+ source "file://#{gem_repo2}"
+
+ gem "bindir"
+ G
+ bundle :install
+ bundle "clean --force"
+
+ sys_status "foo"
+ @existstatus.should_not == 0
+ out.should == "1.0"
+ end
end
View
2  spec/support/builders.rb
@@ -421,7 +421,7 @@ def write(file, source = "")
def executables=(val)
Array(val).each do |file|
- write "bin/#{file}", "require '#{@name}' ; puts #{@name.upcase}"
+ write "#{@spec.bindir}/#{file}", "require '#{@name}' ; puts #{@name.upcase}"
end
@spec.executables = Array(val)
end
Please sign in to comment.
Something went wrong with that request. Please try again.