bundler 1.4.0.rc.1 → 1.5.0.rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of bundler might be problematic. Click here for more details.
- data/.travis.yml +18 -15
- data/CHANGELOG.md +23 -2
- data/Rakefile +3 -1
- data/bundler.gemspec +1 -1
- data/lib/bundler.rb +3 -2
- data/lib/bundler/capistrano.rb +1 -0
- data/lib/bundler/cli.rb +19 -5
- data/lib/bundler/definition.rb +6 -2
- data/lib/bundler/dsl.rb +7 -3
- data/lib/bundler/endpoint_specification.rb +1 -1
- data/lib/bundler/fetcher.rb +22 -41
- data/lib/bundler/installer.rb +1 -11
- data/lib/bundler/lazy_specification.rb +1 -1
- data/lib/bundler/parallel_workers/unix_worker.rb +6 -0
- data/lib/bundler/remote_specification.rb +1 -1
- data/lib/bundler/retry.rb +4 -3
- data/lib/bundler/ruby_version.rb +1 -1
- data/lib/bundler/rubygems_ext.rb +7 -2
- data/lib/bundler/rubygems_integration.rb +31 -30
- data/lib/bundler/settings.rb +21 -0
- data/lib/bundler/source.rb +13 -2
- data/lib/bundler/source/git/git_proxy.rb +1 -1
- data/lib/bundler/source/rubygems.rb +43 -13
- data/lib/bundler/templates/newgem/README.md.tt +1 -1
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +2 -2
- data/lib/bundler/version.rb +1 -1
- data/man/bundle-config.ronn +9 -0
- data/man/bundle-install.ronn +9 -5
- data/man/gemfile.5.ronn +6 -0
- data/spec/bundler/retry_spec.rb +26 -3
- data/spec/commands/config_spec.rb +14 -0
- data/spec/{integration/inject.rb → commands/inject_spec.rb} +0 -0
- data/spec/commands/newgem_spec.rb +2 -2
- data/spec/commands/outdated_spec.rb +17 -0
- data/spec/install/binstubs_spec.rb +24 -0
- data/spec/install/bundler_spec.rb +146 -0
- data/spec/install/{gemspec_spec.rb → gemfile/gemspec_spec.rb} +0 -0
- data/spec/install/{git_spec.rb → gemfile/git_spec.rb} +2 -2
- data/spec/install/gemfile/path_spec.rb +468 -0
- data/spec/install/gemfile_spec.rb +44 -0
- data/spec/install/gems/groups_spec.rb +236 -177
- data/spec/install/gems/mirror_spec.rb +39 -0
- data/spec/install/gems/platform_spec.rb +2 -14
- data/spec/install/gems/simple_case_spec.rb +1 -450
- data/spec/install/gemspecs_spec.rb +50 -0
- data/spec/install/path_spec.rb +91 -409
- data/spec/install/prereleases_spec.rb +43 -0
- data/spec/other/bundle_ruby_spec.rb +2 -2
- data/spec/other/ext_spec.rb +1 -1
- data/spec/other/platform_spec.rb +29 -2
- data/spec/realworld/parallel_install_spec.rb +2 -1
- data/spec/realworld/parallel_update_spec.rb +31 -0
- data/spec/runtime/platform_spec.rb +2 -2
- data/spec/spec_helper.rb +2 -2
- data/spec/support/{rubygems_hax/platform.rb → hax.rb} +0 -0
- metadata +110 -67
- checksums.yaml +0 -7
- data/spec/install/invalid_spec.rb +0 -50
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "bundle install" do
|
4
|
+
|
5
|
+
describe "when a gem has a YAML gemspec" do
|
6
|
+
before :each do
|
7
|
+
build_repo2 do
|
8
|
+
build_gem "yaml_spec", :gemspec => :yaml
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
it "still installs correctly" do
|
13
|
+
gemfile <<-G
|
14
|
+
source "file://#{gem_repo2}"
|
15
|
+
gem "yaml_spec"
|
16
|
+
G
|
17
|
+
bundle :install
|
18
|
+
expect(err).to be_empty
|
19
|
+
end
|
20
|
+
|
21
|
+
it "still installs correctly when using path" do
|
22
|
+
build_lib 'yaml_spec', :gemspec => :yaml
|
23
|
+
|
24
|
+
install_gemfile <<-G
|
25
|
+
gem 'yaml_spec', :path => "#{lib_path('yaml_spec-1.0')}"
|
26
|
+
G
|
27
|
+
expect(err).to eq("")
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should use gemspecs in the system cache when available" do
|
32
|
+
gemfile <<-G
|
33
|
+
source "http://localtestserver.gem"
|
34
|
+
gem 'rack'
|
35
|
+
G
|
36
|
+
|
37
|
+
FileUtils.mkdir_p "#{tmp}/gems/system/specifications"
|
38
|
+
File.open("#{tmp}/gems/system/specifications/rack-1.0.0.gemspec", 'w+') do |f|
|
39
|
+
spec = Gem::Specification.new do |s|
|
40
|
+
s.name = 'rack'
|
41
|
+
s.version = '1.0.0'
|
42
|
+
s.add_runtime_dependency 'activesupport', '2.3.2'
|
43
|
+
end
|
44
|
+
f.write spec.to_ruby
|
45
|
+
end
|
46
|
+
bundle :install, :artifice => 'endpoint_marshal_fail' # force gemspec load
|
47
|
+
should_be_installed "activesupport 2.3.2"
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
data/spec/install/path_spec.rb
CHANGED
@@ -1,468 +1,150 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
describe "bundle install
|
4
|
-
it "fetches gems" do
|
5
|
-
build_lib "foo"
|
3
|
+
describe "bundle install" do
|
6
4
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
should_be_installed("foo 1.0")
|
13
|
-
end
|
14
|
-
|
15
|
-
it "supports pinned paths" do
|
16
|
-
build_lib "foo"
|
17
|
-
|
18
|
-
install_gemfile <<-G
|
19
|
-
gem 'foo', :path => "#{lib_path('foo-1.0')}"
|
20
|
-
G
|
21
|
-
|
22
|
-
should_be_installed("foo 1.0")
|
23
|
-
end
|
24
|
-
|
25
|
-
it "supports relative paths" do
|
26
|
-
build_lib "foo"
|
27
|
-
|
28
|
-
relative_path = lib_path('foo-1.0').relative_path_from(Pathname.new(Dir.pwd))
|
29
|
-
|
30
|
-
install_gemfile <<-G
|
31
|
-
gem 'foo', :path => "#{relative_path}"
|
32
|
-
G
|
33
|
-
|
34
|
-
should_be_installed("foo 1.0")
|
35
|
-
end
|
36
|
-
|
37
|
-
it "expands paths" do
|
38
|
-
build_lib "foo"
|
39
|
-
|
40
|
-
relative_path = lib_path('foo-1.0').relative_path_from(Pathname.new('~').expand_path)
|
41
|
-
|
42
|
-
install_gemfile <<-G
|
43
|
-
gem 'foo', :path => "~/#{relative_path}"
|
44
|
-
G
|
45
|
-
|
46
|
-
should_be_installed("foo 1.0")
|
47
|
-
end
|
48
|
-
|
49
|
-
it "expands paths relative to Bundler.root" do
|
50
|
-
build_lib "foo", :path => bundled_app("foo-1.0")
|
51
|
-
|
52
|
-
install_gemfile <<-G
|
53
|
-
gem 'foo', :path => "./foo-1.0"
|
54
|
-
G
|
55
|
-
|
56
|
-
bundled_app("subdir").mkpath
|
57
|
-
Dir.chdir(bundled_app("subdir")) do
|
58
|
-
should_be_installed("foo 1.0")
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
it "expands paths when comparing locked paths to Gemfile paths" do
|
63
|
-
build_lib "foo", :path => bundled_app("foo-1.0")
|
64
|
-
|
65
|
-
install_gemfile <<-G
|
66
|
-
gem 'foo', :path => File.expand_path("../foo-1.0", __FILE__)
|
67
|
-
G
|
68
|
-
|
69
|
-
bundle "install --frozen", :exitstatus => true
|
70
|
-
expect(exitstatus).to eq(0)
|
71
|
-
end
|
72
|
-
|
73
|
-
it "installs dependencies from the path even if a newer gem is available elsewhere" do
|
74
|
-
system_gems "rack-1.0.0"
|
5
|
+
describe "with --path" do
|
6
|
+
before :each do
|
7
|
+
build_gem "rack", "1.0.0", :to_system => true do |s|
|
8
|
+
s.write "lib/rack.rb", "puts 'FAIL'"
|
9
|
+
end
|
75
10
|
|
76
|
-
|
77
|
-
|
11
|
+
gemfile <<-G
|
12
|
+
source "file://#{gem_repo1}"
|
13
|
+
gem "rack"
|
14
|
+
G
|
78
15
|
end
|
79
16
|
|
80
|
-
|
81
|
-
|
17
|
+
it "does not use available system gems with bundle --path vendor/bundle" do
|
18
|
+
bundle "install --path vendor/bundle"
|
19
|
+
should_be_installed "rack 1.0.0"
|
82
20
|
end
|
83
21
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
G
|
22
|
+
it "handles paths with regex characters in them" do
|
23
|
+
dir = bundled_app("bun++dle")
|
24
|
+
dir.mkpath
|
88
25
|
|
89
|
-
|
90
|
-
|
91
|
-
|
26
|
+
Dir.chdir(dir) do
|
27
|
+
bundle "install --path vendor/bundle"
|
28
|
+
expect(out).to include("installed into ./vendor/bundle")
|
29
|
+
end
|
92
30
|
|
93
|
-
|
94
|
-
build_gem "foo", "1.0.0", :to_system => true do |s|
|
95
|
-
s.write "lib/foo.rb", "puts 'FAIL'"
|
31
|
+
dir.rmtree
|
96
32
|
end
|
97
33
|
|
98
|
-
|
99
|
-
|
34
|
+
it "prints a warning to let the user know what has happened with bundle --path vendor/bundle" do
|
35
|
+
bundle "install --path vendor/bundle"
|
36
|
+
expect(out).to include("It was installed into ./vendor")
|
100
37
|
end
|
101
38
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
gem "omg", :path => "#{lib_path('omg')}"
|
106
|
-
G
|
107
|
-
|
108
|
-
should_be_installed "foo 1.0"
|
109
|
-
end
|
110
|
-
|
111
|
-
it "supports gemspec syntax" do
|
112
|
-
build_lib "foo", "1.0", :path => lib_path("foo") do |s|
|
113
|
-
s.add_dependency "rack", "1.0"
|
39
|
+
it "disallows --path vendor/bundle --system" do
|
40
|
+
bundle "install --path vendor/bundle --system"
|
41
|
+
expect(out).to include("Please choose.")
|
114
42
|
end
|
115
43
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
G
|
120
|
-
|
121
|
-
File.open(lib_path("foo/Gemfile"), "w") {|f| f.puts gemfile }
|
122
|
-
|
123
|
-
Dir.chdir(lib_path("foo")) do
|
44
|
+
it "remembers to disable system gems after the first time with bundle --path vendor/bundle" do
|
45
|
+
bundle "install --path vendor/bundle"
|
46
|
+
FileUtils.rm_rf bundled_app('vendor')
|
124
47
|
bundle "install"
|
125
|
-
should_be_installed "foo 1.0"
|
126
|
-
should_be_installed "rack 1.0"
|
127
|
-
end
|
128
|
-
end
|
129
|
-
|
130
|
-
it "supports gemspec syntax with an alternative path" do
|
131
|
-
build_lib "foo", "1.0", :path => lib_path("foo") do |s|
|
132
|
-
s.add_dependency "rack", "1.0"
|
133
|
-
end
|
134
|
-
|
135
|
-
install_gemfile <<-G
|
136
|
-
source "file://#{gem_repo1}"
|
137
|
-
gemspec :path => "#{lib_path("foo")}"
|
138
|
-
G
|
139
|
-
|
140
|
-
should_be_installed "foo 1.0"
|
141
|
-
should_be_installed "rack 1.0"
|
142
|
-
end
|
143
|
-
|
144
|
-
it "doesn't automatically unlock dependencies when using the gemspec syntax" do
|
145
|
-
build_lib "foo", "1.0", :path => lib_path("foo") do |s|
|
146
|
-
s.add_dependency "rack", ">= 1.0"
|
147
|
-
end
|
148
|
-
|
149
|
-
Dir.chdir lib_path("foo")
|
150
|
-
|
151
|
-
install_gemfile lib_path("foo/Gemfile"), <<-G
|
152
|
-
source "file://#{gem_repo1}"
|
153
|
-
gemspec
|
154
|
-
G
|
155
|
-
|
156
|
-
build_gem "rack", "1.0.1", :to_system => true
|
157
|
-
|
158
|
-
bundle "install"
|
159
|
-
|
160
|
-
should_be_installed "foo 1.0"
|
161
|
-
should_be_installed "rack 1.0"
|
162
|
-
end
|
163
|
-
|
164
|
-
it "doesn't automatically unlock dependencies when using the gemspec syntax and the gem has development dependencies" do
|
165
|
-
build_lib "foo", "1.0", :path => lib_path("foo") do |s|
|
166
|
-
s.add_dependency "rack", ">= 1.0"
|
167
|
-
s.add_development_dependency "activesupport"
|
168
|
-
end
|
169
|
-
|
170
|
-
Dir.chdir lib_path("foo")
|
171
|
-
|
172
|
-
install_gemfile lib_path("foo/Gemfile"), <<-G
|
173
|
-
source "file://#{gem_repo1}"
|
174
|
-
gemspec
|
175
|
-
G
|
176
|
-
|
177
|
-
build_gem "rack", "1.0.1", :to_system => true
|
178
|
-
|
179
|
-
bundle "install"
|
180
|
-
|
181
|
-
should_be_installed "foo 1.0"
|
182
|
-
should_be_installed "rack 1.0"
|
183
|
-
end
|
184
|
-
|
185
|
-
it "raises if there are multiple gemspecs" do
|
186
|
-
build_lib "foo", "1.0", :path => lib_path("foo") do |s|
|
187
|
-
s.write "bar.gemspec"
|
188
|
-
end
|
189
|
-
|
190
|
-
install_gemfile <<-G, :exitstatus => true
|
191
|
-
gemspec :path => "#{lib_path("foo")}"
|
192
|
-
G
|
193
|
-
|
194
|
-
expect(exitstatus).to eq(15)
|
195
|
-
expect(out).to match(/There are multiple gemspecs/)
|
196
|
-
end
|
197
|
-
|
198
|
-
it "allows :name to be specified to resolve ambiguity" do
|
199
|
-
build_lib "foo", "1.0", :path => lib_path("foo") do |s|
|
200
|
-
s.write "bar.gemspec"
|
201
|
-
end
|
202
|
-
|
203
|
-
install_gemfile <<-G, :exitstatus => true
|
204
|
-
gemspec :path => "#{lib_path("foo")}", :name => "foo"
|
205
|
-
G
|
206
|
-
|
207
|
-
should_be_installed "foo 1.0"
|
208
|
-
end
|
209
|
-
|
210
|
-
it "sets up executables" do
|
211
|
-
pending_jruby_shebang_fix
|
212
|
-
|
213
|
-
build_lib "foo" do |s|
|
214
|
-
s.executables = "foobar"
|
215
|
-
end
|
216
|
-
|
217
|
-
install_gemfile <<-G
|
218
|
-
path "#{lib_path('foo-1.0')}"
|
219
|
-
gem 'foo'
|
220
|
-
G
|
221
|
-
|
222
|
-
bundle "exec foobar"
|
223
|
-
expect(out).to eq("1.0")
|
224
|
-
end
|
225
48
|
|
226
|
-
|
227
|
-
|
228
|
-
lib_path("foo-1.0").join("foo.gemspec").rmtree
|
229
|
-
lib_path("foo-1.0").join("bin/performance").mkpath
|
230
|
-
|
231
|
-
install_gemfile <<-G
|
232
|
-
gem 'foo', '1.0', :path => "#{lib_path('foo-1.0')}"
|
233
|
-
G
|
234
|
-
expect(err).to eq("")
|
235
|
-
end
|
236
|
-
|
237
|
-
it "removes the .gem file after installing" do
|
238
|
-
build_lib "foo"
|
239
|
-
|
240
|
-
install_gemfile <<-G
|
241
|
-
gem 'foo', :path => "#{lib_path('foo-1.0')}"
|
242
|
-
G
|
243
|
-
|
244
|
-
expect(lib_path('foo-1.0').join('foo-1.0.gem')).not_to exist
|
245
|
-
end
|
246
|
-
|
247
|
-
describe "block syntax" do
|
248
|
-
it "pulls all gems from a path block" do
|
249
|
-
build_lib "omg"
|
250
|
-
build_lib "hi2u"
|
251
|
-
|
252
|
-
install_gemfile <<-G
|
253
|
-
path "#{lib_path}" do
|
254
|
-
gem "omg"
|
255
|
-
gem "hi2u"
|
256
|
-
end
|
257
|
-
G
|
258
|
-
|
259
|
-
should_be_installed "omg 1.0", "hi2u 1.0"
|
260
|
-
end
|
261
|
-
end
|
262
|
-
|
263
|
-
it "keeps source pinning" do
|
264
|
-
build_lib "foo", "1.0", :path => lib_path('foo')
|
265
|
-
build_lib "omg", "1.0", :path => lib_path('omg')
|
266
|
-
build_lib "foo", "1.0", :path => lib_path('omg/foo') do |s|
|
267
|
-
s.write "lib/foo.rb", "puts 'FAIL'"
|
268
|
-
end
|
269
|
-
|
270
|
-
install_gemfile <<-G
|
271
|
-
gem "foo", :path => "#{lib_path('foo')}"
|
272
|
-
gem "omg", :path => "#{lib_path('omg')}"
|
273
|
-
G
|
274
|
-
|
275
|
-
should_be_installed "foo 1.0"
|
276
|
-
end
|
277
|
-
|
278
|
-
it "works when the path does not have a gemspec" do
|
279
|
-
build_lib "foo", :gemspec => false
|
280
|
-
|
281
|
-
gemfile <<-G
|
282
|
-
gem "foo", "1.0", :path => "#{lib_path('foo-1.0')}"
|
283
|
-
G
|
284
|
-
|
285
|
-
should_be_installed "foo 1.0"
|
286
|
-
|
287
|
-
should_be_installed "foo 1.0"
|
288
|
-
end
|
289
|
-
|
290
|
-
it "installs executable stubs" do
|
291
|
-
build_lib "foo" do |s|
|
292
|
-
s.executables = ['foo']
|
49
|
+
expect(vendored_gems('gems/rack-1.0.0')).to be_directory
|
50
|
+
should_be_installed "rack 1.0.0"
|
293
51
|
end
|
294
|
-
|
295
|
-
install_gemfile <<-G
|
296
|
-
gem "foo", :path => "#{lib_path('foo-1.0')}"
|
297
|
-
G
|
298
|
-
|
299
|
-
bundle "exec foo"
|
300
|
-
expect(out).to eq("1.0")
|
301
52
|
end
|
302
53
|
|
303
|
-
describe "when
|
54
|
+
describe "when BUNDLE_PATH or the global path config is set" do
|
304
55
|
before :each do
|
305
|
-
build_lib "
|
306
|
-
s.
|
56
|
+
build_lib "rack", "1.0.0", :to_system => true do |s|
|
57
|
+
s.write "lib/rack.rb", "raise 'FAIL'"
|
307
58
|
end
|
308
|
-
build_lib "bar", "1.0", :path => lib_path("foo/bar")
|
309
59
|
|
310
|
-
|
311
|
-
|
60
|
+
gemfile <<-G
|
61
|
+
source "file://#{gem_repo1}"
|
62
|
+
gem "rack"
|
312
63
|
G
|
313
64
|
end
|
314
65
|
|
315
|
-
|
316
|
-
|
317
|
-
|
66
|
+
def set_bundle_path(type, location)
|
67
|
+
if type == :env
|
68
|
+
ENV["BUNDLE_PATH"] = location
|
69
|
+
elsif type == :global
|
70
|
+
bundle "config path #{location}", "no-color" => nil
|
318
71
|
end
|
319
|
-
|
320
|
-
bundle "install"
|
321
|
-
|
322
|
-
should_be_installed "foo 2.0", "bar 1.0"
|
323
72
|
end
|
324
73
|
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
should_be_installed "foo 1.0", "bar 2.0"
|
331
|
-
end
|
332
|
-
end
|
333
|
-
|
334
|
-
describe "when dependencies in the path are updated" do
|
335
|
-
before :each do
|
336
|
-
build_lib "foo", "1.0", :path => lib_path("foo")
|
337
|
-
|
338
|
-
install_gemfile <<-G
|
339
|
-
source "file://#{gem_repo1}"
|
340
|
-
gem "foo", :path => "#{lib_path('foo')}"
|
341
|
-
G
|
342
|
-
end
|
74
|
+
[:env, :global].each do |type|
|
75
|
+
it "installs gems to a path if one is specified" do
|
76
|
+
set_bundle_path(type, bundled_app("vendor2").to_s)
|
77
|
+
bundle "install --path vendor/bundle"
|
343
78
|
|
344
|
-
|
345
|
-
|
346
|
-
|
79
|
+
expect(vendored_gems("gems/rack-1.0.0")).to be_directory
|
80
|
+
expect(bundled_app("vendor2")).not_to be_directory
|
81
|
+
should_be_installed "rack 1.0.0"
|
347
82
|
end
|
348
83
|
|
349
|
-
|
84
|
+
it "installs gems to BUNDLE_PATH with #{type}" do
|
85
|
+
set_bundle_path(type, bundled_app("vendor").to_s)
|
350
86
|
|
351
|
-
|
352
|
-
end
|
353
|
-
end
|
87
|
+
bundle :install
|
354
88
|
|
355
|
-
|
356
|
-
|
357
|
-
build_gem "foo", "1.0", :to_system => true do |s|
|
358
|
-
s.write "lib/foo.rb", "raise 'fail'"
|
359
|
-
end
|
360
|
-
build_lib "foo", "1.0", :path => lib_path('bar/foo')
|
361
|
-
build_git "bar", "1.0", :path => lib_path('bar') do |s|
|
362
|
-
s.add_dependency 'foo'
|
89
|
+
expect(bundled_app('vendor/gems/rack-1.0.0')).to be_directory
|
90
|
+
should_be_installed "rack 1.0.0"
|
363
91
|
end
|
364
92
|
|
365
|
-
|
366
|
-
|
367
|
-
gem "bar", :git => "#{lib_path('bar')}"
|
368
|
-
G
|
93
|
+
it "installs gems to BUNDLE_PATH relative to root when relative" do
|
94
|
+
set_bundle_path(type, "vendor")
|
369
95
|
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
96
|
+
FileUtils.mkdir_p bundled_app('lol')
|
97
|
+
Dir.chdir(bundled_app('lol')) do
|
98
|
+
bundle :install
|
99
|
+
end
|
374
100
|
|
375
|
-
|
101
|
+
expect(bundled_app('vendor/gems/rack-1.0.0')).to be_directory
|
102
|
+
should_be_installed "rack 1.0.0"
|
103
|
+
end
|
376
104
|
end
|
377
105
|
|
378
|
-
it "
|
379
|
-
|
380
|
-
build_gem "bar", "1.0", :to_system => true do |s|
|
381
|
-
s.write "lib/bar.rb", "raise 'fail'"
|
382
|
-
end
|
106
|
+
it "installs gems to BUNDLE_PATH from .bundle/config" do
|
107
|
+
config "BUNDLE_PATH" => bundled_app("vendor/bundle").to_s
|
383
108
|
|
384
|
-
|
385
|
-
source "file://#{gem_repo1}"
|
386
|
-
gem "bar"
|
387
|
-
path "#{lib_path('foo')}" do
|
388
|
-
gem "foo"
|
389
|
-
end
|
390
|
-
G
|
109
|
+
bundle :install
|
391
110
|
|
392
|
-
|
111
|
+
expect(vendored_gems('gems/rack-1.0.0')).to be_directory
|
112
|
+
should_be_installed "rack 1.0.0"
|
113
|
+
end
|
393
114
|
|
394
|
-
|
395
|
-
|
396
|
-
path "#{lib_path('foo')}" do
|
397
|
-
gem "foo"
|
398
|
-
gem "bar"
|
399
|
-
end
|
400
|
-
G
|
115
|
+
it "sets BUNDLE_PATH as the first argument to bundle install" do
|
116
|
+
bundle "install --path ./vendor/bundle"
|
401
117
|
|
402
|
-
|
118
|
+
expect(vendored_gems('gems/rack-1.0.0')).to be_directory
|
119
|
+
should_be_installed "rack 1.0.0"
|
403
120
|
end
|
404
|
-
end
|
405
121
|
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
gem "foo", :git => "#{lib_path('foo-1.0')}"
|
411
|
-
G
|
412
|
-
|
413
|
-
File.open(lib_path("install_hooks.rb"), "w") do |h|
|
414
|
-
h.write <<-H
|
415
|
-
require 'rubygems'
|
416
|
-
Gem.pre_install_hooks << lambda do |inst|
|
417
|
-
STDERR.puts "Ran pre-install hook: \#{inst.spec.full_name}"
|
418
|
-
end
|
419
|
-
H
|
420
|
-
end
|
122
|
+
it "disables system gems when passing a path to install" do
|
123
|
+
# This is so that vendored gems can be distributed to others
|
124
|
+
build_gem "rack", "1.1.0", :to_system => true
|
125
|
+
bundle "install --path ./vendor/bundle"
|
421
126
|
|
422
|
-
|
423
|
-
|
424
|
-
expect(err).to eq("Ran pre-install hook: foo-1.0")
|
127
|
+
expect(vendored_gems('gems/rack-1.0.0')).to be_directory
|
128
|
+
should_be_installed "rack 1.0.0"
|
425
129
|
end
|
130
|
+
end
|
426
131
|
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
G
|
432
|
-
|
433
|
-
File.open(lib_path("install_hooks.rb"), "w") do |h|
|
434
|
-
h.write <<-H
|
435
|
-
require 'rubygems'
|
436
|
-
Gem.post_install_hooks << lambda do |inst|
|
437
|
-
STDERR.puts "Ran post-install hook: \#{inst.spec.full_name}"
|
438
|
-
end
|
439
|
-
H
|
132
|
+
describe "to a dead symlink" do
|
133
|
+
before do
|
134
|
+
in_app_root do
|
135
|
+
`ln -s /tmp/idontexist bundle`
|
440
136
|
end
|
441
|
-
|
442
|
-
bundle :install, :expect_err => true,
|
443
|
-
:requires => [lib_path('install_hooks.rb')]
|
444
|
-
expect(err).to eq("Ran post-install hook: foo-1.0")
|
445
137
|
end
|
446
138
|
|
447
|
-
it "
|
448
|
-
build_git "foo"
|
139
|
+
it "reports the symlink is dead" do
|
449
140
|
gemfile <<-G
|
450
|
-
|
141
|
+
source "file://#{gem_repo1}"
|
142
|
+
gem "rack"
|
451
143
|
G
|
452
144
|
|
453
|
-
|
454
|
-
|
455
|
-
require 'rubygems'
|
456
|
-
Gem.pre_install_hooks << lambda do |inst|
|
457
|
-
false
|
458
|
-
end
|
459
|
-
H
|
460
|
-
end
|
461
|
-
|
462
|
-
bundle :install, :expect_err => true,
|
463
|
-
:requires => [lib_path('install_hooks.rb')]
|
464
|
-
expect(out).to include("failed for foo-1.0")
|
145
|
+
bundle "install --path bundle"
|
146
|
+
expect(out).to match(/invalid symlink/)
|
465
147
|
end
|
466
148
|
end
|
467
149
|
|
468
|
-
end
|
150
|
+
end
|