rkh-bundler 1.2.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +22 -0
- data/.travis.yml +42 -0
- data/CHANGELOG.md +1105 -0
- data/ISSUES.md +67 -0
- data/LICENSE +23 -0
- data/README.md +31 -0
- data/Rakefile +208 -0
- data/UPGRADING.md +103 -0
- data/bin/bundle +31 -0
- data/bundler.gemspec +31 -0
- data/lib/bundler.rb +353 -0
- data/lib/bundler/capistrano.rb +11 -0
- data/lib/bundler/cli.rb +693 -0
- data/lib/bundler/definition.rb +568 -0
- data/lib/bundler/dep_proxy.rb +43 -0
- data/lib/bundler/dependency.rb +134 -0
- data/lib/bundler/deployment.rb +58 -0
- data/lib/bundler/dsl.rb +256 -0
- data/lib/bundler/endpoint_specification.rb +78 -0
- data/lib/bundler/environment.rb +47 -0
- data/lib/bundler/fetcher.rb +225 -0
- data/lib/bundler/gem_helper.rb +162 -0
- data/lib/bundler/gem_helpers.rb +23 -0
- data/lib/bundler/gem_installer.rb +9 -0
- data/lib/bundler/gem_tasks.rb +2 -0
- data/lib/bundler/graph.rb +148 -0
- data/lib/bundler/index.rb +187 -0
- data/lib/bundler/installer.rb +190 -0
- data/lib/bundler/lazy_specification.rb +79 -0
- data/lib/bundler/lockfile_parser.rb +127 -0
- data/lib/bundler/match_platform.rb +13 -0
- data/lib/bundler/psyched_yaml.rb +15 -0
- data/lib/bundler/remote_specification.rb +57 -0
- data/lib/bundler/resolver.rb +486 -0
- data/lib/bundler/ruby_version.rb +94 -0
- data/lib/bundler/rubygems_ext.rb +153 -0
- data/lib/bundler/rubygems_integration.rb +394 -0
- data/lib/bundler/runtime.rb +233 -0
- data/lib/bundler/settings.rb +128 -0
- data/lib/bundler/setup.rb +23 -0
- data/lib/bundler/shared_helpers.rb +71 -0
- data/lib/bundler/source.rb +869 -0
- data/lib/bundler/spec_set.rb +137 -0
- data/lib/bundler/templates/Executable +16 -0
- data/lib/bundler/templates/Executable.standalone +12 -0
- data/lib/bundler/templates/Gemfile +4 -0
- data/lib/bundler/templates/newgem/Gemfile.tt +4 -0
- data/lib/bundler/templates/newgem/LICENSE.tt +22 -0
- data/lib/bundler/templates/newgem/README.md.tt +29 -0
- data/lib/bundler/templates/newgem/Rakefile.tt +2 -0
- data/lib/bundler/templates/newgem/bin/newgem.tt +3 -0
- data/lib/bundler/templates/newgem/gitignore.tt +17 -0
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +9 -0
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +7 -0
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +17 -0
- data/lib/bundler/ui.rb +88 -0
- data/lib/bundler/vendor/net/http/faster.rb +27 -0
- data/lib/bundler/vendor/net/http/persistent.rb +468 -0
- data/lib/bundler/vendor/thor.rb +358 -0
- data/lib/bundler/vendor/thor/actions.rb +314 -0
- data/lib/bundler/vendor/thor/actions/create_file.rb +105 -0
- data/lib/bundler/vendor/thor/actions/create_link.rb +57 -0
- data/lib/bundler/vendor/thor/actions/directory.rb +93 -0
- data/lib/bundler/vendor/thor/actions/empty_directory.rb +134 -0
- data/lib/bundler/vendor/thor/actions/file_manipulation.rb +270 -0
- data/lib/bundler/vendor/thor/actions/inject_into_file.rb +109 -0
- data/lib/bundler/vendor/thor/base.rb +576 -0
- data/lib/bundler/vendor/thor/core_ext/file_binary_read.rb +9 -0
- data/lib/bundler/vendor/thor/core_ext/hash_with_indifferent_access.rb +75 -0
- data/lib/bundler/vendor/thor/core_ext/ordered_hash.rb +100 -0
- data/lib/bundler/vendor/thor/error.rb +30 -0
- data/lib/bundler/vendor/thor/group.rb +273 -0
- data/lib/bundler/vendor/thor/invocation.rb +168 -0
- data/lib/bundler/vendor/thor/parser.rb +4 -0
- data/lib/bundler/vendor/thor/parser/argument.rb +67 -0
- data/lib/bundler/vendor/thor/parser/arguments.rb +161 -0
- data/lib/bundler/vendor/thor/parser/option.rb +120 -0
- data/lib/bundler/vendor/thor/parser/options.rb +172 -0
- data/lib/bundler/vendor/thor/rake_compat.rb +66 -0
- data/lib/bundler/vendor/thor/runner.rb +309 -0
- data/lib/bundler/vendor/thor/shell.rb +88 -0
- data/lib/bundler/vendor/thor/shell/basic.rb +302 -0
- data/lib/bundler/vendor/thor/shell/color.rb +108 -0
- data/lib/bundler/vendor/thor/shell/html.rb +121 -0
- data/lib/bundler/vendor/thor/task.rb +113 -0
- data/lib/bundler/vendor/thor/util.rb +229 -0
- data/lib/bundler/vendor/thor/version.rb +3 -0
- data/lib/bundler/vendored_thor.rb +7 -0
- data/lib/bundler/version.rb +6 -0
- data/lib/bundler/vlad.rb +11 -0
- data/man/bundle-config.ronn +130 -0
- data/man/bundle-exec.ronn +111 -0
- data/man/bundle-install.ronn +335 -0
- data/man/bundle-package.ronn +59 -0
- data/man/bundle-update.ronn +176 -0
- data/man/bundle.ronn +83 -0
- data/man/gemfile.5.ronn +324 -0
- data/man/index.txt +6 -0
- data/spec/bundler/dsl_spec.rb +48 -0
- data/spec/bundler/gem_helper_spec.rb +174 -0
- data/spec/bundler/source_spec.rb +25 -0
- data/spec/cache/gems_spec.rb +239 -0
- data/spec/cache/git_spec.rb +124 -0
- data/spec/cache/path_spec.rb +103 -0
- data/spec/cache/platform_spec.rb +57 -0
- data/spec/install/deploy_spec.rb +211 -0
- data/spec/install/gems/c_ext_spec.rb +48 -0
- data/spec/install/gems/dependency_api_spec.rb +402 -0
- data/spec/install/gems/env_spec.rb +107 -0
- data/spec/install/gems/flex_spec.rb +313 -0
- data/spec/install/gems/groups_spec.rb +268 -0
- data/spec/install/gems/packed_spec.rb +84 -0
- data/spec/install/gems/platform_spec.rb +208 -0
- data/spec/install/gems/post_install_spec.rb +47 -0
- data/spec/install/gems/resolving_spec.rb +72 -0
- data/spec/install/gems/simple_case_spec.rb +814 -0
- data/spec/install/gems/standalone_spec.rb +260 -0
- data/spec/install/gems/sudo_spec.rb +74 -0
- data/spec/install/gems/win32_spec.rb +26 -0
- data/spec/install/gemspec_spec.rb +170 -0
- data/spec/install/git_spec.rb +796 -0
- data/spec/install/invalid_spec.rb +35 -0
- data/spec/install/path_spec.rb +405 -0
- data/spec/install/upgrade_spec.rb +26 -0
- data/spec/lock/git_spec.rb +35 -0
- data/spec/lock/lockfile_spec.rb +809 -0
- data/spec/other/check_spec.rb +265 -0
- data/spec/other/clean_spec.rb +492 -0
- data/spec/other/config_spec.rb +138 -0
- data/spec/other/console_spec.rb +54 -0
- data/spec/other/exec_spec.rb +229 -0
- data/spec/other/ext_spec.rb +37 -0
- data/spec/other/help_spec.rb +39 -0
- data/spec/other/init_spec.rb +40 -0
- data/spec/other/newgem_spec.rb +87 -0
- data/spec/other/open_spec.rb +35 -0
- data/spec/other/outdated_spec.rb +93 -0
- data/spec/other/platform_spec.rb +881 -0
- data/spec/other/show_spec.rb +88 -0
- data/spec/quality_spec.rb +62 -0
- data/spec/realworld/edgecases_spec.rb +177 -0
- data/spec/resolver/basic_spec.rb +20 -0
- data/spec/resolver/platform_spec.rb +82 -0
- data/spec/runtime/executable_spec.rb +120 -0
- data/spec/runtime/load_spec.rb +107 -0
- data/spec/runtime/platform_spec.rb +90 -0
- data/spec/runtime/require_spec.rb +261 -0
- data/spec/runtime/setup_spec.rb +755 -0
- data/spec/runtime/with_clean_env_spec.rb +80 -0
- data/spec/spec_helper.rb +98 -0
- data/spec/support/artifice/endopint_marshal_fail_basic_authentication.rb +13 -0
- data/spec/support/artifice/endpoint.rb +54 -0
- data/spec/support/artifice/endpoint_500.rb +37 -0
- data/spec/support/artifice/endpoint_api_missing.rb +16 -0
- data/spec/support/artifice/endpoint_basic_authentication.rb +13 -0
- data/spec/support/artifice/endpoint_extra.rb +27 -0
- data/spec/support/artifice/endpoint_extra_missing.rb +15 -0
- data/spec/support/artifice/endpoint_fallback.rb +18 -0
- data/spec/support/artifice/endpoint_marshal_fail.rb +11 -0
- data/spec/support/artifice/endpoint_redirect.rb +15 -0
- data/spec/support/builders.rb +604 -0
- data/spec/support/fakeweb/rack-1.0.0.marshal +2 -0
- data/spec/support/fakeweb/windows.rb +23 -0
- data/spec/support/helpers.rb +317 -0
- data/spec/support/indexes.rb +112 -0
- data/spec/support/matchers.rb +77 -0
- data/spec/support/path.rb +73 -0
- data/spec/support/platforms.rb +86 -0
- data/spec/support/ruby_ext.rb +20 -0
- data/spec/support/rubygems_ext.rb +37 -0
- data/spec/support/rubygems_hax/platform.rb +22 -0
- data/spec/support/sudo.rb +21 -0
- data/spec/update/gems_spec.rb +134 -0
- data/spec/update/git_spec.rb +196 -0
- data/spec/update/source_spec.rb +51 -0
- metadata +338 -0
@@ -0,0 +1,35 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "bundle lock with git gems" do
|
4
|
+
before :each do
|
5
|
+
build_git "foo"
|
6
|
+
|
7
|
+
install_gemfile <<-G
|
8
|
+
gem 'foo', :git => "#{lib_path('foo-1.0')}"
|
9
|
+
G
|
10
|
+
end
|
11
|
+
|
12
|
+
it "doesn't break right after running lock" do
|
13
|
+
should_be_installed "foo 1.0.0"
|
14
|
+
end
|
15
|
+
|
16
|
+
it "locks a git source to the current ref" do
|
17
|
+
update_git "foo"
|
18
|
+
bundle :install
|
19
|
+
|
20
|
+
run <<-RUBY
|
21
|
+
require 'foo'
|
22
|
+
puts "WIN" unless defined?(FOO_PREV_REF)
|
23
|
+
RUBY
|
24
|
+
|
25
|
+
out.should == "WIN"
|
26
|
+
end
|
27
|
+
|
28
|
+
it "provides correct #full_gem_path" do
|
29
|
+
run <<-RUBY
|
30
|
+
puts Bundler.rubygems.find_name('foo').first.full_gem_path
|
31
|
+
RUBY
|
32
|
+
out.should == bundle("show foo")
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
@@ -0,0 +1,809 @@
|
|
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 lockfiles with multiple requirements" do
|
74
|
+
install_gemfile <<-G
|
75
|
+
source "file://#{gem_repo1}"
|
76
|
+
gem "net-sftp"
|
77
|
+
G
|
78
|
+
|
79
|
+
lockfile_should_be <<-G
|
80
|
+
GEM
|
81
|
+
remote: file:#{gem_repo1}/
|
82
|
+
specs:
|
83
|
+
net-sftp (1.1.1)
|
84
|
+
net-ssh (>= 1.0.0, < 1.99.0)
|
85
|
+
net-ssh (1.0)
|
86
|
+
|
87
|
+
PLATFORMS
|
88
|
+
ruby
|
89
|
+
|
90
|
+
DEPENDENCIES
|
91
|
+
net-sftp
|
92
|
+
G
|
93
|
+
|
94
|
+
should_be_installed "net-sftp 1.1.1", "net-ssh 1.0.0"
|
95
|
+
end
|
96
|
+
|
97
|
+
it "generates a simple lockfile for a single pinned source, gem with a version requirement" do
|
98
|
+
git = build_git "foo"
|
99
|
+
|
100
|
+
install_gemfile <<-G
|
101
|
+
gem "foo", :git => "#{lib_path("foo-1.0")}"
|
102
|
+
G
|
103
|
+
|
104
|
+
lockfile_should_be <<-G
|
105
|
+
GIT
|
106
|
+
remote: #{lib_path("foo-1.0")}
|
107
|
+
revision: #{git.ref_for('master')}
|
108
|
+
specs:
|
109
|
+
foo (1.0)
|
110
|
+
|
111
|
+
GEM
|
112
|
+
specs:
|
113
|
+
|
114
|
+
PLATFORMS
|
115
|
+
#{generic(Gem::Platform.local)}
|
116
|
+
|
117
|
+
DEPENDENCIES
|
118
|
+
foo!
|
119
|
+
G
|
120
|
+
end
|
121
|
+
|
122
|
+
it "does not assplode when a platform specific dependency is present and the Gemfile has not been resolved on that platform" do
|
123
|
+
build_lib "omg", :path => lib_path('omg')
|
124
|
+
|
125
|
+
gemfile <<-G
|
126
|
+
source "file://#{gem_repo1}"
|
127
|
+
|
128
|
+
platforms :#{not_local_tag} do
|
129
|
+
gem "omg", :path => "#{lib_path('omg')}"
|
130
|
+
end
|
131
|
+
|
132
|
+
gem "rack"
|
133
|
+
G
|
134
|
+
|
135
|
+
lockfile <<-L
|
136
|
+
GIT
|
137
|
+
remote: git://github.com/nex3/haml.git
|
138
|
+
revision: 8a2271f
|
139
|
+
specs:
|
140
|
+
|
141
|
+
GEM
|
142
|
+
remote: file://#{gem_repo1}/
|
143
|
+
specs:
|
144
|
+
rack (1.0.0)
|
145
|
+
|
146
|
+
PLATFORMS
|
147
|
+
#{not_local}
|
148
|
+
|
149
|
+
DEPENDENCIES
|
150
|
+
omg!
|
151
|
+
rack
|
152
|
+
L
|
153
|
+
|
154
|
+
bundle "install"
|
155
|
+
should_be_installed "rack 1.0.0"
|
156
|
+
end
|
157
|
+
|
158
|
+
it "serializes global git sources" do
|
159
|
+
git = build_git "foo"
|
160
|
+
|
161
|
+
install_gemfile <<-G
|
162
|
+
git "#{lib_path('foo-1.0')}" do
|
163
|
+
gem "foo"
|
164
|
+
end
|
165
|
+
G
|
166
|
+
|
167
|
+
lockfile_should_be <<-G
|
168
|
+
GIT
|
169
|
+
remote: #{lib_path('foo-1.0')}
|
170
|
+
revision: #{git.ref_for('master')}
|
171
|
+
specs:
|
172
|
+
foo (1.0)
|
173
|
+
|
174
|
+
GEM
|
175
|
+
specs:
|
176
|
+
|
177
|
+
PLATFORMS
|
178
|
+
#{generic(Gem::Platform.local)}
|
179
|
+
|
180
|
+
DEPENDENCIES
|
181
|
+
foo!
|
182
|
+
G
|
183
|
+
end
|
184
|
+
|
185
|
+
it "generates a lockfile with a ref for a single pinned source, git gem with a branch requirement" do
|
186
|
+
git = build_git "foo"
|
187
|
+
update_git "foo", :branch => "omg"
|
188
|
+
|
189
|
+
install_gemfile <<-G
|
190
|
+
gem "foo", :git => "#{lib_path("foo-1.0")}", :branch => "omg"
|
191
|
+
G
|
192
|
+
|
193
|
+
lockfile_should_be <<-G
|
194
|
+
GIT
|
195
|
+
remote: #{lib_path("foo-1.0")}
|
196
|
+
revision: #{git.ref_for('omg')}
|
197
|
+
branch: omg
|
198
|
+
specs:
|
199
|
+
foo (1.0)
|
200
|
+
|
201
|
+
GEM
|
202
|
+
specs:
|
203
|
+
|
204
|
+
PLATFORMS
|
205
|
+
#{generic(Gem::Platform.local)}
|
206
|
+
|
207
|
+
DEPENDENCIES
|
208
|
+
foo!
|
209
|
+
G
|
210
|
+
end
|
211
|
+
|
212
|
+
it "generates a lockfile with a ref for a single pinned source, git gem with a tag requirement" do
|
213
|
+
git = build_git "foo"
|
214
|
+
update_git "foo", :tag => "omg"
|
215
|
+
|
216
|
+
install_gemfile <<-G
|
217
|
+
gem "foo", :git => "#{lib_path("foo-1.0")}", :tag => "omg"
|
218
|
+
G
|
219
|
+
|
220
|
+
lockfile_should_be <<-G
|
221
|
+
GIT
|
222
|
+
remote: #{lib_path("foo-1.0")}
|
223
|
+
revision: #{git.ref_for('omg')}
|
224
|
+
tag: omg
|
225
|
+
specs:
|
226
|
+
foo (1.0)
|
227
|
+
|
228
|
+
GEM
|
229
|
+
specs:
|
230
|
+
|
231
|
+
PLATFORMS
|
232
|
+
#{generic(Gem::Platform.local)}
|
233
|
+
|
234
|
+
DEPENDENCIES
|
235
|
+
foo!
|
236
|
+
G
|
237
|
+
end
|
238
|
+
|
239
|
+
it "serializes pinned path sources to the lockfile" do
|
240
|
+
build_lib "foo"
|
241
|
+
|
242
|
+
install_gemfile <<-G
|
243
|
+
gem "foo", :path => "#{lib_path("foo-1.0")}"
|
244
|
+
G
|
245
|
+
|
246
|
+
lockfile_should_be <<-G
|
247
|
+
PATH
|
248
|
+
remote: #{lib_path("foo-1.0")}
|
249
|
+
specs:
|
250
|
+
foo (1.0)
|
251
|
+
|
252
|
+
GEM
|
253
|
+
specs:
|
254
|
+
|
255
|
+
PLATFORMS
|
256
|
+
#{generic(Gem::Platform.local)}
|
257
|
+
|
258
|
+
DEPENDENCIES
|
259
|
+
foo!
|
260
|
+
G
|
261
|
+
end
|
262
|
+
|
263
|
+
it "lists gems alphabetically" do
|
264
|
+
install_gemfile <<-G
|
265
|
+
source "file://#{gem_repo1}"
|
266
|
+
|
267
|
+
gem "thin"
|
268
|
+
gem "actionpack"
|
269
|
+
gem "rack-obama"
|
270
|
+
G
|
271
|
+
|
272
|
+
lockfile_should_be <<-G
|
273
|
+
GEM
|
274
|
+
remote: file:#{gem_repo1}/
|
275
|
+
specs:
|
276
|
+
actionpack (2.3.2)
|
277
|
+
activesupport (= 2.3.2)
|
278
|
+
activesupport (2.3.2)
|
279
|
+
rack (1.0.0)
|
280
|
+
rack-obama (1.0)
|
281
|
+
rack
|
282
|
+
thin (1.0)
|
283
|
+
rack
|
284
|
+
|
285
|
+
PLATFORMS
|
286
|
+
#{generic(Gem::Platform.local)}
|
287
|
+
|
288
|
+
DEPENDENCIES
|
289
|
+
actionpack
|
290
|
+
rack-obama
|
291
|
+
thin
|
292
|
+
G
|
293
|
+
end
|
294
|
+
|
295
|
+
it "order dependencies of dependencies in alphabetical order" do
|
296
|
+
install_gemfile <<-G
|
297
|
+
source "file://#{gem_repo1}"
|
298
|
+
|
299
|
+
gem "rails"
|
300
|
+
G
|
301
|
+
|
302
|
+
lockfile_should_be <<-G
|
303
|
+
GEM
|
304
|
+
remote: file:#{gem_repo1}/
|
305
|
+
specs:
|
306
|
+
actionmailer (2.3.2)
|
307
|
+
activesupport (= 2.3.2)
|
308
|
+
actionpack (2.3.2)
|
309
|
+
activesupport (= 2.3.2)
|
310
|
+
activerecord (2.3.2)
|
311
|
+
activesupport (= 2.3.2)
|
312
|
+
activeresource (2.3.2)
|
313
|
+
activesupport (= 2.3.2)
|
314
|
+
activesupport (2.3.2)
|
315
|
+
rails (2.3.2)
|
316
|
+
actionmailer (= 2.3.2)
|
317
|
+
actionpack (= 2.3.2)
|
318
|
+
activerecord (= 2.3.2)
|
319
|
+
activeresource (= 2.3.2)
|
320
|
+
rake (= 0.8.7)
|
321
|
+
rake (0.8.7)
|
322
|
+
|
323
|
+
PLATFORMS
|
324
|
+
#{generic(Gem::Platform.local)}
|
325
|
+
|
326
|
+
DEPENDENCIES
|
327
|
+
rails
|
328
|
+
G
|
329
|
+
end
|
330
|
+
|
331
|
+
it "orders dependencies according to version" do
|
332
|
+
install_gemfile <<-G
|
333
|
+
source "file://#{gem_repo1}"
|
334
|
+
gem 'double_deps'
|
335
|
+
G
|
336
|
+
|
337
|
+
lockfile_should_be <<-G
|
338
|
+
GEM
|
339
|
+
remote: file:#{gem_repo1}/
|
340
|
+
specs:
|
341
|
+
double_deps (1.0)
|
342
|
+
net-ssh
|
343
|
+
net-ssh (>= 1.0.0)
|
344
|
+
net-ssh (1.0)
|
345
|
+
|
346
|
+
PLATFORMS
|
347
|
+
#{generic(Gem::Platform.local)}
|
348
|
+
|
349
|
+
DEPENDENCIES
|
350
|
+
double_deps
|
351
|
+
G
|
352
|
+
end
|
353
|
+
|
354
|
+
it "does not add the :require option to the lockfile" do
|
355
|
+
install_gemfile <<-G
|
356
|
+
source "file://#{gem_repo1}"
|
357
|
+
|
358
|
+
gem "rack-obama", ">= 1.0", :require => "rack/obama"
|
359
|
+
G
|
360
|
+
|
361
|
+
lockfile_should_be <<-G
|
362
|
+
GEM
|
363
|
+
remote: file:#{gem_repo1}/
|
364
|
+
specs:
|
365
|
+
rack (1.0.0)
|
366
|
+
rack-obama (1.0)
|
367
|
+
rack
|
368
|
+
|
369
|
+
PLATFORMS
|
370
|
+
#{generic(Gem::Platform.local)}
|
371
|
+
|
372
|
+
DEPENDENCIES
|
373
|
+
rack-obama (>= 1.0)
|
374
|
+
G
|
375
|
+
end
|
376
|
+
|
377
|
+
it "does not add the :group option to the lockfile" do
|
378
|
+
install_gemfile <<-G
|
379
|
+
source "file://#{gem_repo1}"
|
380
|
+
|
381
|
+
gem "rack-obama", ">= 1.0", :group => :test
|
382
|
+
G
|
383
|
+
|
384
|
+
lockfile_should_be <<-G
|
385
|
+
GEM
|
386
|
+
remote: file:#{gem_repo1}/
|
387
|
+
specs:
|
388
|
+
rack (1.0.0)
|
389
|
+
rack-obama (1.0)
|
390
|
+
rack
|
391
|
+
|
392
|
+
PLATFORMS
|
393
|
+
#{generic(Gem::Platform.local)}
|
394
|
+
|
395
|
+
DEPENDENCIES
|
396
|
+
rack-obama (>= 1.0)
|
397
|
+
G
|
398
|
+
end
|
399
|
+
|
400
|
+
it "stores relative paths when the path is provided in a relative fashion and in Gemfile dir" do
|
401
|
+
build_lib "foo", :path => bundled_app('foo')
|
402
|
+
|
403
|
+
install_gemfile <<-G
|
404
|
+
path "foo"
|
405
|
+
gem "foo"
|
406
|
+
G
|
407
|
+
|
408
|
+
lockfile_should_be <<-G
|
409
|
+
PATH
|
410
|
+
remote: foo
|
411
|
+
specs:
|
412
|
+
foo (1.0)
|
413
|
+
|
414
|
+
GEM
|
415
|
+
specs:
|
416
|
+
|
417
|
+
PLATFORMS
|
418
|
+
#{generic(Gem::Platform.local)}
|
419
|
+
|
420
|
+
DEPENDENCIES
|
421
|
+
foo
|
422
|
+
G
|
423
|
+
end
|
424
|
+
|
425
|
+
it "stores relative paths when the path is provided in a relative fashion and is above Gemfile dir" do
|
426
|
+
build_lib "foo", :path => bundled_app(File.join('..', 'foo'))
|
427
|
+
|
428
|
+
install_gemfile <<-G
|
429
|
+
path "../foo"
|
430
|
+
gem "foo"
|
431
|
+
G
|
432
|
+
|
433
|
+
lockfile_should_be <<-G
|
434
|
+
PATH
|
435
|
+
remote: ../foo
|
436
|
+
specs:
|
437
|
+
foo (1.0)
|
438
|
+
|
439
|
+
GEM
|
440
|
+
specs:
|
441
|
+
|
442
|
+
PLATFORMS
|
443
|
+
#{generic(Gem::Platform.local)}
|
444
|
+
|
445
|
+
DEPENDENCIES
|
446
|
+
foo
|
447
|
+
G
|
448
|
+
end
|
449
|
+
|
450
|
+
it "stores relative paths when the path is provided in an absolute fashion but is relative" do
|
451
|
+
build_lib "foo", :path => bundled_app('foo')
|
452
|
+
|
453
|
+
install_gemfile <<-G
|
454
|
+
path File.expand_path("../foo", __FILE__)
|
455
|
+
gem "foo"
|
456
|
+
G
|
457
|
+
|
458
|
+
lockfile_should_be <<-G
|
459
|
+
PATH
|
460
|
+
remote: foo
|
461
|
+
specs:
|
462
|
+
foo (1.0)
|
463
|
+
|
464
|
+
GEM
|
465
|
+
specs:
|
466
|
+
|
467
|
+
PLATFORMS
|
468
|
+
#{generic(Gem::Platform.local)}
|
469
|
+
|
470
|
+
DEPENDENCIES
|
471
|
+
foo
|
472
|
+
G
|
473
|
+
end
|
474
|
+
|
475
|
+
it "keeps existing platforms in the lockfile" do
|
476
|
+
lockfile <<-G
|
477
|
+
GEM
|
478
|
+
remote: file:#{gem_repo1}/
|
479
|
+
specs:
|
480
|
+
rack (1.0.0)
|
481
|
+
|
482
|
+
PLATFORMS
|
483
|
+
java
|
484
|
+
|
485
|
+
DEPENDENCIES
|
486
|
+
rack
|
487
|
+
G
|
488
|
+
|
489
|
+
install_gemfile <<-G
|
490
|
+
source "file://#{gem_repo1}"
|
491
|
+
|
492
|
+
gem "rack"
|
493
|
+
G
|
494
|
+
|
495
|
+
platforms = ['java', generic(Gem::Platform.local).to_s].sort
|
496
|
+
|
497
|
+
lockfile_should_be <<-G
|
498
|
+
GEM
|
499
|
+
remote: file:#{gem_repo1}/
|
500
|
+
specs:
|
501
|
+
rack (1.0.0)
|
502
|
+
|
503
|
+
PLATFORMS
|
504
|
+
#{platforms[0]}
|
505
|
+
#{platforms[1]}
|
506
|
+
|
507
|
+
DEPENDENCIES
|
508
|
+
rack
|
509
|
+
G
|
510
|
+
end
|
511
|
+
|
512
|
+
it "persists the spec's platform to the lockfile" do
|
513
|
+
build_gem "platform_specific", "1.0.0", :to_system => true do |s|
|
514
|
+
s.platform = Gem::Platform.new('universal-java-16')
|
515
|
+
end
|
516
|
+
|
517
|
+
simulate_platform "universal-java-16"
|
518
|
+
|
519
|
+
install_gemfile <<-G
|
520
|
+
source "file://#{gem_repo1}"
|
521
|
+
gem "platform_specific"
|
522
|
+
G
|
523
|
+
|
524
|
+
lockfile_should_be <<-G
|
525
|
+
GEM
|
526
|
+
remote: file:#{gem_repo1}/
|
527
|
+
specs:
|
528
|
+
platform_specific (1.0-java)
|
529
|
+
|
530
|
+
PLATFORMS
|
531
|
+
java
|
532
|
+
|
533
|
+
DEPENDENCIES
|
534
|
+
platform_specific
|
535
|
+
G
|
536
|
+
end
|
537
|
+
|
538
|
+
it "does not add duplicate gems" do
|
539
|
+
install_gemfile <<-G
|
540
|
+
source "file://#{gem_repo1}"
|
541
|
+
gem "rack"
|
542
|
+
G
|
543
|
+
|
544
|
+
install_gemfile <<-G
|
545
|
+
source "file://#{gem_repo1}"
|
546
|
+
gem "rack"
|
547
|
+
gem "activesupport"
|
548
|
+
G
|
549
|
+
|
550
|
+
lockfile_should_be <<-G
|
551
|
+
GEM
|
552
|
+
remote: file:#{gem_repo1}/
|
553
|
+
specs:
|
554
|
+
activesupport (2.3.5)
|
555
|
+
rack (1.0.0)
|
556
|
+
|
557
|
+
PLATFORMS
|
558
|
+
ruby
|
559
|
+
|
560
|
+
DEPENDENCIES
|
561
|
+
activesupport
|
562
|
+
rack
|
563
|
+
G
|
564
|
+
end
|
565
|
+
|
566
|
+
it "does not add duplicate dependencies" do
|
567
|
+
install_gemfile <<-G
|
568
|
+
source "file://#{gem_repo1}"
|
569
|
+
gem "rack"
|
570
|
+
gem "rack"
|
571
|
+
G
|
572
|
+
|
573
|
+
lockfile_should_be <<-G
|
574
|
+
GEM
|
575
|
+
remote: file:#{gem_repo1}/
|
576
|
+
specs:
|
577
|
+
rack (1.0.0)
|
578
|
+
|
579
|
+
PLATFORMS
|
580
|
+
ruby
|
581
|
+
|
582
|
+
DEPENDENCIES
|
583
|
+
rack
|
584
|
+
G
|
585
|
+
end
|
586
|
+
|
587
|
+
it "does not add duplicate dependencies with versions" do
|
588
|
+
install_gemfile <<-G
|
589
|
+
source "file://#{gem_repo1}"
|
590
|
+
gem "rack", "1.0"
|
591
|
+
gem "rack", "1.0"
|
592
|
+
G
|
593
|
+
|
594
|
+
lockfile_should_be <<-G
|
595
|
+
GEM
|
596
|
+
remote: file:#{gem_repo1}/
|
597
|
+
specs:
|
598
|
+
rack (1.0.0)
|
599
|
+
|
600
|
+
PLATFORMS
|
601
|
+
ruby
|
602
|
+
|
603
|
+
DEPENDENCIES
|
604
|
+
rack (= 1.0)
|
605
|
+
G
|
606
|
+
end
|
607
|
+
|
608
|
+
it "does not add duplicate dependencies in different groups" do
|
609
|
+
install_gemfile <<-G
|
610
|
+
source "file://#{gem_repo1}"
|
611
|
+
gem "rack", "1.0", :group => :one
|
612
|
+
gem "rack", "1.0", :group => :two
|
613
|
+
G
|
614
|
+
|
615
|
+
lockfile_should_be <<-G
|
616
|
+
GEM
|
617
|
+
remote: file:#{gem_repo1}/
|
618
|
+
specs:
|
619
|
+
rack (1.0.0)
|
620
|
+
|
621
|
+
PLATFORMS
|
622
|
+
ruby
|
623
|
+
|
624
|
+
DEPENDENCIES
|
625
|
+
rack (= 1.0)
|
626
|
+
G
|
627
|
+
end
|
628
|
+
|
629
|
+
it "raises if two different versions are used" do
|
630
|
+
install_gemfile <<-G
|
631
|
+
source "file://#{gem_repo1}"
|
632
|
+
gem "rack", "1.0"
|
633
|
+
gem "rack", "1.1"
|
634
|
+
G
|
635
|
+
|
636
|
+
bundled_app("Gemfile.lock").should_not exist
|
637
|
+
out.should include "rack (= 1.0) and rack (= 1.1)"
|
638
|
+
end
|
639
|
+
|
640
|
+
|
641
|
+
it "raises if two different versions are used" do
|
642
|
+
install_gemfile <<-G
|
643
|
+
source "file://#{gem_repo1}"
|
644
|
+
gem "rack"
|
645
|
+
gem "rack", :git => "git://hubz.com"
|
646
|
+
G
|
647
|
+
|
648
|
+
bundled_app("Gemfile.lock").should_not exist
|
649
|
+
out.should include "rack (>= 0) should come from an unspecfied source and git://hubz.com (at master)"
|
650
|
+
end
|
651
|
+
|
652
|
+
it "works correctly with multiple version dependencies" do
|
653
|
+
install_gemfile <<-G
|
654
|
+
source "file://#{gem_repo1}"
|
655
|
+
gem "rack", "> 0.9", "< 1.0"
|
656
|
+
G
|
657
|
+
|
658
|
+
lockfile_should_be <<-G
|
659
|
+
GEM
|
660
|
+
remote: file:#{gem_repo1}/
|
661
|
+
specs:
|
662
|
+
rack (0.9.1)
|
663
|
+
|
664
|
+
PLATFORMS
|
665
|
+
ruby
|
666
|
+
|
667
|
+
DEPENDENCIES
|
668
|
+
rack (> 0.9, < 1.0)
|
669
|
+
G
|
670
|
+
|
671
|
+
end
|
672
|
+
|
673
|
+
# Some versions of the Bundler 1.1 RC series introduced corrupted
|
674
|
+
# lockfiles. There were two major problems:
|
675
|
+
#
|
676
|
+
# * multiple copies of the same GIT section appeared in the lockfile
|
677
|
+
# * when this happened, those sections got multiple copies of gems
|
678
|
+
# in those sections.
|
679
|
+
it "fix corrupted lockfiles" do
|
680
|
+
build_git "omg", :path => lib_path('omg')
|
681
|
+
revision = revision_for(lib_path('omg'))
|
682
|
+
|
683
|
+
gemfile <<-G
|
684
|
+
source "file://#{gem_repo1}"
|
685
|
+
gem "omg", :git => "#{lib_path('omg')}", :branch => 'master'
|
686
|
+
G
|
687
|
+
|
688
|
+
bundle "install --path vendor"
|
689
|
+
should_be_installed "omg 1.0"
|
690
|
+
|
691
|
+
# Create a Gemfile.lock that has duplicate GIT sections
|
692
|
+
lockfile <<-L
|
693
|
+
GIT
|
694
|
+
remote: #{lib_path('omg')}
|
695
|
+
revision: #{revision}
|
696
|
+
branch: master
|
697
|
+
specs:
|
698
|
+
omg (1.0)
|
699
|
+
|
700
|
+
GIT
|
701
|
+
remote: #{lib_path('omg')}
|
702
|
+
revision: #{revision}
|
703
|
+
branch: master
|
704
|
+
specs:
|
705
|
+
omg (1.0)
|
706
|
+
|
707
|
+
GEM
|
708
|
+
remote: file:#{gem_repo1}/
|
709
|
+
specs:
|
710
|
+
|
711
|
+
PLATFORMS
|
712
|
+
#{local}
|
713
|
+
|
714
|
+
DEPENDENCIES
|
715
|
+
omg!
|
716
|
+
L
|
717
|
+
|
718
|
+
FileUtils.rm_rf(bundled_app('vendor'))
|
719
|
+
bundle "install"
|
720
|
+
should_be_installed "omg 1.0"
|
721
|
+
|
722
|
+
# Confirm that duplicate specs do not appear
|
723
|
+
File.read(bundled_app('Gemfile.lock')).should == strip_whitespace(<<-L)
|
724
|
+
GIT
|
725
|
+
remote: #{lib_path('omg')}
|
726
|
+
revision: #{revision}
|
727
|
+
branch: master
|
728
|
+
specs:
|
729
|
+
omg (1.0)
|
730
|
+
|
731
|
+
GEM
|
732
|
+
remote: file:#{gem_repo1}/
|
733
|
+
specs:
|
734
|
+
|
735
|
+
PLATFORMS
|
736
|
+
#{local}
|
737
|
+
|
738
|
+
DEPENDENCIES
|
739
|
+
omg!
|
740
|
+
L
|
741
|
+
end
|
742
|
+
|
743
|
+
describe "line endings" do
|
744
|
+
def set_lockfile_mtime_to_known_value
|
745
|
+
time = Time.local(2000, 1, 1, 0, 0, 0)
|
746
|
+
File.utime(time, time, bundled_app('Gemfile.lock'))
|
747
|
+
end
|
748
|
+
before(:each) do
|
749
|
+
build_repo2
|
750
|
+
install_gemfile <<-G
|
751
|
+
source "file://#{gem_repo2}"
|
752
|
+
gem "rack"
|
753
|
+
G
|
754
|
+
set_lockfile_mtime_to_known_value
|
755
|
+
end
|
756
|
+
|
757
|
+
it "generates Gemfile.lock with \\n line endings" do
|
758
|
+
File.read(bundled_app("Gemfile.lock")).should_not match("\r\n")
|
759
|
+
should_be_installed "rack 1.0"
|
760
|
+
end
|
761
|
+
|
762
|
+
context "during updates" do
|
763
|
+
|
764
|
+
it "preserves Gemfile.lock \\n line endings" do
|
765
|
+
update_repo2
|
766
|
+
|
767
|
+
lambda { bundle "update" }.should change { File.mtime(bundled_app('Gemfile.lock')) }
|
768
|
+
File.read(bundled_app("Gemfile.lock")).should_not match("\r\n")
|
769
|
+
should_be_installed "rack 1.2"
|
770
|
+
end
|
771
|
+
|
772
|
+
it "preserves Gemfile.lock \\n\\r line endings" do
|
773
|
+
update_repo2
|
774
|
+
win_lock = File.read(bundled_app("Gemfile.lock")).gsub(/\n/, "\r\n")
|
775
|
+
File.open(bundled_app("Gemfile.lock"), "wb"){|f| f.puts(win_lock) }
|
776
|
+
set_lockfile_mtime_to_known_value
|
777
|
+
|
778
|
+
lambda { bundle "update" }.should change { File.mtime(bundled_app('Gemfile.lock')) }
|
779
|
+
File.read(bundled_app("Gemfile.lock")).should match("\r\n")
|
780
|
+
should_be_installed "rack 1.2"
|
781
|
+
end
|
782
|
+
end
|
783
|
+
|
784
|
+
context "when nothing changes" do
|
785
|
+
|
786
|
+
it "preserves Gemfile.lock \\n line endings" do
|
787
|
+
lambda { ruby <<-RUBY
|
788
|
+
require 'rubygems'
|
789
|
+
require 'bundler'
|
790
|
+
Bundler.setup
|
791
|
+
RUBY
|
792
|
+
}.should_not change { File.mtime(bundled_app('Gemfile.lock')) }
|
793
|
+
end
|
794
|
+
|
795
|
+
it "preserves Gemfile.lock \\n\\r line endings" do
|
796
|
+
win_lock = File.read(bundled_app("Gemfile.lock")).gsub(/\n/, "\r\n")
|
797
|
+
File.open(bundled_app("Gemfile.lock"), "wb"){|f| f.puts(win_lock) }
|
798
|
+
set_lockfile_mtime_to_known_value
|
799
|
+
|
800
|
+
lambda { ruby <<-RUBY
|
801
|
+
require 'rubygems'
|
802
|
+
require 'bundler'
|
803
|
+
Bundler.setup
|
804
|
+
RUBY
|
805
|
+
}.should_not change { File.mtime(bundled_app('Gemfile.lock')) }
|
806
|
+
end
|
807
|
+
end
|
808
|
+
end
|
809
|
+
end
|