bundler 1.0.7 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bundler might be problematic. Click here for more details.

@@ -1,3 +1,33 @@
1
+ ## 1.0.9 (January 19, 2010)
2
+
3
+ Bugfixes:
4
+
5
+ - Fix a bug where Bundler.require could remove gems from the load
6
+ path. In Rails apps with a default application.rb, this removed
7
+ all gems in groups other than :default and Rails.env.
8
+
9
+ ## 1.0.8 (January 18, 2010)
10
+
11
+ Features:
12
+
13
+ - Allow overriding gemspec() deps with :git deps
14
+ - Add --local option to `bundle update`
15
+ - Ignore Gemfile.lock in newly generated gems
16
+ - Use `less` as help pager instead of `more`
17
+ - Run `bundle exec rake` instead of `rake` in Capistrano tasks
18
+
19
+ Bugfixes:
20
+
21
+ - Fix --no-cache option for `bundle install`
22
+ - Allow Vlad deploys to work without Capistrano gem installed
23
+ - Fix group arguments to `bundle console`
24
+ - Allow groups to be loaded even if other groups were loaded
25
+ - Evaluate gemspec() gemspecs in their directory not the cwd
26
+ - Count on Rake to chdir to the right place in GemHelper
27
+ - Change Pathnames to Strings for MacRuby
28
+ - Check git process exit status correctly
29
+ - Fix some warnings in 1.9.3-trunk (thanks tenderlove)
30
+
1
31
  ## 1.0.7 (November 17, 2010)
2
32
 
3
33
  Bugfixes:
@@ -290,8 +320,6 @@ isolation.
290
320
  - Fix cases where the same dependency appeared several times in the Gemfile.lock
291
321
  - Fix a bug where require errors were being swallowed during Bundler.require
292
322
 
293
- ## BACKFILL COMING
294
-
295
323
  ## 1.0.0.beta.1
296
324
 
297
325
  - No `bundle lock` command. Locking happens automatically on install or update
data/Rakefile CHANGED
@@ -24,7 +24,7 @@ begin
24
24
  namespace :ci do
25
25
  desc "Run specs with Hudson output"
26
26
  RSpec::Core::RakeTask.new(:spec)
27
- task :spec => ["ci:setup:rspec", "man:build", "spec:set_sudo"]
27
+ task :spec => ["ci:setup:rspec", "man:build"]
28
28
  end
29
29
 
30
30
  rescue LoadError
@@ -60,7 +60,7 @@ begin
60
60
  namespace :rubygems do
61
61
  # Rubygems 1.3.5, 1.3.6, and HEAD specs
62
62
  rubyopt = ENV["RUBYOPT"]
63
- %w(master REL_1_3_5 REL_1_3_6).each do |rg|
63
+ %w(master v1.3.5 v1.3.6 v1.3.7 v1.4.0 v1.4.1).each do |rg|
64
64
  desc "Run specs with Rubygems #{rg}"
65
65
  RSpec::Core::RakeTask.new(rg) do |t|
66
66
  t.rspec_opts = %w(-fs --color)
@@ -69,7 +69,7 @@ begin
69
69
 
70
70
  task "clone_rubygems_#{rg}" do
71
71
  unless File.directory?("tmp/rubygems_#{rg}")
72
- system("git clone git://github.com/jbarnette/rubygems.git tmp/rubygems_#{rg} && cd tmp/rubygems_#{rg} && git reset --hard #{rg}")
72
+ system("git clone git://github.com/rubygems/rubygems.git tmp/rubygems_#{rg} && cd tmp/rubygems_#{rg} && git reset --hard #{rg}")
73
73
  end
74
74
  ENV["RUBYOPT"] = "-I#{File.expand_path("tmp/rubygems_#{rg}/lib")} #{rubyopt}"
75
75
  end
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
8
8
  s.name = "bundler"
9
9
  s.version = Bundler::VERSION
10
10
  s.platform = Gem::Platform::RUBY
11
- s.authors = ["Carl Lerche", "Yehuda Katz", "André Arko"]
11
+ s.authors = ["Carl Lerche", "Yehuda Katz", "André Arko", "Terence Lee"]
12
12
  s.email = ["carlhuda@engineyard.com"]
13
13
  s.homepage = "http://gembundler.com"
14
14
  s.summary = %q{The best way to manage your application's dependencies}
@@ -93,16 +93,18 @@ module Bundler
93
93
  end
94
94
 
95
95
  def setup(*groups)
96
- return @setup if defined?(@setup) && @setup
96
+ # Just return if all groups are already loaded
97
+ return @setup if defined?(@setup)
97
98
 
98
99
  if groups.empty?
99
100
  # Load all groups, but only once
100
101
  @setup = load.setup
101
102
  else
103
+ @completed_groups ||= []
102
104
  # Figure out which groups haven't been loaded yet
103
- unloaded = groups - (@completed_groups || [])
105
+ unloaded = groups - @completed_groups
104
106
  # Record groups that are now loaded
105
- @completed_groups = groups | (@completed_groups || [])
107
+ @completed_groups = groups
106
108
  # Load any groups that are not yet loaded
107
109
  unloaded.any? ? load.setup(*unloaded) : load
108
110
  end
@@ -221,13 +223,13 @@ module Bundler
221
223
  def load_gemspec(file)
222
224
  path = Pathname.new(file)
223
225
  # Eval the gemspec from its parent directory
224
- Dir.chdir(path.dirname) do
226
+ Dir.chdir(path.dirname.to_s) do
225
227
  begin
226
- Gem::Specification.from_yaml(path.basename)
228
+ Gem::Specification.from_yaml(path.basename.to_s)
227
229
  # Raises ArgumentError if the file is not valid YAML
228
230
  rescue ArgumentError, SyntaxError, Gem::EndOfYAMLException, Gem::Exception
229
231
  begin
230
- eval(File.read(path.basename), TOPLEVEL_BINDING, path.expand_path.to_s)
232
+ eval(File.read(path.basename.to_s), TOPLEVEL_BINDING, path.expand_path.to_s)
231
233
  rescue LoadError => e
232
234
  original_line = e.backtrace.find { |line| line.include?(path.to_s) }
233
235
  msg = "There was a LoadError while evaluating #{path.basename}:\n #{e.message}"
@@ -7,4 +7,5 @@ require 'bundler/deployment'
7
7
  Capistrano::Configuration.instance(:must_exist).load do
8
8
  after "deploy:update_code", "bundle:install"
9
9
  Bundler::Deployment.define_task(self, :task, :except => { :no_release => true })
10
+ set :rake, 'bundle exec rake'
10
11
  end
@@ -45,7 +45,7 @@ module Bundler
45
45
 
46
46
  if have_groff? && root !~ %r{^file:/.+!/META-INF/jruby.home/.+}
47
47
  groff = "groff -Wall -mtty-char -mandoc -Tascii"
48
- pager = ENV['MANPAGER'] || ENV['PAGER'] || 'more'
48
+ pager = ENV['MANPAGER'] || ENV['PAGER'] || 'less'
49
49
 
50
50
  Kernel.exec "#{groff} #{root}/#{command} | #{pager}"
51
51
  else
@@ -223,7 +223,7 @@ module Bundler
223
223
  Bundler.ui.be_quiet! if opts[:quiet]
224
224
 
225
225
  Installer.install(Bundler.root, Bundler.definition, opts)
226
- Bundler.load.cache if Bundler.root.join("vendor/cache").exist?
226
+ Bundler.load.cache if Bundler.root.join("vendor/cache").exist? && !options["no-cache"]
227
227
 
228
228
  if Bundler.settings[:path]
229
229
  relative_path = Bundler.settings[:path]
@@ -258,6 +258,8 @@ module Bundler
258
258
  possible versions of the gems in the bundle.
259
259
  D
260
260
  method_option "source", :type => :array, :banner => "Update a specific source (and all gems associated with it)"
261
+ method_option "local", :type => :boolean, :banner =>
262
+ "Do not attempt to fetch gems remotely and use the gem cache instead"
261
263
  def update(*gems)
262
264
  sources = Array(options[:source])
263
265
 
@@ -268,7 +270,8 @@ module Bundler
268
270
  Bundler.definition(:gems => gems, :sources => sources)
269
271
  end
270
272
 
271
- Installer.install Bundler.root, Bundler.definition, "update" => true
273
+ opts = {"update" => true, "local" => options[:local]}
274
+ Installer.install Bundler.root, Bundler.definition, opts
272
275
  Bundler.load.cache if Bundler.root.join("vendor/cache").exist?
273
276
  Bundler.ui.confirm "Your bundle is updated! " +
274
277
  "Use `bundle show [gemname]` to see where a bundled gem is installed."
@@ -430,8 +433,7 @@ module Bundler
430
433
 
431
434
  desc "console [GROUP]", "Opens an IRB session with the bundle pre-loaded"
432
435
  def console(group = nil)
433
- require 'bundler/setup'
434
- group ? Bundler.require(:default, group) : Bundler.require
436
+ group ? Bundler.require(:default, *(group.split.map! {|g| g.to_sym })) : Bundler.require
435
437
  ARGV.clear
436
438
 
437
439
  require 'irb'
@@ -1,7 +1,7 @@
1
1
  module Bundler
2
2
  class Deployment
3
3
  def self.define_task(context, task_method = :task, opts = {})
4
- if context.is_a?(Capistrano::Configuration)
4
+ if defined?(Capistrano) && context.is_a?(Capistrano::Configuration)
5
5
  context_name = "capistrano"
6
6
  role_default = "{:except => {:no_release => true}}"
7
7
  else
@@ -9,7 +9,7 @@ module Bundler
9
9
  role_default = "[:app]"
10
10
  end
11
11
 
12
- roles = context.fetch(:bundle_roles, nil)
12
+ roles = context.fetch(:bundle_roles, false)
13
13
  opts[:roles] = roles if roles
14
14
 
15
15
  context.send :namespace, :bundle do
@@ -29,12 +29,9 @@ module Bundler
29
29
 
30
30
  case gemspecs.size
31
31
  when 1
32
- spec = Gem::Specification.load(gemspecs.first)
32
+ spec = Bundler.load_gemspec(gemspecs.first)
33
33
  raise InvalidOption, "There was an error loading the gemspec at #{gemspecs.first}." unless spec
34
34
  gem spec.name, :path => path
35
- spec.runtime_dependencies.each do |dep|
36
- gem dep.name, *dep.requirement.as_list
37
- end
38
35
  group(development_group) do
39
36
  spec.development_dependencies.each do |dep|
40
37
  gem dep.name, *dep.requirement.as_list
@@ -4,9 +4,9 @@ require 'bundler'
4
4
 
5
5
  module Bundler
6
6
  class GemHelper
7
- def self.install_tasks(opts = nil)
8
- dir = File.dirname(Rake.application.rakefile_location)
9
- self.new(dir, opts && opts[:name]).install
7
+ def self.install_tasks(opts = {})
8
+ dir = opts[:dir] || Dir.pwd
9
+ self.new(dir, opts[:name]).install
10
10
  end
11
11
 
12
12
  attr_reader :spec_path, :base, :gemspec
@@ -51,7 +51,7 @@ module Bundler
51
51
 
52
52
  def install_gem
53
53
  built_gem_path = build_gem
54
- out, code = sh_with_code("gem install #{built_gem_path}")
54
+ out, _ = sh_with_code("gem install #{built_gem_path}")
55
55
  raise "Couldn't install gem, run `gem install #{built_gem_path}' for more detailed output" unless out[/Successfully installed/]
56
56
  Bundler.ui.confirm "#{name} (#{version}) installed"
57
57
  end
@@ -68,7 +68,7 @@ module Bundler
68
68
 
69
69
  protected
70
70
  def rubygem_push(path)
71
- out, status = sh("gem push #{path}")
71
+ out, _ = sh("gem push #{path}")
72
72
  raise "Gem push failed due to lack of RubyGems.org credentials." if out[/Enter your RubyGems.org credentials/]
73
73
  Bundler.ui.confirm "Pushed #{name} #{version} to rubygems.org"
74
74
  end
@@ -100,8 +100,7 @@ module Bundler
100
100
  end
101
101
 
102
102
  def clean?
103
- out, code = sh_with_code("git diff --exit-code")
104
- code == 0
103
+ sh_with_code("git diff --exit-code")[1] == 0
105
104
  end
106
105
 
107
106
  def tag_version
@@ -83,7 +83,7 @@ module Bundler
83
83
 
84
84
  # For gems in Gemfile, add details
85
85
  @env.current_dependencies.each do |dependency|
86
- node = @nodes[dependency.name]
86
+ next unless node = @nodes[dependency.name]
87
87
  node.is_user = true
88
88
 
89
89
  dependency.groups.each do |group|
@@ -104,7 +104,7 @@ module Bundler
104
104
  def same_version?(a, b)
105
105
  regex = /^(.*?)(?:\.0)*$/
106
106
 
107
- ret = a.to_s[regex, 1] == b.to_s[regex, 1]
107
+ a.to_s[regex, 1] == b.to_s[regex, 1]
108
108
  end
109
109
 
110
110
  def spec_satisfies_dependency?(spec, dep)
@@ -407,7 +407,7 @@ module Bundler
407
407
  end
408
408
 
409
409
  def error_message
410
- output = errors.inject("") do |o, (conflict, (origin, requirement))|
410
+ errors.inject("") do |o, (conflict, (origin, requirement))|
411
411
 
412
412
  # origin is the SpecSet of specs from the Gemfile that is conflicted with
413
413
  if origin
@@ -422,7 +422,7 @@ module Bundler
422
422
  o << " Current Bundler version:\n"
423
423
  newer_bundler_required = requirement.requirement > Gem::Requirement.new(origin.version)
424
424
  # If the origin is a LockfileParser, it does not respond_to :required_by
425
- elsif !origin.respond_to?(:required_by) || !(required_by = origin.required_by.first)
425
+ elsif !origin.respond_to?(:required_by) || !(origin.required_by.first)
426
426
  o << " In snapshot (Gemfile.lock):\n"
427
427
  end
428
428
 
@@ -23,7 +23,11 @@ module Bundler
23
23
  e = Gem::LoadError.new "You have already activated #{activated_spec.name} #{activated_spec.version}, " \
24
24
  "but your Gemfile requires #{spec.name} #{spec.version}. Consider using bundle exec."
25
25
  e.name = spec.name
26
- e.version_requirement = Gem::Requirement.new(spec.version.to_s)
26
+ if e.respond_to?(:requirement=)
27
+ e.requirement = Gem::Requirement.new(spec.version.to_s)
28
+ else
29
+ e.version_requirement = Gem::Requirement.new(spec.version.to_s)
30
+ end
27
31
  raise e
28
32
  end
29
33
 
@@ -96,15 +96,24 @@ module Bundler
96
96
  spec = specs.find { |s| s.name == dep.name }
97
97
 
98
98
  if spec.nil?
99
+
99
100
  e = Gem::LoadError.new "#{dep.name} is not part of the bundle. Add it to Gemfile."
100
101
  e.name = dep.name
101
- e.version_requirement = dep.requirement
102
+ if e.respond_to?(:requirement=)
103
+ e.requirement = dep.requirement
104
+ else
105
+ e.version_requirement = dep.requirement
106
+ end
102
107
  raise e
103
108
  elsif dep !~ spec
104
109
  e = Gem::LoadError.new "can't activate #{dep}, already activated #{spec.full_name}. " \
105
110
  "Make sure all dependencies are added to Gemfile."
106
111
  e.name = dep.name
107
- e.version_requirement = dep.requirement
112
+ if e.respond_to?(:requirement=)
113
+ e.requirement = dep.requirement
114
+ else
115
+ e.version_requirement = dep.requirement
116
+ end
108
117
  raise e
109
118
  end
110
119
 
@@ -134,7 +134,7 @@ module Bundler
134
134
  private
135
135
 
136
136
  def cached_gem(spec)
137
- possibilities = @caches.map { |p| "#{p}/#{spec.full_name}.gem" }
137
+ possibilities = @caches.map { |p| "#{p}/#{spec.file_name}" }
138
138
  possibilities.find { |p| File.exist?(p) }
139
139
  end
140
140
 
@@ -558,7 +558,7 @@ module Bundler
558
558
  if allow_git_ops?
559
559
  out = %x{git #{command}}
560
560
 
561
- if $? != 0
561
+ if $?.exitstatus != 0
562
562
  raise GitError, "An error has occurred in git when running `git #{command}`. Cannot complete bundling."
563
563
  end
564
564
  out
@@ -1,3 +1,4 @@
1
- pkg/*
2
1
  *.gem
3
2
  .bundle
3
+ Gemfile.lock
4
+ pkg/*
@@ -2,5 +2,5 @@ module Bundler
2
2
  # We're doing this because we might write tests that deal
3
3
  # with other versions of bundler and we are unsure how to
4
4
  # handle this better.
5
- VERSION = "1.0.7" unless defined?(::Bundler::VERSION)
5
+ VERSION = "1.0.9" unless defined?(::Bundler::VERSION)
6
6
  end
@@ -128,11 +128,12 @@ other steps in `bundle install` must be performed as the current user:
128
128
  Of these three, the first two could theoretically be performed by
129
129
  `chown`ing the resulting files to `$SUDO_USER`. The third, however,
130
130
  can only be performed by actually invoking the `git` command as
131
- the current user.
131
+ the current user. Therefore, git gems are downloaded and installed
132
+ into `~/.bundle` rather than $GEM_HOME or $BUNDLE_PATH.
132
133
 
133
134
  As a result, you should run `bundle install` as the current user,
134
- and bundler will ask for your password if it is needed to perform
135
- the final step.
135
+ and bundler will ask for your password if it is needed to put the
136
+ gems into their final location.
136
137
 
137
138
  ## INSTALLING GROUPS
138
139
 
@@ -43,6 +43,23 @@ describe "bundle install with gem sources" do
43
43
  out = run("require 'thin'; puts THIN")
44
44
  out.should == '1.0'
45
45
  end
46
+
47
+ it "removes old groups when new groups are set up" do
48
+ run <<-RUBY, :emo, :expect_err => true
49
+ Bundler.setup(:default)
50
+ require 'thin'; puts THIN
51
+ RUBY
52
+ @err.should =~ /no such file to load -- thin/i
53
+ end
54
+
55
+ it "sets up old groups when they have previously been removed" do
56
+ out = run <<-RUBY, :emo
57
+ Bundler.setup(:default)
58
+ Bundler.setup(:default, :emo)
59
+ require 'thin'; puts THIN
60
+ RUBY
61
+ out.should == '1.0'
62
+ end
46
63
  end
47
64
 
48
65
  describe "installing --without" do
@@ -68,5 +68,17 @@ describe "bundle install with gem sources" do
68
68
  out.should == "1.0.0 RUBY"
69
69
  end
70
70
  end
71
+
72
+ it "does not update the cache if --no-cache is passed" do
73
+ gemfile <<-G
74
+ source "file://#{gem_repo1}"
75
+ gem "rack"
76
+ G
77
+ bundled_app("vendor/cache").mkpath
78
+ bundled_app("vendor/cache").children.should be_empty
79
+
80
+ bundle "install --no-cache"
81
+ bundled_app("vendor/cache").children.should be_empty
82
+ end
71
83
  end
72
84
  end
@@ -177,7 +177,7 @@ describe "bundle install with platform conditionals" do
177
177
  end
178
178
 
179
179
  it "does not blow up on sources with all platform-excluded specs" do
180
- git = build_git "foo"
180
+ build_git "foo"
181
181
 
182
182
  install_gemfile <<-G
183
183
  platform :#{not_local_tag} do
@@ -93,4 +93,16 @@ describe "bundle install from an existing gemspec" do
93
93
  should_be_installed "bar-dev 1.0.0", :groups => :dev
94
94
  end
95
95
 
96
+ it "should evaluate the gemspec in its directory" do
97
+ build_lib("foo", :path => tmp.join("foo"))
98
+ File.open(tmp.join("foo/foo.gemspec"), "w") do |s|
99
+ s.write "raise 'ahh' unless Dir.pwd == '#{tmp.join("foo")}'"
100
+ end
101
+
102
+ install_gemfile <<-G, :expect_err => true
103
+ gemspec :path => '#{tmp.join("foo")}'
104
+ G
105
+ @err.should_not match(/ahh/)
106
+ end
107
+
96
108
  end
@@ -1,7 +1,9 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe "bundle help" do
4
- it "complains if older versions of bundler are installed" do
4
+ # Rubygems 1.4+ no longer load gem plugins so this test is no longer needed
5
+ rubygems_under_14 = Gem::Requirement.new("< 1.4").satisfied_by?(Gem::Version.new(Gem::VERSION))
6
+ it "complains if older versions of bundler are installed", :if => rubygems_under_14 do
5
7
  system_gems "bundler-0.8.1"
6
8
 
7
9
  bundle "help", :expect_err => true
@@ -49,7 +49,7 @@ describe "The library itself" do
49
49
  it "can still be built" do
50
50
  Dir.chdir(root) do
51
51
  `gem build bundler.gemspec`
52
- $?.should == 0
52
+ check $?.should == 0
53
53
 
54
54
  # clean up the .gem generated
55
55
  system("rm bundler-#{Bundler::VERSION}.gem")
@@ -1,6 +1,65 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe "Bundler.setup" do
4
+ describe "with no arguments" do
5
+ it "makes all groups available" do
6
+ install_gemfile <<-G
7
+ source "file://#{gem_repo1}"
8
+ gem "rack", :group => :test
9
+ G
10
+
11
+ ruby <<-RUBY
12
+ require 'rubygems'
13
+ require 'bundler'
14
+ Bundler.setup
15
+
16
+ require 'rack'
17
+ puts RACK
18
+ RUBY
19
+ err.should == ""
20
+ out.should == "1.0.0"
21
+ end
22
+ end
23
+
24
+ describe "when called with groups" do
25
+ before(:each) do
26
+ install_gemfile <<-G
27
+ source "file://#{gem_repo1}"
28
+ gem "rack", :group => :test
29
+ G
30
+ end
31
+
32
+ it "doesn't make all groups available" do
33
+ ruby <<-RUBY
34
+ require 'rubygems'
35
+ require 'bundler'
36
+ Bundler.setup(:default)
37
+
38
+ begin
39
+ require 'rack'
40
+ rescue LoadError
41
+ puts "WIN"
42
+ end
43
+ RUBY
44
+ err.should == ""
45
+ out.should == "WIN"
46
+ end
47
+
48
+ it "leaves all groups available if they were already" do
49
+ ruby <<-RUBY
50
+ require 'rubygems'
51
+ require 'bundler'
52
+ Bundler.setup
53
+ Bundler.setup(:default)
54
+
55
+ require 'rack'
56
+ puts RACK
57
+ RUBY
58
+ err.should == ""
59
+ out.should == "1.0.0"
60
+ end
61
+ end
62
+
4
63
  it "raises if the Gemfile was not yet installed" do
5
64
  gemfile <<-G
6
65
  source "file://#{gem_repo1}"
@@ -68,7 +127,7 @@ describe "Bundler.setup" do
68
127
  gem "rack"
69
128
  G
70
129
 
71
- lockfile = File.read(bundled_app("Gemfile.lock"))
130
+ File.read(bundled_app("Gemfile.lock"))
72
131
 
73
132
  FileUtils.rm(bundled_app("Gemfile.lock"))
74
133
 
@@ -107,7 +166,7 @@ describe "Bundler.setup" do
107
166
  should_be_installed "rack 1.0.0"
108
167
  end
109
168
 
110
- describe "cripping rubygems" do
169
+ describe "crippling rubygems" do
111
170
  describe "by replacing #gem" do
112
171
  before :each do
113
172
  install_gemfile <<-G
@@ -129,6 +188,19 @@ describe "Bundler.setup" do
129
188
  out.should == "WIN"
130
189
  end
131
190
 
191
+ it "version_requirement is now deprecated in rubygems 1.4.0+ when gem is missing" do
192
+ run <<-R, :expect_err => true
193
+ begin
194
+ gem "activesupport"
195
+ puts "FAIL"
196
+ rescue LoadError
197
+ puts "WIN"
198
+ end
199
+ R
200
+
201
+ err.should be_empty
202
+ end
203
+
132
204
  it "replaces #gem but raises when the version is wrong" do
133
205
  run <<-R
134
206
  begin
@@ -141,6 +213,19 @@ describe "Bundler.setup" do
141
213
 
142
214
  out.should == "WIN"
143
215
  end
216
+
217
+ it "version_requirement is now deprecated in rubygesm 1.4.0+ when the version is wrong" do
218
+ run <<-R, :expect_err => true
219
+ begin
220
+ gem "rack", "1.0.0"
221
+ puts "FAIL"
222
+ rescue LoadError
223
+ puts "WIN"
224
+ end
225
+ R
226
+
227
+ err.should be_empty
228
+ end
144
229
  end
145
230
 
146
231
  describe "by hiding system gems" do
@@ -348,6 +433,31 @@ describe "Bundler.setup" do
348
433
 
349
434
  out.should == "You have already activated thin 1.1, but your Gemfile requires thin 1.0. Consider using bundle exec."
350
435
  end
436
+
437
+ it "version_requirement is now deprecated in rubygems 1.4.0+" do
438
+ system_gems "thin-1.0", "rack-1.0.0"
439
+ build_gem "thin", "1.1", :to_system => true do |s|
440
+ s.add_dependency "rack"
441
+ end
442
+
443
+ gemfile <<-G
444
+ gem "thin", "1.0"
445
+ G
446
+
447
+ ruby <<-R, :expect_err => true
448
+ require 'rubygems'
449
+ gem "thin"
450
+ require 'bundler'
451
+ begin
452
+ Bundler.setup
453
+ puts "FAIL"
454
+ rescue Gem::LoadError => e
455
+ puts e.message
456
+ end
457
+ R
458
+
459
+ err.should be_empty
460
+ end
351
461
  end
352
462
  end
353
463
 
@@ -560,8 +670,8 @@ describe "Bundler.setup" do
560
670
  Bundler.load
561
671
  RUBY
562
672
 
563
- err.should be_empty
564
- out.should be_empty
673
+ err.should == ""
674
+ out.should == ""
565
675
  end
566
676
  end
567
677
 
@@ -26,7 +26,7 @@ $show_err = true
26
26
 
27
27
  Spec::Rubygems.setup
28
28
  FileUtils.rm_rf(Spec::Path.gem_repo1)
29
- ENV['RUBYOPT'] = "-I#{Spec::Path.root}/spec/support/rubygems_hax"
29
+ ENV['RUBYOPT'] = "#{ENV['RUBYOPT']} -r#{Spec::Path.root}/spec/support/rubygems_hax/platform.rb"
30
30
  ENV['BUNDLE_SPEC_RUN'] = "true"
31
31
 
32
32
  RSpec.configure do |config|
@@ -489,7 +489,7 @@ module Spec
489
489
  end
490
490
 
491
491
  class GitUpdater < LibBuilder
492
- WINDOWS = Config::CONFIG["host_os"] =~ %r!(msdos|mswin|djgpp|mingw)!
492
+ WINDOWS = RbConfig::CONFIG["host_os"] =~ %r!(msdos|mswin|djgpp|mingw)!
493
493
  NULL = WINDOWS ? "NUL" : "/dev/null"
494
494
 
495
495
  def silently(str)
@@ -3,7 +3,7 @@ module Spec
3
3
  def reset!
4
4
  @in_p, @out_p, @err_p = nil, nil, nil
5
5
  Dir["#{tmp}/{gems/*,*}"].each do |dir|
6
- next if %(base remote1 gems rubygems_1_3_5 rubygems_1_3_6 rubygems_master).include?(File.basename(dir))
6
+ next if %(base remote1 gems rubygems_v1.3.5 rubygems_v1.3.6 rubygems_v1.3.7 rubygems_v1.4.0 rubygems_v1.4.1 rubygems_master).include?(File.basename(dir))
7
7
  unless ENV['BUNDLER_SUDO_TESTS']
8
8
  FileUtils.rm_rf(dir)
9
9
  else
@@ -1,3 +1,5 @@
1
+ require 'rubygems'
2
+
1
3
  class Gem::Platform
2
4
  @local = new(ENV['BUNDLER_SPEC_PLATFORM']) if ENV['BUNDLER_SPEC_PLATFORM']
3
5
  end
@@ -43,6 +43,15 @@ describe "bundle update" do
43
43
  should_be_installed "rack 1.2", "rack-obama 1.0", "activesupport 2.3.5"
44
44
  end
45
45
  end
46
+
47
+ describe "with --local option" do
48
+ it "doesn't hit repo2" do
49
+ FileUtils.rm_rf(gem_repo2)
50
+
51
+ bundle "update --local"
52
+ out.should_not match(/Fetching source index/)
53
+ end
54
+ end
46
55
  end
47
56
 
48
57
  describe "bundle update in more complicated situations" do
metadata CHANGED
@@ -1,23 +1,24 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundler
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 5
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 7
10
- version: 1.0.7
9
+ - 9
10
+ version: 1.0.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Carl Lerche
14
14
  - Yehuda Katz
15
15
  - "Andr\xC3\xA9 Arko"
16
+ - Terence Lee
16
17
  autorequire:
17
18
  bindir: bin
18
19
  cert_chain: []
19
20
 
20
- date: 2010-11-17 00:00:00 -08:00
21
+ date: 2011-01-19 00:00:00 -08:00
21
22
  default_executable: bundle
22
23
  dependencies:
23
24
  - !ruby/object:Gem::Dependency
@@ -188,7 +189,7 @@ files:
188
189
  - spec/support/platforms.rb
189
190
  - spec/support/ruby_ext.rb
190
191
  - spec/support/rubygems_ext.rb
191
- - spec/support/rubygems_hax/rubygems_plugin.rb
192
+ - spec/support/rubygems_hax/platform.rb
192
193
  - spec/support/sudo.rb
193
194
  - spec/update/gems_spec.rb
194
195
  - spec/update/git_spec.rb
@@ -297,7 +298,7 @@ test_files:
297
298
  - spec/support/platforms.rb
298
299
  - spec/support/ruby_ext.rb
299
300
  - spec/support/rubygems_ext.rb
300
- - spec/support/rubygems_hax/rubygems_plugin.rb
301
+ - spec/support/rubygems_hax/platform.rb
301
302
  - spec/support/sudo.rb
302
303
  - spec/update/gems_spec.rb
303
304
  - spec/update/git_spec.rb