bundler 1.7.15 → 1.8.0.pre

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 (191) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +5 -14
  3. data/.rspec +1 -0
  4. data/.travis.yml +22 -15
  5. data/CHANGELOG.md +43 -13
  6. data/CODE_OF_CONDUCT.md +40 -0
  7. data/CONTRIBUTING.md +14 -12
  8. data/DEVELOPMENT.md +4 -2
  9. data/ISSUES.md +1 -1
  10. data/README.md +10 -14
  11. data/Rakefile +10 -10
  12. data/bin/bundle +1 -1
  13. data/bundler.gemspec +5 -4
  14. data/lib/bundler.rb +22 -3
  15. data/lib/bundler/anonymizable_uri.rb +24 -8
  16. data/lib/bundler/cli.rb +103 -66
  17. data/lib/bundler/cli/cache.rb +1 -0
  18. data/lib/bundler/cli/clean.rb +11 -4
  19. data/lib/bundler/cli/common.rb +2 -0
  20. data/lib/bundler/cli/console.rb +22 -26
  21. data/lib/bundler/cli/exec.rb +29 -22
  22. data/lib/bundler/cli/gem.rb +125 -37
  23. data/lib/bundler/cli/install.rb +22 -9
  24. data/lib/bundler/cli/outdated.rb +1 -1
  25. data/lib/bundler/cli/package.rb +8 -1
  26. data/lib/bundler/cli/show.rb +29 -3
  27. data/lib/bundler/cli/update.rb +2 -2
  28. data/lib/bundler/cli/viz.rb +1 -1
  29. data/lib/bundler/definition.rb +14 -22
  30. data/lib/bundler/dependency.rb +8 -1
  31. data/lib/bundler/dsl.rb +17 -4
  32. data/lib/bundler/endpoint_specification.rb +1 -1
  33. data/lib/bundler/env.rb +44 -25
  34. data/lib/bundler/fetcher.rb +33 -25
  35. data/lib/bundler/friendly_errors.rb +38 -5
  36. data/lib/bundler/gem_helper.rb +16 -10
  37. data/lib/bundler/gem_helpers.rb +1 -0
  38. data/lib/bundler/graph.rb +4 -1
  39. data/lib/bundler/index.rb +15 -25
  40. data/lib/bundler/installer.rb +6 -6
  41. data/lib/bundler/lockfile_parser.rb +7 -7
  42. data/lib/bundler/resolver.rb +2 -1
  43. data/lib/bundler/ruby_version.rb +1 -1
  44. data/lib/bundler/rubygems_ext.rb +1 -0
  45. data/lib/bundler/rubygems_integration.rb +1 -1
  46. data/lib/bundler/runtime.rb +22 -40
  47. data/lib/bundler/settings.rb +14 -5
  48. data/lib/bundler/setup.rb +2 -1
  49. data/lib/bundler/shared_helpers.rb +56 -4
  50. data/lib/bundler/source.rb +8 -9
  51. data/lib/bundler/source/git.rb +5 -1
  52. data/lib/bundler/source/git/git_proxy.rb +4 -0
  53. data/lib/bundler/source/path.rb +8 -11
  54. data/lib/bundler/source/path/installer.rb +0 -2
  55. data/lib/bundler/source/rubygems.rb +58 -72
  56. data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +13 -0
  57. data/lib/bundler/templates/newgem/LICENSE.txt.tt +17 -18
  58. data/lib/bundler/templates/newgem/README.md.tt +9 -1
  59. data/lib/bundler/templates/newgem/Rakefile.tt +2 -0
  60. data/lib/bundler/templates/newgem/bin/console.tt +14 -0
  61. data/lib/bundler/templates/newgem/bin/setup.tt +7 -0
  62. data/lib/bundler/templates/newgem/exe/newgem.tt +3 -0
  63. data/lib/bundler/templates/newgem/gitignore.tt +2 -0
  64. data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +1 -1
  65. data/lib/bundler/templates/newgem/newgem.gemspec.tt +17 -13
  66. data/lib/bundler/templates/newgem/test/test_newgem.rb.tt +1 -1
  67. data/lib/bundler/ui/shell.rb +1 -1
  68. data/lib/bundler/version.rb +1 -1
  69. data/lib/bundler/worker.rb +73 -0
  70. data/man/bundle-config.ronn +17 -15
  71. data/man/bundle-install.ronn +102 -93
  72. data/man/bundle-update.ronn +39 -30
  73. data/man/bundle.ronn +6 -0
  74. data/man/gemfile.5.ronn +74 -13
  75. metadata +10 -231
  76. data/lib/bundler/parallel_workers.rb +0 -18
  77. data/lib/bundler/parallel_workers/thread_worker.rb +0 -30
  78. data/lib/bundler/parallel_workers/unix_worker.rb +0 -101
  79. data/lib/bundler/parallel_workers/worker.rb +0 -69
  80. data/lib/bundler/templates/newgem/bin/newgem.tt +0 -3
  81. data/spec/bundler/anonymizable_uri_spec.rb +0 -32
  82. data/spec/bundler/bundler_spec.rb +0 -72
  83. data/spec/bundler/cli_spec.rb +0 -16
  84. data/spec/bundler/definition_spec.rb +0 -22
  85. data/spec/bundler/dsl_spec.rb +0 -82
  86. data/spec/bundler/friendly_errors_spec.rb +0 -13
  87. data/spec/bundler/gem_helper_spec.rb +0 -226
  88. data/spec/bundler/psyched_yaml_spec.rb +0 -8
  89. data/spec/bundler/retry_spec.rb +0 -59
  90. data/spec/bundler/settings_spec.rb +0 -13
  91. data/spec/bundler/source/rubygems_spec.rb +0 -25
  92. data/spec/bundler/source_list_spec.rb +0 -361
  93. data/spec/cache/gems_spec.rb +0 -284
  94. data/spec/cache/git_spec.rb +0 -188
  95. data/spec/cache/path_spec.rb +0 -121
  96. data/spec/cache/platform_spec.rb +0 -57
  97. data/spec/commands/binstubs_spec.rb +0 -219
  98. data/spec/commands/check_spec.rb +0 -278
  99. data/spec/commands/clean_spec.rb +0 -592
  100. data/spec/commands/config_spec.rb +0 -263
  101. data/spec/commands/console_spec.rb +0 -76
  102. data/spec/commands/exec_spec.rb +0 -309
  103. data/spec/commands/help_spec.rb +0 -39
  104. data/spec/commands/init_spec.rb +0 -39
  105. data/spec/commands/inject_spec.rb +0 -78
  106. data/spec/commands/licenses_spec.rb +0 -18
  107. data/spec/commands/newgem_spec.rb +0 -428
  108. data/spec/commands/open_spec.rb +0 -68
  109. data/spec/commands/outdated_spec.rb +0 -156
  110. data/spec/commands/package_spec.rb +0 -114
  111. data/spec/commands/show_spec.rb +0 -125
  112. data/spec/install/binstubs_spec.rb +0 -24
  113. data/spec/install/bundler_spec.rb +0 -146
  114. data/spec/install/deploy_spec.rb +0 -250
  115. data/spec/install/gemfile/gemspec_spec.rb +0 -170
  116. data/spec/install/gemfile/git_spec.rb +0 -967
  117. data/spec/install/gemfile/path_spec.rb +0 -500
  118. data/spec/install/gemfile_spec.rb +0 -44
  119. data/spec/install/gems/c_ext_spec.rb +0 -48
  120. data/spec/install/gems/dependency_api_spec.rb +0 -652
  121. data/spec/install/gems/env_spec.rb +0 -107
  122. data/spec/install/gems/flex_spec.rb +0 -314
  123. data/spec/install/gems/groups_spec.rb +0 -308
  124. data/spec/install/gems/mirror_spec.rb +0 -39
  125. data/spec/install/gems/platform_spec.rb +0 -195
  126. data/spec/install/gems/post_install_spec.rb +0 -121
  127. data/spec/install/gems/resolving_spec.rb +0 -124
  128. data/spec/install/gems/simple_case_spec.rb +0 -377
  129. data/spec/install/gems/sources_spec.rb +0 -386
  130. data/spec/install/gems/standalone_spec.rb +0 -260
  131. data/spec/install/gems/sudo_spec.rb +0 -136
  132. data/spec/install/gems/win32_spec.rb +0 -26
  133. data/spec/install/gemspecs_spec.rb +0 -50
  134. data/spec/install/path_spec.rb +0 -150
  135. data/spec/install/post_bundle_message_spec.rb +0 -142
  136. data/spec/install/prereleases_spec.rb +0 -43
  137. data/spec/install/security_policy_spec.rb +0 -77
  138. data/spec/install/upgrade_spec.rb +0 -26
  139. data/spec/lock/git_spec.rb +0 -34
  140. data/spec/lock/lockfile_spec.rb +0 -924
  141. data/spec/other/bundle_ruby_spec.rb +0 -142
  142. data/spec/other/cli_dispatch_spec.rb +0 -21
  143. data/spec/other/ext_spec.rb +0 -60
  144. data/spec/other/platform_spec.rb +0 -1285
  145. data/spec/other/ssl_cert_spec.rb +0 -23
  146. data/spec/quality_spec.rb +0 -88
  147. data/spec/realworld/dependency_api_spec.rb +0 -60
  148. data/spec/realworld/edgecases_spec.rb +0 -212
  149. data/spec/realworld/parallel_spec.rb +0 -71
  150. data/spec/resolver/basic_spec.rb +0 -66
  151. data/spec/resolver/platform_spec.rb +0 -88
  152. data/spec/runtime/executable_spec.rb +0 -149
  153. data/spec/runtime/load_spec.rb +0 -107
  154. data/spec/runtime/platform_spec.rb +0 -90
  155. data/spec/runtime/require_spec.rb +0 -332
  156. data/spec/runtime/setup_spec.rb +0 -853
  157. data/spec/runtime/with_clean_env_spec.rb +0 -91
  158. data/spec/spec_helper.rb +0 -123
  159. data/spec/support/artifice/endopint_marshal_fail_basic_authentication.rb +0 -13
  160. data/spec/support/artifice/endpoint.rb +0 -71
  161. data/spec/support/artifice/endpoint_500.rb +0 -37
  162. data/spec/support/artifice/endpoint_api_forbidden.rb +0 -11
  163. data/spec/support/artifice/endpoint_api_missing.rb +0 -16
  164. data/spec/support/artifice/endpoint_basic_authentication.rb +0 -13
  165. data/spec/support/artifice/endpoint_creds_diff_host.rb +0 -38
  166. data/spec/support/artifice/endpoint_extra.rb +0 -31
  167. data/spec/support/artifice/endpoint_extra_api.rb +0 -32
  168. data/spec/support/artifice/endpoint_extra_missing.rb +0 -15
  169. data/spec/support/artifice/endpoint_fallback.rb +0 -17
  170. data/spec/support/artifice/endpoint_host_redirect.rb +0 -15
  171. data/spec/support/artifice/endpoint_marshal_fail.rb +0 -11
  172. data/spec/support/artifice/endpoint_redirect.rb +0 -15
  173. data/spec/support/artifice/endpoint_strict_basic_authentication.rb +0 -18
  174. data/spec/support/artifice/endpoint_timeout.rb +0 -13
  175. data/spec/support/builders.rb +0 -693
  176. data/spec/support/fakeweb/rack-1.0.0.marshal +0 -2
  177. data/spec/support/fakeweb/windows.rb +0 -23
  178. data/spec/support/hax.rb +0 -22
  179. data/spec/support/helpers.rb +0 -361
  180. data/spec/support/indexes.rb +0 -280
  181. data/spec/support/matchers.rb +0 -77
  182. data/spec/support/path.rb +0 -85
  183. data/spec/support/permissions.rb +0 -10
  184. data/spec/support/platforms.rb +0 -94
  185. data/spec/support/ruby_ext.rb +0 -20
  186. data/spec/support/rubygems_ext.rb +0 -39
  187. data/spec/support/streams.rb +0 -13
  188. data/spec/support/sudo.rb +0 -16
  189. data/spec/update/gems_spec.rb +0 -201
  190. data/spec/update/git_spec.rb +0 -283
  191. data/spec/update/path_spec.rb +0 -18
@@ -1,284 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe "bundle cache" do
4
-
5
- describe "when there are only gemsources" do
6
- before :each do
7
- gemfile <<-G
8
- gem 'rack'
9
- G
10
-
11
- system_gems "rack-1.0.0"
12
- bundle :cache
13
- end
14
-
15
- it "copies the .gem file to vendor/cache" do
16
- expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
17
- end
18
-
19
- it "uses the cache as a source when installing gems" do
20
- build_gem "omg", :path => bundled_app('vendor/cache')
21
-
22
- install_gemfile <<-G
23
- source "file://#{gem_repo1}"
24
- gem "omg"
25
- G
26
-
27
- should_be_installed "omg 1.0.0"
28
- end
29
-
30
- it "uses the cache as a source when installing gems with --local" do
31
- system_gems []
32
- bundle "install --local"
33
-
34
- should_be_installed("rack 1.0.0")
35
- end
36
-
37
- it "does not reinstall gems from the cache if they exist on the system" do
38
- build_gem "rack", "1.0.0", :path => bundled_app('vendor/cache') do |s|
39
- s.write "lib/rack.rb", "RACK = 'FAIL'"
40
- end
41
-
42
- install_gemfile <<-G
43
- gem "rack"
44
- G
45
-
46
- should_be_installed("rack 1.0.0")
47
- end
48
-
49
- it "does not reinstall gems from the cache if they exist in the bundle" do
50
- system_gems "rack-1.0.0"
51
-
52
- gemfile <<-G
53
- gem "rack"
54
- G
55
-
56
- build_gem "rack", "1.0.0", :path => bundled_app('vendor/cache') do |s|
57
- s.write "lib/rack.rb", "RACK = 'FAIL'"
58
- end
59
-
60
- bundle "install --local"
61
- should_be_installed("rack 1.0.0")
62
- end
63
-
64
- it "creates a lockfile" do
65
- cache_gems "rack-1.0.0"
66
-
67
- gemfile <<-G
68
- gem "rack"
69
- G
70
-
71
- bundle "cache"
72
-
73
- expect(bundled_app("Gemfile.lock")).to exist
74
- end
75
- end
76
-
77
- describe "when there is a built-in gem", :ruby => "2.0" do
78
- before :each do
79
- build_repo2 do
80
- build_gem "builtin_gem", "1.0.2"
81
- end
82
-
83
- build_gem "builtin_gem", "1.0.2", :to_system => true do |s|
84
- s.summary = "This builtin_gem is bundled with Ruby"
85
- end
86
-
87
- FileUtils.rm("#{system_gem_path}/cache/builtin_gem-1.0.2.gem")
88
- end
89
-
90
- it "uses builtin gems" do
91
- install_gemfile %|gem 'builtin_gem', '1.0.2'|
92
- should_be_installed("builtin_gem 1.0.2")
93
- end
94
-
95
- it "caches remote and builtin gems" do
96
- install_gemfile <<-G
97
- source "file://#{gem_repo2}"
98
- gem 'builtin_gem', '1.0.2'
99
- gem 'rack', '1.0.0'
100
- G
101
-
102
- bundle :cache
103
- expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
104
- expect(bundled_app("vendor/cache/builtin_gem-1.0.2.gem")).to exist
105
- end
106
-
107
- it "doesn't make remote request after caching the gem" do
108
- build_gem "builtin_gem_2", "1.0.2", :path => bundled_app('vendor/cache') do |s|
109
- s.summary = "This builtin_gem is bundled with Ruby"
110
- end
111
-
112
- install_gemfile <<-G
113
- source "file://#{gem_repo2}"
114
- gem 'builtin_gem_2', '1.0.2'
115
- G
116
-
117
- bundle "install --local"
118
- should_be_installed("builtin_gem_2 1.0.2")
119
- end
120
- end
121
-
122
- describe "when there are also git sources" do
123
- before do
124
- build_git "foo"
125
- system_gems "rack-1.0.0"
126
-
127
- install_gemfile <<-G
128
- source "file://#{gem_repo1}"
129
- git "#{lib_path("foo-1.0")}" do
130
- gem 'foo'
131
- end
132
- gem 'rack'
133
- G
134
- end
135
-
136
- it "still works" do
137
- bundle :cache
138
-
139
- system_gems []
140
- bundle "install --local"
141
-
142
- should_be_installed("rack 1.0.0", "foo 1.0")
143
- end
144
-
145
- it "should not explode if the lockfile is not present" do
146
- FileUtils.rm(bundled_app("Gemfile.lock"))
147
-
148
- bundle :cache
149
-
150
- expect(bundled_app("Gemfile.lock")).to exist
151
- end
152
- end
153
-
154
- describe "when previously cached" do
155
- before :each do
156
- build_repo2
157
- install_gemfile <<-G
158
- source "file://#{gem_repo2}"
159
- gem "rack"
160
- gem "actionpack"
161
- G
162
- bundle :cache
163
- expect(cached_gem("rack-1.0.0")).to exist
164
- expect(cached_gem("actionpack-2.3.2")).to exist
165
- expect(cached_gem("activesupport-2.3.2")).to exist
166
- end
167
-
168
- it "re-caches during install" do
169
- cached_gem("rack-1.0.0").rmtree
170
- bundle :install
171
- expect(out).to include("Updating files in vendor/cache")
172
- expect(cached_gem("rack-1.0.0")).to exist
173
- end
174
-
175
- it "adds and removes when gems are updated" do
176
- update_repo2
177
- bundle 'update'
178
- expect(cached_gem("rack-1.2")).to exist
179
- expect(cached_gem("rack-1.0.0")).not_to exist
180
- end
181
-
182
- it "adds new gems and dependencies" do
183
- install_gemfile <<-G
184
- source "file://#{gem_repo2}"
185
- gem "rails"
186
- G
187
- expect(cached_gem("rails-2.3.2")).to exist
188
- expect(cached_gem("activerecord-2.3.2")).to exist
189
- end
190
-
191
- it "removes .gems for removed gems and dependencies" do
192
- install_gemfile <<-G
193
- source "file://#{gem_repo2}"
194
- gem "rack"
195
- G
196
- expect(cached_gem("rack-1.0.0")).to exist
197
- expect(cached_gem("actionpack-2.3.2")).not_to exist
198
- expect(cached_gem("activesupport-2.3.2")).not_to exist
199
- end
200
-
201
- it "removes .gems when gem changes to git source" do
202
- build_git "rack"
203
-
204
- install_gemfile <<-G
205
- source "file://#{gem_repo2}"
206
- gem "rack", :git => "#{lib_path("rack-1.0")}"
207
- gem "actionpack"
208
- G
209
- expect(cached_gem("rack-1.0.0")).not_to exist
210
- expect(cached_gem("actionpack-2.3.2")).to exist
211
- expect(cached_gem("activesupport-2.3.2")).to exist
212
- end
213
-
214
-
215
- it "doesn't remove gems that are for another platform" do
216
- simulate_platform "java" do
217
- install_gemfile <<-G
218
- source "file://#{gem_repo1}"
219
- gem "platform_specific"
220
- G
221
-
222
- bundle :cache
223
- expect(cached_gem("platform_specific-1.0-java")).to exist
224
- end
225
-
226
- simulate_new_machine
227
- install_gemfile <<-G
228
- source "file://#{gem_repo1}"
229
- gem "platform_specific"
230
- G
231
-
232
- expect(cached_gem("platform_specific-1.0-#{Gem::Platform.local}")).to exist
233
- expect(cached_gem("platform_specific-1.0-java")).to exist
234
- end
235
-
236
- it "doesn't remove gems with mismatched :rubygems_version or :date" do
237
- cached_gem("rack-1.0.0").rmtree
238
- build_gem "rack", "1.0.0",
239
- :path => bundled_app('vendor/cache'),
240
- :rubygems_version => "1.3.2"
241
- simulate_new_machine
242
-
243
- bundle :install
244
- expect(cached_gem("rack-1.0.0")).to exist
245
- end
246
-
247
- it "handles directories and non .gem files in the cache" do
248
- bundled_app("vendor/cache/foo").mkdir
249
- File.open(bundled_app("vendor/cache/bar"), 'w'){|f| f.write("not a gem") }
250
- bundle :cache
251
- end
252
-
253
- it "does not say that it is removing gems when it isn't actually doing so" do
254
- install_gemfile <<-G
255
- source "file://#{gem_repo1}"
256
- gem "rack"
257
- G
258
- bundle "cache"
259
- bundle "install"
260
- expect(out).not_to match(/removing/i)
261
- end
262
-
263
- it "does not warn about all if it doesn't have any git/path dependency" do
264
- install_gemfile <<-G
265
- source "file://#{gem_repo1}"
266
- gem "rack"
267
- G
268
- bundle "cache"
269
- expect(out).not_to match(/\-\-all/)
270
- end
271
-
272
- it "should install gems with the name bundler in them (that aren't bundler)" do
273
- build_gem "foo-bundler", "1.0",
274
- :path => bundled_app('vendor/cache')
275
-
276
- install_gemfile <<-G
277
- gem "foo-bundler"
278
- G
279
-
280
- should_be_installed "foo-bundler 1.0"
281
- end
282
- end
283
-
284
- end
@@ -1,188 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe "git base name" do
4
- it "base_name should strip private repo uris" do
5
- source = Bundler::Source::Git.new("uri" => "git@github.com:bundler.git")
6
- expect(source.send(:base_name)).to eq("bundler")
7
- end
8
-
9
- it "base_name should strip network share paths" do
10
- source = Bundler::Source::Git.new("uri" => "//MachineName/ShareFolder")
11
- expect(source.send(:base_name)).to eq("ShareFolder")
12
- end
13
- end
14
-
15
- %w(cache package).each do |cmd|
16
- describe "bundle #{cmd} with git" do
17
- it "copies repository to vendor cache and uses it" do
18
- git = build_git "foo"
19
- ref = git.ref_for("master", 11)
20
-
21
- install_gemfile <<-G
22
- gem "foo", :git => '#{lib_path("foo-1.0")}'
23
- G
24
-
25
- bundle "#{cmd} --all"
26
- expect(bundled_app("vendor/cache/foo-1.0-#{ref}")).to exist
27
- expect(bundled_app("vendor/cache/foo-1.0-#{ref}/.git")).not_to exist
28
- expect(bundled_app("vendor/cache/foo-1.0-#{ref}/.bundlecache")).to be_file
29
-
30
- FileUtils.rm_rf lib_path("foo-1.0")
31
- should_be_installed "foo 1.0"
32
- end
33
-
34
- it "copies repository to vendor cache and uses it even when installed with bundle --path" do
35
- git = build_git "foo"
36
- ref = git.ref_for("master", 11)
37
-
38
- install_gemfile <<-G
39
- gem "foo", :git => '#{lib_path("foo-1.0")}'
40
- G
41
-
42
- bundle "install --path vendor/bundle"
43
- bundle "#{cmd} --all"
44
-
45
- expect(bundled_app("vendor/cache/foo-1.0-#{ref}")).to exist
46
- expect(bundled_app("vendor/cache/foo-1.0-#{ref}/.git")).not_to exist
47
-
48
- FileUtils.rm_rf lib_path("foo-1.0")
49
- should_be_installed "foo 1.0"
50
- end
51
-
52
- it "runs twice without exploding" do
53
- build_git "foo"
54
-
55
- install_gemfile <<-G
56
- gem "foo", :git => '#{lib_path("foo-1.0")}'
57
- G
58
-
59
- bundle "#{cmd} --all"
60
- bundle "#{cmd} --all"
61
-
62
- expect(err).to eq("")
63
- FileUtils.rm_rf lib_path("foo-1.0")
64
- should_be_installed "foo 1.0"
65
- end
66
-
67
- it "tracks updates" do
68
- git = build_git "foo"
69
- old_ref = git.ref_for("master", 11)
70
-
71
- install_gemfile <<-G
72
- gem "foo", :git => '#{lib_path("foo-1.0")}'
73
- G
74
-
75
- bundle "#{cmd} --all"
76
-
77
- update_git "foo" do |s|
78
- s.write "lib/foo.rb", "puts :CACHE"
79
- end
80
-
81
- ref = git.ref_for("master", 11)
82
- expect(ref).not_to eq(old_ref)
83
-
84
- bundle "update"
85
- bundle "#{cmd} --all"
86
-
87
- expect(bundled_app("vendor/cache/foo-1.0-#{ref}")).to exist
88
- expect(bundled_app("vendor/cache/foo-1.0-#{old_ref}")).not_to exist
89
-
90
- FileUtils.rm_rf lib_path("foo-1.0")
91
- run "require 'foo'"
92
- expect(out).to eq("CACHE")
93
- end
94
-
95
- it "uses the local repository to generate the cache" do
96
- git = build_git "foo"
97
- ref = git.ref_for("master", 11)
98
-
99
- gemfile <<-G
100
- gem "foo", :git => '#{lib_path("foo-invalid")}', :branch => :master
101
- G
102
-
103
- bundle %|config local.foo #{lib_path('foo-1.0')}|
104
- bundle "install"
105
- bundle "#{cmd} --all"
106
-
107
- expect(bundled_app("vendor/cache/foo-invalid-#{ref}")).to exist
108
-
109
- # Updating the local still uses the local.
110
- update_git "foo" do |s|
111
- s.write "lib/foo.rb", "puts :LOCAL"
112
- end
113
-
114
- run "require 'foo'"
115
- expect(out).to eq("LOCAL")
116
- end
117
-
118
- it "copies repository to vendor cache, including submodules" do
119
- build_git "submodule", "1.0"
120
-
121
- git = build_git "has_submodule", "1.0" do |s|
122
- s.add_dependency "submodule"
123
- end
124
-
125
- Dir.chdir(lib_path('has_submodule-1.0')) do
126
- `git submodule add #{lib_path('submodule-1.0')} submodule-1.0`
127
- `git commit -m "submodulator"`
128
- end
129
-
130
- install_gemfile <<-G
131
- git "#{lib_path('has_submodule-1.0')}", :submodules => true do
132
- gem "has_submodule"
133
- end
134
- G
135
-
136
- ref = git.ref_for("master", 11)
137
- bundle "#{cmd} --all"
138
-
139
- expect(bundled_app("vendor/cache/has_submodule-1.0-#{ref}")).to exist
140
- expect(bundled_app("vendor/cache/has_submodule-1.0-#{ref}/submodule-1.0")).to exist
141
- should_be_installed "has_submodule 1.0"
142
- end
143
-
144
- it "displays warning message when detecting git repo in Gemfile" do
145
- build_git "foo"
146
-
147
- install_gemfile <<-G
148
- gem "foo", :git => '#{lib_path("foo-1.0")}'
149
- G
150
-
151
- bundle "#{cmd}"
152
-
153
- expect(out).to include("Your Gemfile contains path and git dependencies.")
154
- end
155
-
156
- it "does not display warning message if cache_all is set in bundle config" do
157
- build_git "foo"
158
-
159
- install_gemfile <<-G
160
- gem "foo", :git => '#{lib_path("foo-1.0")}'
161
- G
162
-
163
- bundle "#{cmd} --all"
164
- bundle "#{cmd}"
165
-
166
- expect(out).not_to include("Your Gemfile contains path and git dependencies.")
167
- end
168
-
169
- it "caches pre-evaluated gemspecs" do
170
- git = build_git "foo"
171
-
172
- # Insert a gemspec method that shells out
173
- spec_lines = lib_path("foo-1.0/foo.gemspec").read.split("\n")
174
- spec_lines.insert(-2, "s.description = `echo bob`")
175
- update_git("foo"){ |s| s.write "foo.gemspec", spec_lines.join("\n") }
176
-
177
- install_gemfile <<-G
178
- gem "foo", :git => '#{lib_path("foo-1.0")}'
179
- G
180
- bundle "#{cmd} --all"
181
-
182
- ref = git.ref_for("master", 11)
183
- gemspec = bundled_app("vendor/cache/foo-1.0-#{ref}/foo.gemspec").read
184
- expect(gemspec).to_not match("`echo bob`")
185
- end
186
-
187
- end
188
- end