Browse files

For issue #1643 place the standalone setup.rb relative to the gems.

  • Loading branch information...
1 parent 42d2c3e commit 18097dc3988f5c96ee46e041be2df6815e7e40bd @sodabrew sodabrew committed Jan 26, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/bundler/installer.rb
View
8 lib/bundler/installer.rb
@@ -124,8 +124,9 @@ def generate_standalone_bundler_executable_stubs(spec)
end
def generate_standalone(groups)
- standalone_path = Bundler.settings[:path]
- bundler_path = File.join(standalone_path, "bundler")
+ bundler_path = File.expand_path(File.join(Bundler.rubygems.gem_path, "..", "..", "bundler"))
+ bundler_setup_file = File.join(bundler_path, "setup.rb")
+ Bundler.ui.debug "Generating standlone include file #{bundler_setup_file}"
FileUtils.mkdir_p(bundler_path)
paths = []
@@ -145,8 +146,7 @@ def generate_standalone(groups)
end
end
-
- File.open File.join(bundler_path, "setup.rb"), "w" do |file|
+ File.open bundler_setup_file, "w" do |file|
file.puts "path = File.expand_path('..', __FILE__)"
paths.each do |path|
file.puts %{$:.unshift File.expand_path("\#{path}/#{path}")}

0 comments on commit 18097dc

Please sign in to comment.