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
@@ -35,7 +35,7 @@ module Spec
35
35
  version_const = name == 'bundler' ? 'Bundler::VERSION' : Spec::Builders.constantize(name)
36
36
  run "require '#{name}.rb'; puts #{version_const}", *groups
37
37
  actual_version, actual_platform = out.split(/\s+/)
38
- Gem::Version.new(actual_version).should == Gem::Version.new(version)
38
+ check Gem::Version.new(actual_version).should == Gem::Version.new(version)
39
39
  actual_platform.should == platform
40
40
  end
41
41
  end
data/spec/support/path.rb CHANGED
@@ -31,7 +31,7 @@ module Spec
31
31
  end
32
32
 
33
33
  def vendored_gems(path = nil)
34
- bundled_app("vendor/#{Gem.ruby_engine}/#{Gem::ConfigMap[:ruby_version]}/#{path}")
34
+ bundled_app("vendor/bundle/#{Gem.ruby_engine}/#{Gem::ConfigMap[:ruby_version]}/#{path}")
35
35
  end
36
36
 
37
37
  def cached_gem(path)
@@ -22,8 +22,12 @@ module Spec
22
22
  Gem::Platform.new(['x86', 'mswin32', nil])
23
23
  end
24
24
 
25
+ def mingw
26
+ Gem::Platform.new(['x86', 'mingw32', nil])
27
+ end
28
+
25
29
  def all_platforms
26
- [rb, java, linux, mswin]
30
+ [rb, java, linux, mswin, mingw]
27
31
  end
28
32
 
29
33
  def local
data/spec/support/sudo.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Spec
2
2
  module Sudo
3
3
  def self.present?
4
- @which_sudo ||= `which sudo`.strip
4
+ @which_sudo ||= (`which sudo`.chomp rescue '')
5
5
  !@which_sudo.empty? && ENV['BUNDLER_SUDO_TESTS']
6
6
  end
7
7
 
@@ -84,3 +84,29 @@ describe "bundle update without a Gemfile.lock" do
84
84
  should_be_installed "rack 1.0.0"
85
85
  end
86
86
  end
87
+
88
+ describe "bundle update when a gem depends on a newer version of bundler" do
89
+ before(:each) do
90
+ build_repo2 do
91
+ build_gem "rails", "3.0.1" do |s|
92
+ s.add_dependency "bundler", Bundler::VERSION.succ
93
+ end
94
+ end
95
+
96
+ gemfile <<-G
97
+ source "file://#{gem_repo2}"
98
+ gem "rails", "3.0.1"
99
+ G
100
+ end
101
+
102
+ it "should not explode" do
103
+ bundle "update"
104
+ err.should be_empty
105
+ end
106
+
107
+ it "should explain that bundler conflicted" do
108
+ bundle "update"
109
+ out.should_not =~ /In snapshot/
110
+ out.should =~ /Current Bundler version/
111
+ end
112
+ end
@@ -94,6 +94,29 @@ describe "bundle update" do
94
94
  out.should include("Your bundle is complete!")
95
95
  end
96
96
 
97
+
98
+ it "fetches tags from the remote" do
99
+ build_git "foo"
100
+ @remote = build_git("bar", :bare => true)
101
+ update_git "foo", :remote => @remote.path
102
+ update_git "foo", :push => "master"
103
+
104
+ install_gemfile <<-G
105
+ gem 'foo', :git => "#{@remote.path}"
106
+ G
107
+
108
+ # Create a new tag on the remote that needs fetching
109
+ update_git "foo", :tag => "fubar"
110
+ update_git "foo", :push => "fubar"
111
+
112
+ gemfile <<-G
113
+ gem 'foo', :git => "#{@remote.path}", :tag => "fubar"
114
+ G
115
+
116
+ bundle "update", :exitstatus => true
117
+ exitstatus.should == 0
118
+ end
119
+
97
120
  describe "with submodules" do
98
121
  before :each do
99
122
  build_gem "submodule", :to_system => true do |s|
@@ -122,7 +145,7 @@ describe "bundle update" do
122
145
  G
123
146
 
124
147
  run "require 'submodule'"
125
- out.should == 'GEM'
148
+ check out.should == 'GEM'
126
149
 
127
150
  install_gemfile <<-G
128
151
  git "#{lib_path('has_submodule-1.0')}", :submodules => true do
@@ -143,7 +166,7 @@ describe "bundle update" do
143
166
  G
144
167
 
145
168
  run "require 'submodule'"
146
- out.should == 'GIT'
169
+ check out.should == 'GIT'
147
170
 
148
171
  install_gemfile <<-G
149
172
  git "#{lib_path('has_submodule-1.0')}" do
@@ -47,4 +47,5 @@ describe "bundle update" do
47
47
  should_be_installed "rack 1.0"
48
48
  end
49
49
  end
50
- end
50
+
51
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundler
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 3
10
- version: 1.0.3
9
+ - 5
10
+ version: 1.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Carl Lerche
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2010-10-15 00:00:00 -07:00
20
+ date: 2010-11-13 00:00:00 -06:00
21
21
  default_executable: bundle
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
@@ -156,8 +156,8 @@ files:
156
156
  - spec/install/invalid_spec.rb
157
157
  - spec/install/path_spec.rb
158
158
  - spec/install/upgrade_spec.rb
159
- - spec/lock/flex_spec.rb
160
159
  - spec/lock/git_spec.rb
160
+ - spec/lock/lockfile_spec.rb
161
161
  - spec/other/check_spec.rb
162
162
  - spec/other/config_spec.rb
163
163
  - spec/other/console_spec.rb
@@ -173,7 +173,6 @@ files:
173
173
  - spec/quality_spec.rb
174
174
  - spec/resolver/basic_spec.rb
175
175
  - spec/resolver/platform_spec.rb
176
- - spec/runtime/environment_rb_spec.rb
177
176
  - spec/runtime/executable_spec.rb
178
177
  - spec/runtime/load_spec.rb
179
178
  - spec/runtime/platform_spec.rb
@@ -266,8 +265,8 @@ test_files:
266
265
  - spec/install/invalid_spec.rb
267
266
  - spec/install/path_spec.rb
268
267
  - spec/install/upgrade_spec.rb
269
- - spec/lock/flex_spec.rb
270
268
  - spec/lock/git_spec.rb
269
+ - spec/lock/lockfile_spec.rb
271
270
  - spec/other/check_spec.rb
272
271
  - spec/other/config_spec.rb
273
272
  - spec/other/console_spec.rb
@@ -283,7 +282,6 @@ test_files:
283
282
  - spec/quality_spec.rb
284
283
  - spec/resolver/basic_spec.rb
285
284
  - spec/resolver/platform_spec.rb
286
- - spec/runtime/environment_rb_spec.rb
287
285
  - spec/runtime/executable_spec.rb
288
286
  - spec/runtime/load_spec.rb
289
287
  - spec/runtime/platform_spec.rb
@@ -1,162 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe "environment.rb file" do
4
-
5
- describe "with git gems that don't have gemspecs" do
6
- before :each do
7
- build_git "no-gemspec", :gemspec => false
8
-
9
- install_gemfile <<-G
10
- gem "no-gemspec", "1.0", :git => "#{lib_path('no-gemspec-1.0')}"
11
- G
12
- end
13
-
14
- it "loads the library via a virtual spec" do
15
- run <<-R
16
- require 'no-gemspec'
17
- puts NOGEMSPEC
18
- R
19
-
20
- out.should == "1.0"
21
- end
22
- end
23
-
24
- describe "with bundled and system gems" do
25
- before :each do
26
- system_gems "rack-1.0.0"
27
-
28
- install_gemfile <<-G
29
- source "file://#{gem_repo1}"
30
-
31
- gem "activesupport", "2.3.5"
32
- G
33
- end
34
-
35
- it "does not pull in system gems" do
36
- run <<-R
37
- require 'rubygems'
38
-
39
- begin;
40
- require 'rack'
41
- rescue LoadError
42
- puts 'WIN'
43
- end
44
- R
45
-
46
- out.should == "WIN"
47
- end
48
-
49
- it "provides a gem method" do
50
- run <<-R
51
- gem 'activesupport'
52
- require 'activesupport'
53
- puts ACTIVESUPPORT
54
- R
55
-
56
- out.should == "2.3.5"
57
- end
58
-
59
- it "raises an exception if gem is used to invoke a system gem not in the bundle" do
60
- run <<-R
61
- begin
62
- gem 'rack'
63
- rescue LoadError => e
64
- puts e.message
65
- end
66
- R
67
-
68
- out.should == "rack is not part of the bundle. Add it to Gemfile."
69
- end
70
-
71
- it "sets GEM_HOME appropriately" do
72
- run "puts ENV['GEM_HOME']"
73
- out.should == default_bundle_path.to_s
74
- end
75
- end
76
-
77
- describe "with system gems in the bundle" do
78
- before :each do
79
- system_gems "rack-1.0.0"
80
-
81
- install_gemfile <<-G
82
- source "file://#{gem_repo1}"
83
- gem "rack", "1.0.0"
84
- gem "activesupport", "2.3.5"
85
- G
86
- end
87
-
88
- it "sets GEM_PATH appropriately" do
89
- run "puts Gem.path"
90
- paths = out.split("\n")
91
- paths.should include(system_gem_path.to_s)
92
- paths.should include(default_bundle_path.to_s)
93
- end
94
- end
95
-
96
- describe "with a gemspec that requires other files" do
97
- before :each do
98
- build_git "bar", :gemspec => false do |s|
99
- s.write "lib/bar/version.rb", %{BAR_VERSION = '1.0'}
100
- s.write "bar.gemspec", <<-G
101
- lib = File.expand_path('../lib/', __FILE__)
102
- $:.unshift lib unless $:.include?(lib)
103
- require 'bar/version'
104
-
105
- Gem::Specification.new do |s|
106
- s.name = 'bar'
107
- s.version = BAR_VERSION
108
- s.summary = 'Bar'
109
- s.files = Dir["lib/**/*.rb"]
110
- end
111
- G
112
- end
113
-
114
- gemfile <<-G
115
- gem "bar", :git => "#{lib_path('bar-1.0')}"
116
- G
117
- end
118
-
119
- it "evals each gemspec in the context of its parent directory" do
120
- bundle :install
121
- run "require 'bar'; puts BAR"
122
- out.should == "1.0"
123
- end
124
-
125
- it "error intelligently if the gemspec has a LoadError" do
126
- update_git "bar", :gemspec => false do |s|
127
- s.write "bar.gemspec", "require 'foobarbaz'"
128
- end
129
- bundle :install
130
- out.should include("was a LoadError while evaluating bar.gemspec")
131
- out.should include("foobarbaz")
132
- out.should include("bar.gemspec:1")
133
- out.should include("try to require a relative path") if RUBY_VERSION >= "1.9.0"
134
- end
135
-
136
- it "evals each gemspec with a binding from the top level" do
137
- bundle "install"
138
-
139
- ruby <<-RUBY
140
- require 'bundler'
141
- def Bundler.require(path)
142
- raise "LOSE"
143
- end
144
- Bundler.load
145
- RUBY
146
-
147
- err.should be_empty
148
- out.should be_empty
149
- end
150
- end
151
-
152
- describe "when Bundler is bundled" do
153
- it "doesn't blow up" do
154
- install_gemfile <<-G
155
- gem "bundler", :path => "#{File.expand_path("..", lib)}"
156
- G
157
-
158
- bundle %|exec ruby -e "require 'bundler'; Bundler.setup"|
159
- err.should be_empty
160
- end
161
- end
162
- end