bundler 1.7.15 → 1.8.0.pre
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.
- checksums.yaml +4 -4
- data/.gitignore +5 -14
- data/.rspec +1 -0
- data/.travis.yml +22 -15
- data/CHANGELOG.md +43 -13
- data/CODE_OF_CONDUCT.md +40 -0
- data/CONTRIBUTING.md +14 -12
- data/DEVELOPMENT.md +4 -2
- data/ISSUES.md +1 -1
- data/README.md +10 -14
- data/Rakefile +10 -10
- data/bin/bundle +1 -1
- data/bundler.gemspec +5 -4
- data/lib/bundler.rb +22 -3
- data/lib/bundler/anonymizable_uri.rb +24 -8
- data/lib/bundler/cli.rb +103 -66
- data/lib/bundler/cli/cache.rb +1 -0
- data/lib/bundler/cli/clean.rb +11 -4
- data/lib/bundler/cli/common.rb +2 -0
- data/lib/bundler/cli/console.rb +22 -26
- data/lib/bundler/cli/exec.rb +29 -22
- data/lib/bundler/cli/gem.rb +125 -37
- data/lib/bundler/cli/install.rb +22 -9
- data/lib/bundler/cli/outdated.rb +1 -1
- data/lib/bundler/cli/package.rb +8 -1
- data/lib/bundler/cli/show.rb +29 -3
- data/lib/bundler/cli/update.rb +2 -2
- data/lib/bundler/cli/viz.rb +1 -1
- data/lib/bundler/definition.rb +14 -22
- data/lib/bundler/dependency.rb +8 -1
- data/lib/bundler/dsl.rb +17 -4
- data/lib/bundler/endpoint_specification.rb +1 -1
- data/lib/bundler/env.rb +44 -25
- data/lib/bundler/fetcher.rb +33 -25
- data/lib/bundler/friendly_errors.rb +38 -5
- data/lib/bundler/gem_helper.rb +16 -10
- data/lib/bundler/gem_helpers.rb +1 -0
- data/lib/bundler/graph.rb +4 -1
- data/lib/bundler/index.rb +15 -25
- data/lib/bundler/installer.rb +6 -6
- data/lib/bundler/lockfile_parser.rb +7 -7
- data/lib/bundler/resolver.rb +2 -1
- data/lib/bundler/ruby_version.rb +1 -1
- data/lib/bundler/rubygems_ext.rb +1 -0
- data/lib/bundler/rubygems_integration.rb +1 -1
- data/lib/bundler/runtime.rb +22 -40
- data/lib/bundler/settings.rb +14 -5
- data/lib/bundler/setup.rb +2 -1
- data/lib/bundler/shared_helpers.rb +56 -4
- data/lib/bundler/source.rb +8 -9
- data/lib/bundler/source/git.rb +5 -1
- data/lib/bundler/source/git/git_proxy.rb +4 -0
- data/lib/bundler/source/path.rb +8 -11
- data/lib/bundler/source/path/installer.rb +0 -2
- data/lib/bundler/source/rubygems.rb +58 -72
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +13 -0
- data/lib/bundler/templates/newgem/LICENSE.txt.tt +17 -18
- data/lib/bundler/templates/newgem/README.md.tt +9 -1
- data/lib/bundler/templates/newgem/Rakefile.tt +2 -0
- data/lib/bundler/templates/newgem/bin/console.tt +14 -0
- data/lib/bundler/templates/newgem/bin/setup.tt +7 -0
- data/lib/bundler/templates/newgem/exe/newgem.tt +3 -0
- data/lib/bundler/templates/newgem/gitignore.tt +2 -0
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +1 -1
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +17 -13
- data/lib/bundler/templates/newgem/test/test_newgem.rb.tt +1 -1
- data/lib/bundler/ui/shell.rb +1 -1
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/worker.rb +73 -0
- data/man/bundle-config.ronn +17 -15
- data/man/bundle-install.ronn +102 -93
- data/man/bundle-update.ronn +39 -30
- data/man/bundle.ronn +6 -0
- data/man/gemfile.5.ronn +74 -13
- metadata +10 -231
- data/lib/bundler/parallel_workers.rb +0 -18
- data/lib/bundler/parallel_workers/thread_worker.rb +0 -30
- data/lib/bundler/parallel_workers/unix_worker.rb +0 -101
- data/lib/bundler/parallel_workers/worker.rb +0 -69
- data/lib/bundler/templates/newgem/bin/newgem.tt +0 -3
- data/spec/bundler/anonymizable_uri_spec.rb +0 -32
- data/spec/bundler/bundler_spec.rb +0 -72
- data/spec/bundler/cli_spec.rb +0 -16
- data/spec/bundler/definition_spec.rb +0 -22
- data/spec/bundler/dsl_spec.rb +0 -82
- data/spec/bundler/friendly_errors_spec.rb +0 -13
- data/spec/bundler/gem_helper_spec.rb +0 -226
- data/spec/bundler/psyched_yaml_spec.rb +0 -8
- data/spec/bundler/retry_spec.rb +0 -59
- data/spec/bundler/settings_spec.rb +0 -13
- data/spec/bundler/source/rubygems_spec.rb +0 -25
- data/spec/bundler/source_list_spec.rb +0 -361
- data/spec/cache/gems_spec.rb +0 -284
- data/spec/cache/git_spec.rb +0 -188
- data/spec/cache/path_spec.rb +0 -121
- data/spec/cache/platform_spec.rb +0 -57
- data/spec/commands/binstubs_spec.rb +0 -219
- data/spec/commands/check_spec.rb +0 -278
- data/spec/commands/clean_spec.rb +0 -592
- data/spec/commands/config_spec.rb +0 -263
- data/spec/commands/console_spec.rb +0 -76
- data/spec/commands/exec_spec.rb +0 -309
- data/spec/commands/help_spec.rb +0 -39
- data/spec/commands/init_spec.rb +0 -39
- data/spec/commands/inject_spec.rb +0 -78
- data/spec/commands/licenses_spec.rb +0 -18
- data/spec/commands/newgem_spec.rb +0 -428
- data/spec/commands/open_spec.rb +0 -68
- data/spec/commands/outdated_spec.rb +0 -156
- data/spec/commands/package_spec.rb +0 -114
- data/spec/commands/show_spec.rb +0 -125
- data/spec/install/binstubs_spec.rb +0 -24
- data/spec/install/bundler_spec.rb +0 -146
- data/spec/install/deploy_spec.rb +0 -250
- data/spec/install/gemfile/gemspec_spec.rb +0 -170
- data/spec/install/gemfile/git_spec.rb +0 -967
- data/spec/install/gemfile/path_spec.rb +0 -500
- data/spec/install/gemfile_spec.rb +0 -44
- data/spec/install/gems/c_ext_spec.rb +0 -48
- data/spec/install/gems/dependency_api_spec.rb +0 -652
- data/spec/install/gems/env_spec.rb +0 -107
- data/spec/install/gems/flex_spec.rb +0 -314
- data/spec/install/gems/groups_spec.rb +0 -308
- data/spec/install/gems/mirror_spec.rb +0 -39
- data/spec/install/gems/platform_spec.rb +0 -195
- data/spec/install/gems/post_install_spec.rb +0 -121
- data/spec/install/gems/resolving_spec.rb +0 -124
- data/spec/install/gems/simple_case_spec.rb +0 -377
- data/spec/install/gems/sources_spec.rb +0 -386
- data/spec/install/gems/standalone_spec.rb +0 -260
- data/spec/install/gems/sudo_spec.rb +0 -136
- data/spec/install/gems/win32_spec.rb +0 -26
- data/spec/install/gemspecs_spec.rb +0 -50
- data/spec/install/path_spec.rb +0 -150
- data/spec/install/post_bundle_message_spec.rb +0 -142
- data/spec/install/prereleases_spec.rb +0 -43
- data/spec/install/security_policy_spec.rb +0 -77
- data/spec/install/upgrade_spec.rb +0 -26
- data/spec/lock/git_spec.rb +0 -34
- data/spec/lock/lockfile_spec.rb +0 -924
- data/spec/other/bundle_ruby_spec.rb +0 -142
- data/spec/other/cli_dispatch_spec.rb +0 -21
- data/spec/other/ext_spec.rb +0 -60
- data/spec/other/platform_spec.rb +0 -1285
- data/spec/other/ssl_cert_spec.rb +0 -23
- data/spec/quality_spec.rb +0 -88
- data/spec/realworld/dependency_api_spec.rb +0 -60
- data/spec/realworld/edgecases_spec.rb +0 -212
- data/spec/realworld/parallel_spec.rb +0 -71
- data/spec/resolver/basic_spec.rb +0 -66
- data/spec/resolver/platform_spec.rb +0 -88
- data/spec/runtime/executable_spec.rb +0 -149
- data/spec/runtime/load_spec.rb +0 -107
- data/spec/runtime/platform_spec.rb +0 -90
- data/spec/runtime/require_spec.rb +0 -332
- data/spec/runtime/setup_spec.rb +0 -853
- data/spec/runtime/with_clean_env_spec.rb +0 -91
- data/spec/spec_helper.rb +0 -123
- data/spec/support/artifice/endopint_marshal_fail_basic_authentication.rb +0 -13
- data/spec/support/artifice/endpoint.rb +0 -71
- data/spec/support/artifice/endpoint_500.rb +0 -37
- data/spec/support/artifice/endpoint_api_forbidden.rb +0 -11
- data/spec/support/artifice/endpoint_api_missing.rb +0 -16
- data/spec/support/artifice/endpoint_basic_authentication.rb +0 -13
- data/spec/support/artifice/endpoint_creds_diff_host.rb +0 -38
- data/spec/support/artifice/endpoint_extra.rb +0 -31
- data/spec/support/artifice/endpoint_extra_api.rb +0 -32
- data/spec/support/artifice/endpoint_extra_missing.rb +0 -15
- data/spec/support/artifice/endpoint_fallback.rb +0 -17
- data/spec/support/artifice/endpoint_host_redirect.rb +0 -15
- data/spec/support/artifice/endpoint_marshal_fail.rb +0 -11
- data/spec/support/artifice/endpoint_redirect.rb +0 -15
- data/spec/support/artifice/endpoint_strict_basic_authentication.rb +0 -18
- data/spec/support/artifice/endpoint_timeout.rb +0 -13
- data/spec/support/builders.rb +0 -693
- data/spec/support/fakeweb/rack-1.0.0.marshal +0 -2
- data/spec/support/fakeweb/windows.rb +0 -23
- data/spec/support/hax.rb +0 -22
- data/spec/support/helpers.rb +0 -361
- data/spec/support/indexes.rb +0 -280
- data/spec/support/matchers.rb +0 -77
- data/spec/support/path.rb +0 -85
- data/spec/support/permissions.rb +0 -10
- data/spec/support/platforms.rb +0 -94
- data/spec/support/ruby_ext.rb +0 -20
- data/spec/support/rubygems_ext.rb +0 -39
- data/spec/support/streams.rb +0 -13
- data/spec/support/sudo.rb +0 -16
- data/spec/update/gems_spec.rb +0 -201
- data/spec/update/git_spec.rb +0 -283
- data/spec/update/path_spec.rb +0 -18
data/spec/lock/lockfile_spec.rb
DELETED
@@ -1,924 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe "the lockfile format" do
|
4
|
-
include Bundler::GemHelpers
|
5
|
-
|
6
|
-
it "generates a simple lockfile for a single source, gem" do
|
7
|
-
install_gemfile <<-G
|
8
|
-
source "file://#{gem_repo1}"
|
9
|
-
|
10
|
-
gem "rack"
|
11
|
-
G
|
12
|
-
|
13
|
-
lockfile_should_be <<-G
|
14
|
-
GEM
|
15
|
-
remote: file:#{gem_repo1}/
|
16
|
-
specs:
|
17
|
-
rack (1.0.0)
|
18
|
-
|
19
|
-
PLATFORMS
|
20
|
-
#{generic(Gem::Platform.local)}
|
21
|
-
|
22
|
-
DEPENDENCIES
|
23
|
-
rack
|
24
|
-
G
|
25
|
-
end
|
26
|
-
|
27
|
-
it "generates a simple lockfile for a single source, gem with dependencies" do
|
28
|
-
install_gemfile <<-G
|
29
|
-
source "file://#{gem_repo1}"
|
30
|
-
|
31
|
-
gem "rack-obama"
|
32
|
-
G
|
33
|
-
|
34
|
-
lockfile_should_be <<-G
|
35
|
-
GEM
|
36
|
-
remote: file:#{gem_repo1}/
|
37
|
-
specs:
|
38
|
-
rack (1.0.0)
|
39
|
-
rack-obama (1.0)
|
40
|
-
rack
|
41
|
-
|
42
|
-
PLATFORMS
|
43
|
-
#{generic(Gem::Platform.local)}
|
44
|
-
|
45
|
-
DEPENDENCIES
|
46
|
-
rack-obama
|
47
|
-
G
|
48
|
-
end
|
49
|
-
|
50
|
-
it "generates a simple lockfile for a single source, gem with a version requirement" do
|
51
|
-
install_gemfile <<-G
|
52
|
-
source "file://#{gem_repo1}"
|
53
|
-
|
54
|
-
gem "rack-obama", ">= 1.0"
|
55
|
-
G
|
56
|
-
|
57
|
-
lockfile_should_be <<-G
|
58
|
-
GEM
|
59
|
-
remote: file:#{gem_repo1}/
|
60
|
-
specs:
|
61
|
-
rack (1.0.0)
|
62
|
-
rack-obama (1.0)
|
63
|
-
rack
|
64
|
-
|
65
|
-
PLATFORMS
|
66
|
-
#{generic(Gem::Platform.local)}
|
67
|
-
|
68
|
-
DEPENDENCIES
|
69
|
-
rack-obama (>= 1.0)
|
70
|
-
G
|
71
|
-
end
|
72
|
-
|
73
|
-
it "generates a lockfile wihout credentials for a configured source" do
|
74
|
-
bundle "config http://localgemserver.test/ user:pass"
|
75
|
-
|
76
|
-
install_gemfile(<<-G, :artifice => "endpoint_strict_basic_authentication", :quiet => true)
|
77
|
-
source "http://localgemserver.test/"
|
78
|
-
|
79
|
-
gem "rack-obama", ">= 1.0"
|
80
|
-
G
|
81
|
-
|
82
|
-
lockfile_should_be <<-G
|
83
|
-
GEM
|
84
|
-
remote: http://localgemserver.test/
|
85
|
-
specs:
|
86
|
-
rack (1.0.0)
|
87
|
-
rack-obama (1.0)
|
88
|
-
rack
|
89
|
-
|
90
|
-
PLATFORMS
|
91
|
-
#{generic(Gem::Platform.local)}
|
92
|
-
|
93
|
-
DEPENDENCIES
|
94
|
-
rack-obama (>= 1.0)
|
95
|
-
G
|
96
|
-
end
|
97
|
-
|
98
|
-
it "generates lockfiles with multiple requirements" do
|
99
|
-
install_gemfile <<-G
|
100
|
-
source "file://#{gem_repo1}"
|
101
|
-
gem "net-sftp"
|
102
|
-
G
|
103
|
-
|
104
|
-
lockfile_should_be <<-G
|
105
|
-
GEM
|
106
|
-
remote: file:#{gem_repo1}/
|
107
|
-
specs:
|
108
|
-
net-sftp (1.1.1)
|
109
|
-
net-ssh (>= 1.0.0, < 1.99.0)
|
110
|
-
net-ssh (1.0)
|
111
|
-
|
112
|
-
PLATFORMS
|
113
|
-
ruby
|
114
|
-
|
115
|
-
DEPENDENCIES
|
116
|
-
net-sftp
|
117
|
-
G
|
118
|
-
|
119
|
-
should_be_installed "net-sftp 1.1.1", "net-ssh 1.0.0"
|
120
|
-
end
|
121
|
-
|
122
|
-
it "generates a simple lockfile for a single pinned source, gem with a version requirement" do
|
123
|
-
git = build_git "foo"
|
124
|
-
|
125
|
-
install_gemfile <<-G
|
126
|
-
gem "foo", :git => "#{lib_path("foo-1.0")}"
|
127
|
-
G
|
128
|
-
|
129
|
-
lockfile_should_be <<-G
|
130
|
-
GIT
|
131
|
-
remote: #{lib_path("foo-1.0")}
|
132
|
-
revision: #{git.ref_for('master')}
|
133
|
-
specs:
|
134
|
-
foo (1.0)
|
135
|
-
|
136
|
-
GEM
|
137
|
-
specs:
|
138
|
-
|
139
|
-
PLATFORMS
|
140
|
-
#{generic(Gem::Platform.local)}
|
141
|
-
|
142
|
-
DEPENDENCIES
|
143
|
-
foo!
|
144
|
-
G
|
145
|
-
end
|
146
|
-
|
147
|
-
it "does not asplode when a platform specific dependency is present and the Gemfile has not been resolved on that platform" do
|
148
|
-
build_lib "omg", :path => lib_path('omg')
|
149
|
-
|
150
|
-
gemfile <<-G
|
151
|
-
source "file://#{gem_repo1}"
|
152
|
-
|
153
|
-
platforms :#{not_local_tag} do
|
154
|
-
gem "omg", :path => "#{lib_path('omg')}"
|
155
|
-
end
|
156
|
-
|
157
|
-
gem "rack"
|
158
|
-
G
|
159
|
-
|
160
|
-
lockfile <<-L
|
161
|
-
GIT
|
162
|
-
remote: git://github.com/nex3/haml.git
|
163
|
-
revision: 8a2271f
|
164
|
-
specs:
|
165
|
-
|
166
|
-
GEM
|
167
|
-
remote: file://#{gem_repo1}/
|
168
|
-
specs:
|
169
|
-
rack (1.0.0)
|
170
|
-
|
171
|
-
PLATFORMS
|
172
|
-
#{not_local}
|
173
|
-
|
174
|
-
DEPENDENCIES
|
175
|
-
omg!
|
176
|
-
rack
|
177
|
-
L
|
178
|
-
|
179
|
-
bundle "install"
|
180
|
-
should_be_installed "rack 1.0.0"
|
181
|
-
end
|
182
|
-
|
183
|
-
it "serializes global git sources" do
|
184
|
-
git = build_git "foo"
|
185
|
-
|
186
|
-
install_gemfile <<-G
|
187
|
-
git "#{lib_path('foo-1.0')}" do
|
188
|
-
gem "foo"
|
189
|
-
end
|
190
|
-
G
|
191
|
-
|
192
|
-
lockfile_should_be <<-G
|
193
|
-
GIT
|
194
|
-
remote: #{lib_path('foo-1.0')}
|
195
|
-
revision: #{git.ref_for('master')}
|
196
|
-
specs:
|
197
|
-
foo (1.0)
|
198
|
-
|
199
|
-
GEM
|
200
|
-
specs:
|
201
|
-
|
202
|
-
PLATFORMS
|
203
|
-
#{generic(Gem::Platform.local)}
|
204
|
-
|
205
|
-
DEPENDENCIES
|
206
|
-
foo!
|
207
|
-
G
|
208
|
-
end
|
209
|
-
|
210
|
-
it "generates a lockfile with a ref for a single pinned source, git gem with a branch requirement" do
|
211
|
-
git = build_git "foo"
|
212
|
-
update_git "foo", :branch => "omg"
|
213
|
-
|
214
|
-
install_gemfile <<-G
|
215
|
-
gem "foo", :git => "#{lib_path("foo-1.0")}", :branch => "omg"
|
216
|
-
G
|
217
|
-
|
218
|
-
lockfile_should_be <<-G
|
219
|
-
GIT
|
220
|
-
remote: #{lib_path("foo-1.0")}
|
221
|
-
revision: #{git.ref_for('omg')}
|
222
|
-
branch: omg
|
223
|
-
specs:
|
224
|
-
foo (1.0)
|
225
|
-
|
226
|
-
GEM
|
227
|
-
specs:
|
228
|
-
|
229
|
-
PLATFORMS
|
230
|
-
#{generic(Gem::Platform.local)}
|
231
|
-
|
232
|
-
DEPENDENCIES
|
233
|
-
foo!
|
234
|
-
G
|
235
|
-
end
|
236
|
-
|
237
|
-
it "generates a lockfile with a ref for a single pinned source, git gem with a tag requirement" do
|
238
|
-
git = build_git "foo"
|
239
|
-
update_git "foo", :tag => "omg"
|
240
|
-
|
241
|
-
install_gemfile <<-G
|
242
|
-
gem "foo", :git => "#{lib_path("foo-1.0")}", :tag => "omg"
|
243
|
-
G
|
244
|
-
|
245
|
-
lockfile_should_be <<-G
|
246
|
-
GIT
|
247
|
-
remote: #{lib_path("foo-1.0")}
|
248
|
-
revision: #{git.ref_for('omg')}
|
249
|
-
tag: omg
|
250
|
-
specs:
|
251
|
-
foo (1.0)
|
252
|
-
|
253
|
-
GEM
|
254
|
-
specs:
|
255
|
-
|
256
|
-
PLATFORMS
|
257
|
-
#{generic(Gem::Platform.local)}
|
258
|
-
|
259
|
-
DEPENDENCIES
|
260
|
-
foo!
|
261
|
-
G
|
262
|
-
end
|
263
|
-
|
264
|
-
it "serializes pinned path sources to the lockfile" do
|
265
|
-
build_lib "foo"
|
266
|
-
|
267
|
-
install_gemfile <<-G
|
268
|
-
gem "foo", :path => "#{lib_path("foo-1.0")}"
|
269
|
-
G
|
270
|
-
|
271
|
-
lockfile_should_be <<-G
|
272
|
-
PATH
|
273
|
-
remote: #{lib_path("foo-1.0")}
|
274
|
-
specs:
|
275
|
-
foo (1.0)
|
276
|
-
|
277
|
-
GEM
|
278
|
-
specs:
|
279
|
-
|
280
|
-
PLATFORMS
|
281
|
-
#{generic(Gem::Platform.local)}
|
282
|
-
|
283
|
-
DEPENDENCIES
|
284
|
-
foo!
|
285
|
-
G
|
286
|
-
end
|
287
|
-
|
288
|
-
it "sorts serialized sources by type" do
|
289
|
-
build_lib "foo"
|
290
|
-
bar = build_git "bar"
|
291
|
-
|
292
|
-
install_gemfile <<-G
|
293
|
-
source "file://#{gem_repo1}"
|
294
|
-
|
295
|
-
gem "rack"
|
296
|
-
gem "foo", :path => "#{lib_path("foo-1.0")}"
|
297
|
-
gem "bar", :git => "#{lib_path("bar-1.0")}"
|
298
|
-
G
|
299
|
-
|
300
|
-
lockfile_should_be <<-G
|
301
|
-
GIT
|
302
|
-
remote: #{lib_path("bar-1.0")}
|
303
|
-
revision: #{bar.ref_for('master')}
|
304
|
-
specs:
|
305
|
-
bar (1.0)
|
306
|
-
|
307
|
-
PATH
|
308
|
-
remote: #{lib_path("foo-1.0")}
|
309
|
-
specs:
|
310
|
-
foo (1.0)
|
311
|
-
|
312
|
-
GEM
|
313
|
-
remote: file:#{gem_repo1}/
|
314
|
-
specs:
|
315
|
-
rack (1.0.0)
|
316
|
-
|
317
|
-
PLATFORMS
|
318
|
-
#{generic(Gem::Platform.local)}
|
319
|
-
|
320
|
-
DEPENDENCIES
|
321
|
-
bar!
|
322
|
-
foo!
|
323
|
-
rack
|
324
|
-
G
|
325
|
-
end
|
326
|
-
|
327
|
-
it "lists gems alphabetically" do
|
328
|
-
install_gemfile <<-G
|
329
|
-
source "file://#{gem_repo1}"
|
330
|
-
|
331
|
-
gem "thin"
|
332
|
-
gem "actionpack"
|
333
|
-
gem "rack-obama"
|
334
|
-
G
|
335
|
-
|
336
|
-
lockfile_should_be <<-G
|
337
|
-
GEM
|
338
|
-
remote: file:#{gem_repo1}/
|
339
|
-
specs:
|
340
|
-
actionpack (2.3.2)
|
341
|
-
activesupport (= 2.3.2)
|
342
|
-
activesupport (2.3.2)
|
343
|
-
rack (1.0.0)
|
344
|
-
rack-obama (1.0)
|
345
|
-
rack
|
346
|
-
thin (1.0)
|
347
|
-
rack
|
348
|
-
|
349
|
-
PLATFORMS
|
350
|
-
#{generic(Gem::Platform.local)}
|
351
|
-
|
352
|
-
DEPENDENCIES
|
353
|
-
actionpack
|
354
|
-
rack-obama
|
355
|
-
thin
|
356
|
-
G
|
357
|
-
end
|
358
|
-
|
359
|
-
it "orders dependencies' dependencies in alphabetical order" do
|
360
|
-
install_gemfile <<-G
|
361
|
-
source "file://#{gem_repo1}"
|
362
|
-
|
363
|
-
gem "rails"
|
364
|
-
G
|
365
|
-
|
366
|
-
lockfile_should_be <<-G
|
367
|
-
GEM
|
368
|
-
remote: file:#{gem_repo1}/
|
369
|
-
specs:
|
370
|
-
actionmailer (2.3.2)
|
371
|
-
activesupport (= 2.3.2)
|
372
|
-
actionpack (2.3.2)
|
373
|
-
activesupport (= 2.3.2)
|
374
|
-
activerecord (2.3.2)
|
375
|
-
activesupport (= 2.3.2)
|
376
|
-
activeresource (2.3.2)
|
377
|
-
activesupport (= 2.3.2)
|
378
|
-
activesupport (2.3.2)
|
379
|
-
rails (2.3.2)
|
380
|
-
actionmailer (= 2.3.2)
|
381
|
-
actionpack (= 2.3.2)
|
382
|
-
activerecord (= 2.3.2)
|
383
|
-
activeresource (= 2.3.2)
|
384
|
-
rake (= 10.0.2)
|
385
|
-
rake (10.0.2)
|
386
|
-
|
387
|
-
PLATFORMS
|
388
|
-
#{generic(Gem::Platform.local)}
|
389
|
-
|
390
|
-
DEPENDENCIES
|
391
|
-
rails
|
392
|
-
G
|
393
|
-
end
|
394
|
-
|
395
|
-
it "orders dependencies by version" do
|
396
|
-
install_gemfile <<-G
|
397
|
-
source "file://#{gem_repo1}"
|
398
|
-
gem 'double_deps'
|
399
|
-
G
|
400
|
-
|
401
|
-
lockfile_should_be <<-G
|
402
|
-
GEM
|
403
|
-
remote: file:#{gem_repo1}/
|
404
|
-
specs:
|
405
|
-
double_deps (1.0)
|
406
|
-
net-ssh
|
407
|
-
net-ssh (>= 1.0.0)
|
408
|
-
net-ssh (1.0)
|
409
|
-
|
410
|
-
PLATFORMS
|
411
|
-
#{generic(Gem::Platform.local)}
|
412
|
-
|
413
|
-
DEPENDENCIES
|
414
|
-
double_deps
|
415
|
-
G
|
416
|
-
end
|
417
|
-
|
418
|
-
it "does not add the :require option to the lockfile" do
|
419
|
-
install_gemfile <<-G
|
420
|
-
source "file://#{gem_repo1}"
|
421
|
-
|
422
|
-
gem "rack-obama", ">= 1.0", :require => "rack/obama"
|
423
|
-
G
|
424
|
-
|
425
|
-
lockfile_should_be <<-G
|
426
|
-
GEM
|
427
|
-
remote: file:#{gem_repo1}/
|
428
|
-
specs:
|
429
|
-
rack (1.0.0)
|
430
|
-
rack-obama (1.0)
|
431
|
-
rack
|
432
|
-
|
433
|
-
PLATFORMS
|
434
|
-
#{generic(Gem::Platform.local)}
|
435
|
-
|
436
|
-
DEPENDENCIES
|
437
|
-
rack-obama (>= 1.0)
|
438
|
-
G
|
439
|
-
end
|
440
|
-
|
441
|
-
it "does not add the :group option to the lockfile" do
|
442
|
-
install_gemfile <<-G
|
443
|
-
source "file://#{gem_repo1}"
|
444
|
-
|
445
|
-
gem "rack-obama", ">= 1.0", :group => :test
|
446
|
-
G
|
447
|
-
|
448
|
-
lockfile_should_be <<-G
|
449
|
-
GEM
|
450
|
-
remote: file:#{gem_repo1}/
|
451
|
-
specs:
|
452
|
-
rack (1.0.0)
|
453
|
-
rack-obama (1.0)
|
454
|
-
rack
|
455
|
-
|
456
|
-
PLATFORMS
|
457
|
-
#{generic(Gem::Platform.local)}
|
458
|
-
|
459
|
-
DEPENDENCIES
|
460
|
-
rack-obama (>= 1.0)
|
461
|
-
G
|
462
|
-
end
|
463
|
-
|
464
|
-
it "stores relative paths when the path is provided in a relative fashion and in Gemfile dir" do
|
465
|
-
build_lib "foo", :path => bundled_app('foo')
|
466
|
-
|
467
|
-
install_gemfile <<-G
|
468
|
-
path "foo"
|
469
|
-
gem "foo"
|
470
|
-
G
|
471
|
-
|
472
|
-
lockfile_should_be <<-G
|
473
|
-
PATH
|
474
|
-
remote: foo
|
475
|
-
specs:
|
476
|
-
foo (1.0)
|
477
|
-
|
478
|
-
GEM
|
479
|
-
specs:
|
480
|
-
|
481
|
-
PLATFORMS
|
482
|
-
#{generic(Gem::Platform.local)}
|
483
|
-
|
484
|
-
DEPENDENCIES
|
485
|
-
foo
|
486
|
-
G
|
487
|
-
end
|
488
|
-
|
489
|
-
it "stores relative paths when the path is provided in a relative fashion and is above Gemfile dir" do
|
490
|
-
build_lib "foo", :path => bundled_app(File.join('..', 'foo'))
|
491
|
-
|
492
|
-
install_gemfile <<-G
|
493
|
-
path "../foo"
|
494
|
-
gem "foo"
|
495
|
-
G
|
496
|
-
|
497
|
-
lockfile_should_be <<-G
|
498
|
-
PATH
|
499
|
-
remote: ../foo
|
500
|
-
specs:
|
501
|
-
foo (1.0)
|
502
|
-
|
503
|
-
GEM
|
504
|
-
specs:
|
505
|
-
|
506
|
-
PLATFORMS
|
507
|
-
#{generic(Gem::Platform.local)}
|
508
|
-
|
509
|
-
DEPENDENCIES
|
510
|
-
foo
|
511
|
-
G
|
512
|
-
end
|
513
|
-
|
514
|
-
it "stores relative paths when the path is provided in an absolute fashion but is relative" do
|
515
|
-
build_lib "foo", :path => bundled_app('foo')
|
516
|
-
|
517
|
-
install_gemfile <<-G
|
518
|
-
path File.expand_path("../foo", __FILE__)
|
519
|
-
gem "foo"
|
520
|
-
G
|
521
|
-
|
522
|
-
lockfile_should_be <<-G
|
523
|
-
PATH
|
524
|
-
remote: foo
|
525
|
-
specs:
|
526
|
-
foo (1.0)
|
527
|
-
|
528
|
-
GEM
|
529
|
-
specs:
|
530
|
-
|
531
|
-
PLATFORMS
|
532
|
-
#{generic(Gem::Platform.local)}
|
533
|
-
|
534
|
-
DEPENDENCIES
|
535
|
-
foo
|
536
|
-
G
|
537
|
-
end
|
538
|
-
|
539
|
-
it "stores relative paths when the path is provided for gemspec" do
|
540
|
-
build_lib("foo", :path => tmp.join("foo"))
|
541
|
-
|
542
|
-
install_gemfile <<-G
|
543
|
-
gemspec :path => "../foo"
|
544
|
-
G
|
545
|
-
|
546
|
-
lockfile_should_be <<-G
|
547
|
-
PATH
|
548
|
-
remote: ../foo
|
549
|
-
specs:
|
550
|
-
foo (1.0)
|
551
|
-
|
552
|
-
GEM
|
553
|
-
specs:
|
554
|
-
|
555
|
-
PLATFORMS
|
556
|
-
#{generic(Gem::Platform.local)}
|
557
|
-
|
558
|
-
DEPENDENCIES
|
559
|
-
foo!
|
560
|
-
G
|
561
|
-
end
|
562
|
-
|
563
|
-
it "keeps existing platforms in the lockfile" do
|
564
|
-
lockfile <<-G
|
565
|
-
GEM
|
566
|
-
remote: file:#{gem_repo1}/
|
567
|
-
specs:
|
568
|
-
rack (1.0.0)
|
569
|
-
|
570
|
-
PLATFORMS
|
571
|
-
java
|
572
|
-
|
573
|
-
DEPENDENCIES
|
574
|
-
rack
|
575
|
-
G
|
576
|
-
|
577
|
-
install_gemfile <<-G
|
578
|
-
source "file://#{gem_repo1}"
|
579
|
-
|
580
|
-
gem "rack"
|
581
|
-
G
|
582
|
-
|
583
|
-
platforms = ['java', generic(Gem::Platform.local).to_s].sort
|
584
|
-
|
585
|
-
lockfile_should_be <<-G
|
586
|
-
GEM
|
587
|
-
remote: file:#{gem_repo1}/
|
588
|
-
specs:
|
589
|
-
rack (1.0.0)
|
590
|
-
|
591
|
-
PLATFORMS
|
592
|
-
#{platforms[0]}
|
593
|
-
#{platforms[1]}
|
594
|
-
|
595
|
-
DEPENDENCIES
|
596
|
-
rack
|
597
|
-
G
|
598
|
-
end
|
599
|
-
|
600
|
-
it "persists the spec's platform to the lockfile" do
|
601
|
-
build_gem "platform_specific", "1.0.0", :to_system => true do |s|
|
602
|
-
s.platform = Gem::Platform.new('universal-java-16')
|
603
|
-
end
|
604
|
-
|
605
|
-
simulate_platform "universal-java-16"
|
606
|
-
|
607
|
-
install_gemfile <<-G
|
608
|
-
source "file://#{gem_repo1}"
|
609
|
-
gem "platform_specific"
|
610
|
-
G
|
611
|
-
|
612
|
-
lockfile_should_be <<-G
|
613
|
-
GEM
|
614
|
-
remote: file:#{gem_repo1}/
|
615
|
-
specs:
|
616
|
-
platform_specific (1.0-java)
|
617
|
-
|
618
|
-
PLATFORMS
|
619
|
-
java
|
620
|
-
|
621
|
-
DEPENDENCIES
|
622
|
-
platform_specific
|
623
|
-
G
|
624
|
-
end
|
625
|
-
|
626
|
-
it "does not add duplicate gems" do
|
627
|
-
install_gemfile <<-G
|
628
|
-
source "file://#{gem_repo1}"
|
629
|
-
gem "rack"
|
630
|
-
G
|
631
|
-
|
632
|
-
install_gemfile <<-G
|
633
|
-
source "file://#{gem_repo1}"
|
634
|
-
gem "rack"
|
635
|
-
gem "activesupport"
|
636
|
-
G
|
637
|
-
|
638
|
-
lockfile_should_be <<-G
|
639
|
-
GEM
|
640
|
-
remote: file:#{gem_repo1}/
|
641
|
-
specs:
|
642
|
-
activesupport (2.3.5)
|
643
|
-
rack (1.0.0)
|
644
|
-
|
645
|
-
PLATFORMS
|
646
|
-
ruby
|
647
|
-
|
648
|
-
DEPENDENCIES
|
649
|
-
activesupport
|
650
|
-
rack
|
651
|
-
G
|
652
|
-
end
|
653
|
-
|
654
|
-
it "does not add duplicate dependencies" do
|
655
|
-
install_gemfile <<-G
|
656
|
-
source "file://#{gem_repo1}"
|
657
|
-
gem "rack"
|
658
|
-
gem "rack"
|
659
|
-
G
|
660
|
-
|
661
|
-
lockfile_should_be <<-G
|
662
|
-
GEM
|
663
|
-
remote: file:#{gem_repo1}/
|
664
|
-
specs:
|
665
|
-
rack (1.0.0)
|
666
|
-
|
667
|
-
PLATFORMS
|
668
|
-
ruby
|
669
|
-
|
670
|
-
DEPENDENCIES
|
671
|
-
rack
|
672
|
-
G
|
673
|
-
end
|
674
|
-
|
675
|
-
it "does not add duplicate dependencies with versions" do
|
676
|
-
install_gemfile <<-G
|
677
|
-
source "file://#{gem_repo1}"
|
678
|
-
gem "rack", "1.0"
|
679
|
-
gem "rack", "1.0"
|
680
|
-
G
|
681
|
-
|
682
|
-
lockfile_should_be <<-G
|
683
|
-
GEM
|
684
|
-
remote: file:#{gem_repo1}/
|
685
|
-
specs:
|
686
|
-
rack (1.0.0)
|
687
|
-
|
688
|
-
PLATFORMS
|
689
|
-
ruby
|
690
|
-
|
691
|
-
DEPENDENCIES
|
692
|
-
rack (= 1.0)
|
693
|
-
G
|
694
|
-
end
|
695
|
-
|
696
|
-
it "does not add duplicate dependencies in different groups" do
|
697
|
-
install_gemfile <<-G
|
698
|
-
source "file://#{gem_repo1}"
|
699
|
-
gem "rack", "1.0", :group => :one
|
700
|
-
gem "rack", "1.0", :group => :two
|
701
|
-
G
|
702
|
-
|
703
|
-
lockfile_should_be <<-G
|
704
|
-
GEM
|
705
|
-
remote: file:#{gem_repo1}/
|
706
|
-
specs:
|
707
|
-
rack (1.0.0)
|
708
|
-
|
709
|
-
PLATFORMS
|
710
|
-
ruby
|
711
|
-
|
712
|
-
DEPENDENCIES
|
713
|
-
rack (= 1.0)
|
714
|
-
G
|
715
|
-
end
|
716
|
-
|
717
|
-
it "raises if two different versions are used" do
|
718
|
-
install_gemfile <<-G
|
719
|
-
source "file://#{gem_repo1}"
|
720
|
-
gem "rack", "1.0"
|
721
|
-
gem "rack", "1.1"
|
722
|
-
G
|
723
|
-
|
724
|
-
expect(bundled_app("Gemfile.lock")).not_to exist
|
725
|
-
expect(out).to include "rack (= 1.0) and rack (= 1.1)"
|
726
|
-
end
|
727
|
-
|
728
|
-
|
729
|
-
it "raises if two different sources are used" do
|
730
|
-
install_gemfile <<-G
|
731
|
-
source "file://#{gem_repo1}"
|
732
|
-
gem "rack"
|
733
|
-
gem "rack", :git => "git://hubz.com"
|
734
|
-
G
|
735
|
-
|
736
|
-
expect(bundled_app("Gemfile.lock")).not_to exist
|
737
|
-
expect(out).to include "rack (>= 0) should come from an unspecified source and git://hubz.com (at master)"
|
738
|
-
end
|
739
|
-
|
740
|
-
it "works correctly with multiple version dependencies" do
|
741
|
-
install_gemfile <<-G
|
742
|
-
source "file://#{gem_repo1}"
|
743
|
-
gem "rack", "> 0.9", "< 1.0"
|
744
|
-
G
|
745
|
-
|
746
|
-
lockfile_should_be <<-G
|
747
|
-
GEM
|
748
|
-
remote: file:#{gem_repo1}/
|
749
|
-
specs:
|
750
|
-
rack (0.9.1)
|
751
|
-
|
752
|
-
PLATFORMS
|
753
|
-
ruby
|
754
|
-
|
755
|
-
DEPENDENCIES
|
756
|
-
rack (> 0.9, < 1.0)
|
757
|
-
G
|
758
|
-
|
759
|
-
end
|
760
|
-
|
761
|
-
# Some versions of the Bundler 1.1 RC series introduced corrupted
|
762
|
-
# lockfiles. There were two major problems:
|
763
|
-
#
|
764
|
-
# * multiple copies of the same GIT section appeared in the lockfile
|
765
|
-
# * when this happened, those sections got multiple copies of gems
|
766
|
-
# in those sections.
|
767
|
-
it "fixes corrupted lockfiles" do
|
768
|
-
build_git "omg", :path => lib_path('omg')
|
769
|
-
revision = revision_for(lib_path('omg'))
|
770
|
-
|
771
|
-
gemfile <<-G
|
772
|
-
source "file://#{gem_repo1}"
|
773
|
-
gem "omg", :git => "#{lib_path('omg')}", :branch => 'master'
|
774
|
-
G
|
775
|
-
|
776
|
-
bundle "install --path vendor"
|
777
|
-
should_be_installed "omg 1.0"
|
778
|
-
|
779
|
-
# Create a Gemfile.lock that has duplicate GIT sections
|
780
|
-
lockfile <<-L
|
781
|
-
GIT
|
782
|
-
remote: #{lib_path('omg')}
|
783
|
-
revision: #{revision}
|
784
|
-
branch: master
|
785
|
-
specs:
|
786
|
-
omg (1.0)
|
787
|
-
|
788
|
-
GIT
|
789
|
-
remote: #{lib_path('omg')}
|
790
|
-
revision: #{revision}
|
791
|
-
branch: master
|
792
|
-
specs:
|
793
|
-
omg (1.0)
|
794
|
-
|
795
|
-
GEM
|
796
|
-
remote: file:#{gem_repo1}/
|
797
|
-
specs:
|
798
|
-
|
799
|
-
PLATFORMS
|
800
|
-
#{local}
|
801
|
-
|
802
|
-
DEPENDENCIES
|
803
|
-
omg!
|
804
|
-
L
|
805
|
-
|
806
|
-
FileUtils.rm_rf(bundled_app('vendor'))
|
807
|
-
bundle "install"
|
808
|
-
should_be_installed "omg 1.0"
|
809
|
-
|
810
|
-
# Confirm that duplicate specs do not appear
|
811
|
-
expect(File.read(bundled_app('Gemfile.lock'))).to eq(strip_whitespace(<<-L))
|
812
|
-
GIT
|
813
|
-
remote: #{lib_path('omg')}
|
814
|
-
revision: #{revision}
|
815
|
-
branch: master
|
816
|
-
specs:
|
817
|
-
omg (1.0)
|
818
|
-
|
819
|
-
GEM
|
820
|
-
remote: file:#{gem_repo1}/
|
821
|
-
specs:
|
822
|
-
|
823
|
-
PLATFORMS
|
824
|
-
#{local}
|
825
|
-
|
826
|
-
DEPENDENCIES
|
827
|
-
omg!
|
828
|
-
L
|
829
|
-
end
|
830
|
-
|
831
|
-
describe "a line ending" do
|
832
|
-
def set_lockfile_mtime_to_known_value
|
833
|
-
time = Time.local(2000, 1, 1, 0, 0, 0)
|
834
|
-
File.utime(time, time, bundled_app('Gemfile.lock'))
|
835
|
-
end
|
836
|
-
before(:each) do
|
837
|
-
build_repo2
|
838
|
-
install_gemfile <<-G
|
839
|
-
source "file://#{gem_repo2}"
|
840
|
-
gem "rack"
|
841
|
-
G
|
842
|
-
set_lockfile_mtime_to_known_value
|
843
|
-
end
|
844
|
-
|
845
|
-
it "generates Gemfile.lock with \\n line endings" do
|
846
|
-
expect(File.read(bundled_app("Gemfile.lock"))).not_to match("\r\n")
|
847
|
-
should_be_installed "rack 1.0"
|
848
|
-
end
|
849
|
-
|
850
|
-
context "during updates" do
|
851
|
-
|
852
|
-
it "preserves Gemfile.lock \\n line endings" do
|
853
|
-
update_repo2
|
854
|
-
|
855
|
-
expect { bundle "update" }.to change { File.mtime(bundled_app('Gemfile.lock')) }
|
856
|
-
expect(File.read(bundled_app("Gemfile.lock"))).not_to match("\r\n")
|
857
|
-
should_be_installed "rack 1.2"
|
858
|
-
end
|
859
|
-
|
860
|
-
it "preserves Gemfile.lock \\n\\r line endings" do
|
861
|
-
update_repo2
|
862
|
-
win_lock = File.read(bundled_app("Gemfile.lock")).gsub(/\n/, "\r\n")
|
863
|
-
File.open(bundled_app("Gemfile.lock"), "wb"){|f| f.puts(win_lock) }
|
864
|
-
set_lockfile_mtime_to_known_value
|
865
|
-
|
866
|
-
expect { bundle "update" }.to change { File.mtime(bundled_app('Gemfile.lock')) }
|
867
|
-
expect(File.read(bundled_app("Gemfile.lock"))).to match("\r\n")
|
868
|
-
should_be_installed "rack 1.2"
|
869
|
-
end
|
870
|
-
end
|
871
|
-
|
872
|
-
context "when nothing changes" do
|
873
|
-
|
874
|
-
it "preserves Gemfile.lock \\n line endings" do
|
875
|
-
expect { ruby <<-RUBY
|
876
|
-
require 'rubygems'
|
877
|
-
require 'bundler'
|
878
|
-
Bundler.setup
|
879
|
-
RUBY
|
880
|
-
}.not_to change { File.mtime(bundled_app('Gemfile.lock')) }
|
881
|
-
end
|
882
|
-
|
883
|
-
it "preserves Gemfile.lock \\n\\r line endings" do
|
884
|
-
win_lock = File.read(bundled_app("Gemfile.lock")).gsub(/\n/, "\r\n")
|
885
|
-
File.open(bundled_app("Gemfile.lock"), "wb"){|f| f.puts(win_lock) }
|
886
|
-
set_lockfile_mtime_to_known_value
|
887
|
-
|
888
|
-
expect { ruby <<-RUBY
|
889
|
-
require 'rubygems'
|
890
|
-
require 'bundler'
|
891
|
-
Bundler.setup
|
892
|
-
RUBY
|
893
|
-
}.not_to change { File.mtime(bundled_app('Gemfile.lock')) }
|
894
|
-
end
|
895
|
-
end
|
896
|
-
end
|
897
|
-
|
898
|
-
it "refuses to install if Gemfile.lock contains conflict markers" do
|
899
|
-
lockfile <<-L
|
900
|
-
GEM
|
901
|
-
remote: file://#{gem_repo1}/
|
902
|
-
specs:
|
903
|
-
<<<<<<<
|
904
|
-
rack (1.0.0)
|
905
|
-
=======
|
906
|
-
rack (1.0.1)
|
907
|
-
>>>>>>>
|
908
|
-
|
909
|
-
PLATFORMS
|
910
|
-
ruby
|
911
|
-
|
912
|
-
DEPENDENCIES
|
913
|
-
rack
|
914
|
-
L
|
915
|
-
|
916
|
-
error = install_gemfile(<<-G, :expect_err => true)
|
917
|
-
source "file://#{gem_repo1}"
|
918
|
-
gem "rack"
|
919
|
-
G
|
920
|
-
|
921
|
-
expect(error).to match(/your Gemfile.lock contains merge conflicts/i)
|
922
|
-
expect(error).to match(/git checkout HEAD -- Gemfile.lock/i)
|
923
|
-
end
|
924
|
-
end
|