aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/bundler/dsl.rb5
-rw-r--r--lib/bundler/installer.rb3
-rw-r--r--lib/bundler/runtime.rb2
-rw-r--r--lib/bundler/source.rb2
-rw-r--r--lib/bundler/templates/environment.erb5
-rw-r--r--spec/runtime/environment_rb_spec.rb1
-rw-r--r--spec/spec_helper.rb4
-rw-r--r--spec/support/helpers.rb2
-rw-r--r--spec/support/rubygems_ext.rb (renamed from spec/support/rubygems.rb)0
9 files changed, 19 insertions, 5 deletions
diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb
index c08b22e2..1064981f 100644
--- a/lib/bundler/dsl.rb
+++ b/lib/bundler/dsl.rb
@@ -80,11 +80,14 @@ module Bundler
end
def _normalize_hash(opts)
- opts.each do |k, v|
+ # Cannot modify a hash during an iteration in 1.9
+ opts.keys.each do |k|
next if String === k
+ v = opts[k]
opts.delete(k)
opts[k.to_s] = v
end
+ opts
end
def _normalize_options(name, version, opts)
diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb
index dbc47c8b..2da82ab0 100644
--- a/lib/bundler/installer.rb
+++ b/lib/bundler/installer.rb
@@ -12,6 +12,9 @@ module Bundler
return
end
+ # Ensure that BUNDLE_PATH exists
+ FileUtils.mkdir_p(Bundler.bundle_path)
+
specs.sort_by { |s| s.name }.each do |spec|
# unless spec.source.is_a?(Source::SystemGems)
Bundler.ui.info "Installing #{spec.name} (#{spec.version}) from #{spec.source} "
diff --git a/lib/bundler/runtime.rb b/lib/bundler/runtime.rb
index 863188c4..31922921 100644
--- a/lib/bundler/runtime.rb
+++ b/lib/bundler/runtime.rb
@@ -256,7 +256,7 @@ module Bundler
source_index_class.send(:define_method, :from_gems_in) do |*args|
source_index = Gem::SourceIndex.new
source_index.spec_dirs = *args
- source_index.add_specs *specs
+ source_index.add_specs(*specs)
source_index
end
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb
index 7dd16ef3..75da44f8 100644
--- a/lib/bundler/source.rb
+++ b/lib/bundler/source.rb
@@ -236,7 +236,7 @@ module Bundler
# Loop over the lines and extract the relative path and the
# git hash
lines.each do |line|
- next unless line =~ %r{^(\d+) (blob|tree) ([a-zf0-9]+)\t(.*)$}
+ next unless line =~ %r{^(\d+) (blob|tree) ([a-f0-9]+)\t(.*)$}
hash, file = $3, $4
# Read the gemspec
if spec = eval(%x(git cat-file blob #{$3}))
diff --git a/lib/bundler/templates/environment.erb b/lib/bundler/templates/environment.erb
index 545c5214..19df5502 100644
--- a/lib/bundler/templates/environment.erb
+++ b/lib/bundler/templates/environment.erb
@@ -31,6 +31,7 @@ module Bundler
def self.setup(*groups)
match_fingerprint
+ clean_load_path
SPECS.each do |spec|
spec[:load_paths].each { |path| $LOAD_PATH.unshift path }
end
@@ -53,6 +54,10 @@ module Bundler
end
def self.patch_rubygems
+ Kernel.class_eval do
+ private
+ def gem(*) ; end
+ end
Gem.source_index # ensure RubyGems is fully loaded
specs = SPECS
diff --git a/spec/runtime/environment_rb_spec.rb b/spec/runtime/environment_rb_spec.rb
index c172fc3e..c7a3ba0c 100644
--- a/spec/runtime/environment_rb_spec.rb
+++ b/spec/runtime/environment_rb_spec.rb
@@ -16,6 +16,7 @@ describe "environment.rb file" do
it "does not pull in system gems" do
run <<-R, :lite_runtime => true
require 'rubygems'
+
begin;
require 'rack'
rescue LoadError
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 58f35c7b..0c8e1b92 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -10,7 +10,9 @@ Dir["#{File.expand_path('../support', __FILE__)}/*.rb"].each do |file|
require file
end
-$debug = false
+$debug = false
+$show_err = false
+
Spec::Rubygems.setup
FileUtils.rm_rf(Spec::Path.gem_repo1)
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb
index ac259cec..7083fabd 100644
--- a/spec/support/helpers.rb
+++ b/spec/support/helpers.rb
@@ -44,7 +44,7 @@ module Spec
gemfile = File.expand_path('../../../bin/bundle', __FILE__)
input, out, err, waitthread = Open3.popen3("#{Gem.ruby} -I#{lib} #{gemfile} #{cmd}#{args}")
@err = err.read.strip
- puts @err if $debug && !err.empty?
+ puts @err if $show_err && !@err.empty?
@out = out.read.strip
@exitstatus = nil
@exitstatus = waitthread.value.to_i if waitthread
diff --git a/spec/support/rubygems.rb b/spec/support/rubygems_ext.rb
index 7c534c3a..7c534c3a 100644
--- a/spec/support/rubygems.rb
+++ b/spec/support/rubygems_ext.rb