Permalink
Browse files

return to 1.x behaviour for --binstubs

  • Loading branch information...
1 parent b7ba928 commit f00e085991576b9c6e716db11a76ab4070c8ac80 @indirect indirect committed Feb 14, 2013
Showing with 8 additions and 6 deletions.
  1. +2 −2 lib/bundler/cli.rb
  2. +4 −2 lib/bundler/installer.rb
  3. +2 −2 spec/runtime/executable_spec.rb
View
@@ -357,8 +357,8 @@ def binstubs(gem_name)
Bundler.definition.validate_ruby!
Bundler.settings[:bin] = options["path"] if options["path"]
Bundler.settings[:bin] = nil if options["path"] && options["path"].empty?
- installer = Installer.new(Bundler.root, Bundler.definition)
- spec = installer.specs.find{|s| s.name == gem_name }
+ installer = Installer.new(Bundler.root, Bundler.definition)
+ spec = installer.specs.find{|s| s.name == gem_name }
raise GemNotFound, not_found_message(gem_name, Bundler.load.specs) unless spec
if spec.name == "bundler"
@@ -109,8 +109,10 @@ def install_gem_from_spec(spec, standalone = false)
# newline comes after installing, some gems say "with native extensions"
Bundler.ui.info ""
- if Bundler.settings[:bin]
- standalone ? generate_standalone_bundler_executable_stubs(spec) : generate_bundler_executable_stubs(spec)
+ if Bundler.settings[:bin] && standalone
+ generate_standalone_bundler_executable_stubs(spec)
+ elsif Bundler.settings[:bin]
+ generate_bundler_executable_stubs(spec, :force => true)
end
FileUtils.rm_rf(Bundler.tmp)
@@ -130,7 +130,7 @@
expect(bundled_app("bin/rackup")).to exist
end
- it "doesn't overwrite on --binstub" do
+ it "rewrites bins on --binstubs (to maintain backwards compatibility)" do
gemfile <<-G
source "file://#{gem_repo1}"
gem "rack"
@@ -144,6 +144,6 @@
bundle "install"
- expect(bundled_app("bin/rackup").read).to eq("OMG")
+ expect(bundled_app("bin/rackup").read).to_not eq("OMG")
end
end

3 comments on commit f00e085

@chrismo
Member

isn't this going to screw with Rails 4 rails:update:bin? see -> rails/rails@009873a#commitcomment-2503776 and #2253 ... though I understand if this is for backwards compatibility, there may not be an easy answer.

@indirect
Member
@chrismo
Member

I just tried this on a clean install of Bundler 1.3 and edge Rails and they seem to still be competing with each other when installing with --binstubs.

https://gist.github.com/chrismo/5043420

EDIT: sorry - should have searched the issues more thoroughly -> "Use the new bundle binstubs command." (re: this issue -> rails/rails#8974)

Please sign in to comment.