bundler 1.0.3 → 1.0.5

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.

Files changed (64) hide show
  1. data/.gitignore +10 -3
  2. data/CHANGELOG.md +31 -0
  3. data/ISSUES.md +16 -1
  4. data/LICENSE +2 -1
  5. data/Rakefile +39 -13
  6. data/bin/bundle +1 -1
  7. data/lib/bundler.rb +7 -19
  8. data/lib/bundler/capistrano.rb +0 -1
  9. data/lib/bundler/cli.rb +10 -6
  10. data/lib/bundler/definition.rb +23 -9
  11. data/lib/bundler/dependency.rb +7 -2
  12. data/lib/bundler/deployment.rb +25 -9
  13. data/lib/bundler/dsl.rb +3 -2
  14. data/lib/bundler/gem_helper.rb +25 -26
  15. data/lib/bundler/installer.rb +1 -0
  16. data/lib/bundler/resolver.rb +27 -14
  17. data/lib/bundler/rubygems_ext.rb +9 -6
  18. data/lib/bundler/runtime.rb +1 -1
  19. data/lib/bundler/setup.rb +1 -0
  20. data/lib/bundler/shared_helpers.rb +11 -4
  21. data/lib/bundler/source.rb +24 -15
  22. data/lib/bundler/ui.rb +11 -1
  23. data/lib/bundler/version.rb +1 -1
  24. data/lib/bundler/vlad.rb +1 -1
  25. data/man/bundle-exec.ronn +13 -0
  26. data/man/bundle-install.ronn +6 -3
  27. data/man/bundle.ronn +4 -1
  28. data/spec/cache/gems_spec.rb +14 -0
  29. data/spec/cache/git_spec.rb +1 -1
  30. data/spec/install/deploy_spec.rb +23 -4
  31. data/spec/install/gems/flex_spec.rb +41 -0
  32. data/spec/install/gems/groups_spec.rb +1 -1
  33. data/spec/install/gems/platform_spec.rb +4 -21
  34. data/spec/install/gems/simple_case_spec.rb +21 -14
  35. data/spec/install/gems/sudo_spec.rb +2 -2
  36. data/spec/install/gems/win32_spec.rb +1 -1
  37. data/spec/install/git_spec.rb +23 -5
  38. data/spec/install/path_spec.rb +31 -7
  39. data/spec/lock/{flex_spec.rb → lockfile_spec.rb} +33 -0
  40. data/spec/other/check_spec.rb +7 -7
  41. data/spec/other/config_spec.rb +2 -2
  42. data/spec/other/exec_spec.rb +6 -6
  43. data/spec/other/ext_spec.rb +2 -2
  44. data/spec/other/gem_helper_spec.rb +18 -6
  45. data/spec/other/help_spec.rb +1 -1
  46. data/spec/other/init_spec.rb +3 -3
  47. data/spec/quality_spec.rb +3 -0
  48. data/spec/resolver/platform_spec.rb +29 -4
  49. data/spec/runtime/load_spec.rb +47 -42
  50. data/spec/runtime/require_spec.rb +1 -1
  51. data/spec/runtime/setup_spec.rb +168 -2
  52. data/spec/spec_helper.rb +2 -1
  53. data/spec/support/builders.rb +18 -10
  54. data/spec/support/helpers.rb +7 -11
  55. data/spec/support/indexes.rb +3 -4
  56. data/spec/support/matchers.rb +1 -1
  57. data/spec/support/path.rb +1 -1
  58. data/spec/support/platforms.rb +5 -1
  59. data/spec/support/sudo.rb +1 -1
  60. data/spec/update/gems_spec.rb +26 -0
  61. data/spec/update/git_spec.rb +25 -2
  62. data/spec/update/source_spec.rb +2 -1
  63. metadata +6 -8
  64. data/spec/runtime/environment_rb_spec.rb +0 -162
data/lib/bundler/ui.rb CHANGED
@@ -3,6 +3,9 @@ module Bundler
3
3
  def warn(message)
4
4
  end
5
5
 
6
+ def debug(message)
7
+ end
8
+
6
9
  def error(message)
7
10
  end
8
11
 
@@ -13,13 +16,16 @@ module Bundler
13
16
  end
14
17
 
15
18
  class Shell < UI
19
+ attr_writer :shell
20
+
16
21
  def initialize(shell)
17
22
  @shell = shell
18
23
  @quiet = false
24
+ @debug = ENV['DEBUG']
19
25
  end
20
26
 
21
27
  def debug(msg)
22
- @shell.say(msg) if ENV['DEBUG'] && !@quiet
28
+ @shell.say(msg) if @debug && !@quiet
23
29
  end
24
30
 
25
31
  def info(msg)
@@ -41,6 +47,10 @@ module Bundler
41
47
  def be_quiet!
42
48
  @quiet = true
43
49
  end
50
+
51
+ def debug!
52
+ @debug = true
53
+ end
44
54
  end
45
55
 
46
56
  class RGProxy < Gem::SilentUI
@@ -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.3" unless defined?(::Bundler::VERSION)
5
+ VERSION = "1.0.5" unless defined?(::Bundler::VERSION)
6
6
  end
data/lib/bundler/vlad.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # Vlad task for Bundler.
2
2
  #
3
3
  # Just add "require 'bundler/vlad'" in your Vlad deploy.rb, and
4
- # Bundler will be activated after each new deployment.
4
+ # include the vlad:bundle:install task in your vlad:deploy task.
5
5
  require 'bundler/deployment'
6
6
 
7
7
  namespace :vlad do
data/man/bundle-exec.ronn CHANGED
@@ -56,6 +56,19 @@ It also modifies Rubygems:
56
56
  making system executables work
57
57
  * Add all gems in the bundle into Gem.loaded_specs
58
58
 
59
+ ### Shelling out
60
+
61
+ When shelling out (using the `system` or backticks methods,
62
+ for example), Bundler's environment changes will propogate to
63
+ the subshell environment. If you desire to shell out without
64
+ Bundler's environment changes, simply employ the `with_clean_env`
65
+ method. It will restore all environment variables to what they
66
+ were before Bundler was activated. For example:
67
+
68
+ Bundler.with_clean_env do
69
+ `brew install wget`
70
+ end
71
+
59
72
  ## RUBYGEMS PLUGINS
60
73
 
61
74
  At present, the Rubygems plugin system requires all files
@@ -3,9 +3,12 @@ bundle-install(1) -- Install the dependencies specified in your Gemfile
3
3
 
4
4
  ## SYNOPSIS
5
5
 
6
- `bundle install` [--local] [--quiet] [--gemfile=GEMFILE] [--system]
7
- [--deployment] [--frozen] [--path]
8
- [--binstubs[=DIRECTORY]] [--without=GROUP1[ GROUP2...]]
6
+ `bundle install` [--gemfile=GEMFILE]
7
+ [--path PATH] [--system]
8
+ [--without=GROUP1[ GROUP2...]]
9
+ [--local] [--deployment]
10
+ [--binstubs[=DIRECTORY]]
11
+ [--quiet]
9
12
 
10
13
  ## DESCRIPTION
11
14
 
data/man/bundle.ronn CHANGED
@@ -3,7 +3,7 @@ bundle(1) -- Ruby Dependency Management
3
3
 
4
4
  ## SYNOPSIS
5
5
 
6
- `bundle` [--no-color] COMMAND [ARGS]
6
+ `bundle` COMMAND [--no-color] [--verbose] [ARGS]
7
7
 
8
8
  ## DESCRIPTION
9
9
 
@@ -18,6 +18,9 @@ started, and Gemfile(5) for more information on the `Gemfile` format.
18
18
  * `--no-color`:
19
19
  Prints all output without color
20
20
 
21
+ * `--verbose`:
22
+ Prints out additional logging information
23
+
21
24
  ## BUNDLE COMMANDS
22
25
 
23
26
  We divide `bundle` subcommands into primary commands and utilities.
@@ -153,6 +153,20 @@ describe "bundle cache" do
153
153
  cached_gem("activesupport-2.3.2").should_not exist
154
154
  end
155
155
 
156
+ it "removes .gems when gem changes to git source" do
157
+ build_git "rack"
158
+
159
+ install_gemfile <<-G
160
+ source "file://#{gem_repo2}"
161
+ gem "rack", :git => "#{lib_path("rack-1.0")}"
162
+ gem "actionpack"
163
+ G
164
+ cached_gem("rack-1.0.0").should_not exist
165
+ cached_gem("actionpack-2.3.2").should exist
166
+ cached_gem("activesupport-2.3.2").should exist
167
+ end
168
+
169
+
156
170
  it "doesn't remove gems that are for another platform" do
157
171
  simulate_platform "java" do
158
172
  install_gemfile <<-G
@@ -1,7 +1,7 @@
1
1
  require "spec_helper"
2
2
  describe "bundle cache with git" do
3
3
  it "base_name should strip private repo uris" do
4
- source = Bundler::Source::Git.new("uri" => "git@gitthub.com:bundler.git")
4
+ source = Bundler::Source::Git.new("uri" => "git@github.com:bundler.git")
5
5
  source.send(:base_name).should == "bundler"
6
6
  end
7
7
  end
@@ -20,8 +20,8 @@ describe "install with --deployment or --frozen" do
20
20
 
21
21
  it "works after you try to deploy without a lock" do
22
22
  bundle "install --deployment"
23
- bundle :install, :exit_status => true
24
- exitstatus.should == 0
23
+ bundle :install, :exitstatus => true
24
+ check exitstatus.should == 0
25
25
  should_be_installed "rack 1.0"
26
26
  end
27
27
 
@@ -34,18 +34,37 @@ describe "install with --deployment or --frozen" do
34
34
  should_be_installed "rack 1.0"
35
35
  end
36
36
 
37
+ it "works if you exclude a group with a git gem" do
38
+ build_git "foo"
39
+ gemfile <<-G
40
+ group :test do
41
+ gem "foo", :git => "#{lib_path('foo-1.0')}"
42
+ end
43
+ G
44
+ bundle :install
45
+ bundle "install --deployment --without test", :exitstatus => true
46
+ exitstatus.should == 0
47
+ end
48
+
49
+ it "works when you bundle exec bundle" do
50
+ bundle :install
51
+ bundle "install --deployment"
52
+ bundle "exec bundle check", :exitstatus => true
53
+ exitstatus.should == 0
54
+ end
55
+
37
56
  describe "with an existing lockfile" do
38
57
  before do
39
58
  bundle "install"
40
59
  end
41
60
 
42
61
  it "works with the --deployment flag if you didn't change anything" do
43
- bundle "install --deployment", :exit_status => true
62
+ bundle "install --deployment", :exitstatus => true
44
63
  exitstatus.should == 0
45
64
  end
46
65
 
47
66
  it "works with the --frozen flag if you didn't change anything" do
48
- bundle "install --frozen", :exit_status => true
67
+ bundle "install --frozen", :exitstatus => true
49
68
  exitstatus.should == 0
50
69
  end
51
70
 
@@ -269,4 +269,45 @@ describe "bundle flex_install" do
269
269
  L
270
270
  end
271
271
  end
272
+
273
+ # This was written to test github issue #636, but it passed.
274
+ # It's insanoly slow (3.36s) so I'm not going to run it
275
+ # describe "when a locked child dependency conflicts" do
276
+ # before(:each) do
277
+ # build_repo2 do
278
+ # build_gem "capybara", "0.3.9" do |s|
279
+ # s.add_dependency "rack", ">= 1.0.0"
280
+ # end
281
+ #
282
+ # build_gem "rack", "1.1.0"
283
+ # build_gem "rails", "3.0.0.rc4" do |s|
284
+ # s.add_dependency "rack", "~> 1.1.0"
285
+ # end
286
+ #
287
+ # build_gem "rack", "1.2.1"
288
+ # build_gem "rails", "3.0.0" do |s|
289
+ # s.add_dependency "rack", "~> 1.2.1"
290
+ # end
291
+ # end
292
+ # end
293
+ #
294
+ # it "prints the correct error message" do
295
+ # # install Rails 3.0.0.rc
296
+ # install_gemfile <<-G
297
+ # source "file://#{gem_repo2}"
298
+ # gem "rails", "3.0.0.rc4"
299
+ # gem "capybara", "0.3.9"
300
+ # G
301
+ #
302
+ # # upgrade Rails to 3.0.0 and then install again
303
+ # install_gemfile <<-G
304
+ # source "file://#{gem_repo2}"
305
+ # gem "rails", "3.0.0"
306
+ # gem "capybara", "0.3.9"
307
+ # G
308
+ #
309
+ # out.should match(/Gemfile.lock/)
310
+ # end
311
+ # end
312
+
272
313
  end
@@ -38,7 +38,7 @@ describe "bundle install with gem sources" do
38
38
  check out.should == '1.0.0'
39
39
 
40
40
  out = run("require 'activesupport'; puts ACTIVESUPPORT")
41
- out.should == '2.3.5'
41
+ check out.should == '2.3.5'
42
42
 
43
43
  out = run("require 'thin'; puts THIN")
44
44
  out.should == '1.0'
@@ -94,7 +94,7 @@ describe "bundle install across platforms" do
94
94
  gem "rack", "1.0.0"
95
95
  G
96
96
 
97
- bundle "install --path vendor"
97
+ bundle "install --path vendor/bundle"
98
98
 
99
99
  vendored_gems("gems/rack-1.0.0").should exist
100
100
  end
@@ -106,12 +106,12 @@ describe "bundle install across platforms" do
106
106
  gem "rack", "1.0.0"
107
107
  G
108
108
 
109
- bundle "install --path vendor"
109
+ bundle "install --path vendor/bundle"
110
110
 
111
111
  new_version = Gem::ConfigMap[:ruby_version] == "1.8" ? "1.9.1" : "1.8"
112
- FileUtils.mv(vendored_gems, bundled_app("vendor/#{Gem.ruby_engine}/#{new_version}"))
112
+ FileUtils.mv(vendored_gems, bundled_app("vendor/bundle/#{Gem.ruby_engine}/#{new_version}"))
113
113
 
114
- bundle "install ./vendor"
114
+ bundle "install --path ./vendor/bundle"
115
115
  vendored_gems("gems/rack-1.0.0").should exist
116
116
  end
117
117
  end
@@ -132,9 +132,7 @@ describe "bundle install with platform conditionals" do
132
132
  it "does not install gems tagged w/ another platforms" do
133
133
  install_gemfile <<-G
134
134
  source "file://#{gem_repo1}"
135
-
136
135
  gem "rack"
137
-
138
136
  platforms :#{not_local_tag} do
139
137
  gem "nokogiri"
140
138
  end
@@ -144,21 +142,6 @@ describe "bundle install with platform conditionals" do
144
142
  should_not_be_installed "nokogiri 1.4.2"
145
143
  end
146
144
 
147
- it "does not install gems tagged w/ another platform" do
148
- install_gemfile <<-G
149
- source "file://#{gem_repo1}"
150
-
151
- gem "rack"
152
-
153
- platform :#{not_local_tag} do
154
- gem "nokogiri"
155
- end
156
- G
157
-
158
- should_be_installed "rack 1.0"
159
- should_not_be_installed "nokogiri 1.4.2"
160
- end
161
-
162
145
  it "installs gems tagged w/ the current platforms inline" do
163
146
  install_gemfile <<-G
164
147
  source "file://#{gem_repo1}"
@@ -95,7 +95,7 @@ describe "bundle install with gem sources" do
95
95
  end
96
96
 
97
97
  it "raises an appropriate error when gems are specified using symbols" do
98
- status = install_gemfile(<<-G, :exit_status => true)
98
+ status = install_gemfile(<<-G, :exitstatus => true)
99
99
  source "file://#{gem_repo1}"
100
100
  gem :rack
101
101
  G
@@ -251,19 +251,19 @@ describe "bundle install with gem sources" do
251
251
  end
252
252
 
253
253
  it "works" do
254
- bundle "install vendor"
254
+ bundle "install --path vendor"
255
255
  should_be_installed "rack 1.0"
256
256
  end
257
257
 
258
258
  it "allows running bundle install --system without deleting foo" do
259
- bundle "install vendor"
259
+ bundle "install --path vendor"
260
260
  bundle "install --system"
261
261
  FileUtils.rm_rf(bundled_app("vendor"))
262
262
  should_be_installed "rack 1.0"
263
263
  end
264
264
 
265
265
  it "allows running bundle install --system after deleting foo" do
266
- bundle "install vendor"
266
+ bundle "install --path vendor"
267
267
  FileUtils.rm_rf(bundled_app("vendor"))
268
268
  bundle "install --system"
269
269
  should_be_installed "rack 1.0"
@@ -356,7 +356,7 @@ describe "bundle install with gem sources" do
356
356
  [:env, :global].each do |type|
357
357
  it "installs gems to a path if one is specified" do
358
358
  set_bundle_path(type, bundled_app("vendor2").to_s)
359
- bundle "install vendor"
359
+ bundle "install --path vendor/bundle"
360
360
 
361
361
  vendored_gems("gems/rack-1.0.0").should be_directory
362
362
  bundled_app("vendor2").should_not be_directory
@@ -386,7 +386,7 @@ describe "bundle install with gem sources" do
386
386
  end
387
387
 
388
388
  it "installs gems to BUNDLE_PATH from .bundle/config" do
389
- config "BUNDLE_PATH" => bundled_app("vendor").to_s
389
+ config "BUNDLE_PATH" => bundled_app("vendor/bundle").to_s
390
390
 
391
391
  bundle :install
392
392
 
@@ -395,7 +395,7 @@ describe "bundle install with gem sources" do
395
395
  end
396
396
 
397
397
  it "sets BUNDLE_PATH as the first argument to bundle install" do
398
- bundle "install ./vendor"
398
+ bundle "install --path ./vendor/bundle"
399
399
 
400
400
  vendored_gems('gems/rack-1.0.0').should be_directory
401
401
  should_be_installed "rack 1.0.0"
@@ -404,7 +404,7 @@ describe "bundle install with gem sources" do
404
404
  it "disables system gems when passing a path to install" do
405
405
  # This is so that vendored gems can be distributed to others
406
406
  build_gem "rack", "1.1.0", :to_system => true
407
- bundle "install ./vendor"
407
+ bundle "install --path ./vendor/bundle"
408
408
 
409
409
  vendored_gems('gems/rack-1.0.0').should be_directory
410
410
  should_be_installed "rack 1.0.0"
@@ -461,17 +461,24 @@ describe "bundle install with gem sources" do
461
461
  it "behaves like bundle install vendor/bundle with --deployment" do
462
462
  bundle "install"
463
463
  bundle "install --deployment"
464
- out.should include("Your bundle was installed to `vendor/bundle`")
464
+ out.should include("It was installed into ./vendor/bundle")
465
465
  should_be_installed "rack 1.0.0"
466
466
  bundled_app("vendor/bundle").should exist
467
467
  end
468
468
 
469
469
  it "prints a warning if you try to use --disable-shared-gems" do
470
- bundle "install vendor --disable-shared-gems"
470
+ bundle "install --path vendor --disable-shared-gems"
471
471
  out.should include "The disable-shared-gem option is no longer available"
472
472
  end
473
473
 
474
- ["install vendor", "install --path vendor"].each do |install|
474
+ ["install vendor/bundle", "install --path vendor/bundle"].each do |install|
475
+ if install == "install vendor/bundle"
476
+ it "displays the deprecation warning for path as an argument to install" do
477
+ bundle install
478
+ out.should include("The path argument to `bundle install` is deprecated.")
479
+ end
480
+ end
481
+
475
482
  it "does not use available system gems with bundle #{install}" do
476
483
  bundle install
477
484
  should_be_installed "rack 1.0.0"
@@ -479,7 +486,7 @@ describe "bundle install with gem sources" do
479
486
 
480
487
  it "prints a warning to let the user know what has happened with bundle #{install}" do
481
488
  bundle install
482
- out.should include("Your bundle was installed to `vendor`")
489
+ out.should include("It was installed into ./vendor")
483
490
  end
484
491
 
485
492
  it "disallows #{install} --system" do
@@ -594,7 +601,7 @@ describe "bundle install with gem sources" do
594
601
  source "file://#{gem_repo1}"
595
602
  gem "rack"
596
603
  G
597
- should_not_be_installed "bundler 0.9.1"
604
+ should_not_be_installed "bundler #{Bundler::VERSION}"
598
605
  end
599
606
 
600
607
  it "causes a conflict if explicitly requesting a different version" do
@@ -610,7 +617,7 @@ describe "bundle install with gem sources" do
610
617
  In Gemfile:
611
618
  bundler (= 0.9.2)
612
619
 
613
- In snapshot (Gemfile.lock):
620
+ Current Bundler version:
614
621
  bundler (#{Bundler::VERSION})
615
622
  E
616
623
  out.should == nice_error
@@ -17,7 +17,7 @@ describe "when using sudo" do
17
17
  G
18
18
 
19
19
  system_gem_path("gems/rack-1.0.0").should exist
20
- system_gem_path("gems/rack-1.0.0").stat.uid.should == 0
20
+ check system_gem_path("gems/rack-1.0.0").stat.uid.should == 0
21
21
  should_be_installed "rack 1.0"
22
22
  end
23
23
 
@@ -33,7 +33,7 @@ describe "when using sudo" do
33
33
  G
34
34
 
35
35
  bundle_path.join("gems/rack-1.0.0").should exist
36
- bundle_path.join("gems/rack-1.0.0").stat.uid.should == 0
36
+ check bundle_path.join("gems/rack-1.0.0").stat.uid.should == 0
37
37
  should_be_installed "rack 1.0"
38
38
  end
39
39