bundler 1.7.13 → 1.7.14

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.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 52077386a3541d9c2aee5208c378887d8ed4e4fe
4
- data.tar.gz: 5688627918ab06e42226e70e7759ce4adc50f55b
3
+ metadata.gz: 746df673800f5d41fe2d1291b907039aba505909
4
+ data.tar.gz: 85c28b901946ef92a7ffbf9ead8fad33974d563f
5
5
  SHA512:
6
- metadata.gz: 49a73d3536173e9ec53b420df33f946863978625ecf8ce635af8ec55cf6c03428e3d4243a876b6a03531f0e11fb0884204bf415c57063b8e6fdf3c571406ba15
7
- data.tar.gz: 3ec463bd63a4deb40f6a0b30e26c38d4e12878710ec010a6df4d47d8f25b9685483ad27931deeaaa5addc53b9a21a4eae3dc2fef9abad70c59df22ff4812679d
6
+ metadata.gz: f72f1fd05fb6525b87302286252357f7f48cab2f59d30a65fb85ad366ea869f752937077165a78e7bdd1b9461cd9bc7323d9bff45f1fe78f014dd5d4b6675e72
7
+ data.tar.gz: e3e476266759921138364b64d9f7b2e096b5d87ea8329c15c166c1192c96ee34450dd78817847c9dd19e649f92ac6ffe3af894cdd3004aefd3e00929e1336b64
@@ -1,3 +1,10 @@
1
+ ## 1.7.14 (2015-03-30)
2
+
3
+ Bugfixes:
4
+
5
+ - Keep gems locked when updating another gem from the same source (#3250, @indirect)
6
+ - Don't add extra quotes around long, quoted config values (@aroben, #3338)
7
+
1
8
  ## 1.7.13 (2015-02-07)
2
9
 
3
10
  Bugfixes:
@@ -276,7 +276,7 @@ module Bundler
276
276
  each do |spec|
277
277
  next if spec.name == 'bundler'
278
278
  out << spec.to_lock
279
- end
279
+ end
280
280
  out << "\n"
281
281
  end
282
282
 
@@ -558,8 +558,11 @@ module Bundler
558
558
  resolve
559
559
  end
560
560
 
561
- def in_locked_deps?(dep, d)
562
- d && dep.source == d.source
561
+ def in_locked_deps?(dep, locked_dep)
562
+ # Because the lockfile can't link a dep to a specific remote, we need to
563
+ # treat sources as equivalent anytime the locked dep has all the remotes
564
+ # that the Gemfile dep does.
565
+ locked_dep && locked_dep.source && dep.source && locked_dep.source.include?(dep.source)
563
566
  end
564
567
 
565
568
  def satisfies_locked_spec?(dep)
@@ -155,9 +155,10 @@ module Bundler
155
155
  def load_config(config_file)
156
156
  valid_file = config_file && config_file.exist? && !config_file.size.zero?
157
157
  if !ignore_config? && valid_file
158
- config_regex = /^(BUNDLE_.+): (?:['"](.*)['"]|(.+(?:\n(?!BUNDLE).+))|(.+))$/
158
+ config_regex = /^(BUNDLE_.+): (['"]?)(.*(?:\n(?!BUNDLE).+)?)\2$/
159
159
  config_pairs = config_file.read.scan(config_regex).map do |m|
160
- m.compact.map { |n| n.gsub(/\s+/, " ").tr('"', "'") }
160
+ key, _, value = m
161
+ [key, value.gsub(/\s+/, " ").tr('"', "'")]
161
162
  end
162
163
  Hash[config_pairs]
163
164
  else
@@ -33,5 +33,10 @@ module Bundler
33
33
  def can_lock?(spec)
34
34
  spec.source == self
35
35
  end
36
+
37
+ def include?(other)
38
+ other == self
39
+ end
40
+
36
41
  end
37
42
  end
@@ -34,11 +34,15 @@ module Bundler
34
34
  end
35
35
 
36
36
  def eql?(o)
37
- o.is_a?(Rubygems) && remotes_equal?(o.remotes)
37
+ o.is_a?(Rubygems) && o.credless_remotes == credless_remotes
38
38
  end
39
39
 
40
40
  alias == eql?
41
41
 
42
+ def include?(o)
43
+ o.is_a?(Rubygems) && (o.credless_remotes - credless_remotes).empty?
44
+ end
45
+
42
46
  def can_lock?(spec)
43
47
  spec.source.is_a?(Rubygems)
44
48
  end
@@ -186,6 +190,12 @@ module Bundler
186
190
  end
187
191
  end
188
192
 
193
+ protected
194
+
195
+ def credless_remotes
196
+ remotes.map(&method(:suppress_configured_credentials))
197
+ end
198
+
189
199
  private
190
200
 
191
201
  def source_uris_for_spec(spec)
@@ -356,10 +366,6 @@ module Bundler
356
366
  spec.loaded_from && spec.loaded_from.include?("specifications/default/")
357
367
  end
358
368
 
359
- def remotes_equal?(other_remotes)
360
- remotes.map(&method(:suppress_configured_credentials)) == other_remotes.map(&method(:suppress_configured_credentials))
361
- end
362
-
363
369
  end
364
370
  end
365
371
  end
@@ -2,5 +2,5 @@ module Bundler
2
2
  # We're doing this because we might write tests that deal
3
3
  # with other versions of bundler and we are unsure how to
4
4
  # handle this better.
5
- VERSION = "1.7.13" unless defined?(::Bundler::VERSION)
5
+ VERSION = "1.7.14" unless defined?(::Bundler::VERSION)
6
6
  end
@@ -17,13 +17,11 @@ describe Bundler do
17
17
  end
18
18
  end
19
19
 
20
- context "on Ruby 1.8", :ruby => "1.8" do
21
- it "catches YAML syntax errors" do
22
- expect { subject }.to raise_error(Bundler::GemspecError)
23
- end
20
+ it "catches YAML syntax errors" do
21
+ expect { subject }.to raise_error(Bundler::GemspecError)
24
22
  end
25
23
 
26
- context "on Ruby 1.9", :ruby => "1.9" do
24
+ context "on Rubies with a settable YAML engine", :if => defined?(YAML::ENGINE) do
27
25
  context "with Syck as YAML::Engine" do
28
26
  it "raises a GemspecError after YAML load throws ArgumentError" do
29
27
  orig_yamler, YAML::ENGINE.yamler = YAML::ENGINE.yamler, 'syck'
@@ -8,6 +8,7 @@ describe Bundler::GemHelper do
8
8
  let(:app_gemspec_path) { app_path.join("#{app_name}.gemspec") }
9
9
 
10
10
  before(:each) do
11
+ global_config "BUNDLE_GEM__MIT" => "false", "BUNDLE_GEM__TEST" => "false", "BUNDLE_GEM__COC" => "false"
11
12
  bundle "gem #{app_name}"
12
13
  end
13
14
 
@@ -215,14 +215,27 @@ E
215
215
  File.open(bundled_app(".bundle/config"), 'w') do |f|
216
216
  f.write 'BUNDLE_FOO: "$BUILD_DIR"'
217
217
  end
218
- expect(bundled_app(".bundle/config").read).to eq('BUNDLE_FOO: "$BUILD_DIR"')
219
- bundle :install, :jobs => 4
218
+
219
+ bundle "config bar baz"
220
220
  run "puts Bundler.settings.send(:local_config_file).read"
221
221
 
222
222
  # Starting in Ruby 2.1, YAML automatically adds double quotes
223
223
  # around some values, including $ and newlines.
224
224
  expect(out).to include('BUNDLE_FOO: "$BUILD_DIR"')
225
225
  end
226
+
227
+ it "doesn't duplicate quotes around long wrapped values" do
228
+ long_string = "--with-xml2-include=/usr/pkg/include/libxml2 --with-xml2-lib=/usr/pkg/lib --with-xslt-dir=/usr/pkg"
229
+ bundle "config foo #{long_string}"
230
+
231
+ run "puts Bundler.settings[:foo]"
232
+ expect(out).to eq(long_string)
233
+
234
+ bundle "config bar baz"
235
+
236
+ run "puts Bundler.settings[:foo]"
237
+ expect(out).to eq(long_string)
238
+ end
226
239
  end
227
240
 
228
241
  describe "very long lines" do
@@ -230,12 +243,21 @@ E
230
243
  let(:long_string) do
231
244
  "--with-xml2-include=/usr/pkg/include/libxml2 --with-xml2-lib=/usr/pkg/lib --with-xslt-dir=/usr/pkg"
232
245
  end
246
+ let(:long_string_without_special_characters) do
247
+ "here is quite a long string that will wrap to a second line but will not be surrounded by quotes"
248
+ end
233
249
 
234
250
  it "doesn't wrap values" do
235
251
  bundle "config foo #{long_string}"
236
252
  run "puts Bundler.settings[:foo]"
237
253
  expect(out).to match(long_string)
238
254
  end
255
+
256
+ it "can read wrapped unquoted values" do
257
+ bundle "config foo #{long_string_without_special_characters}"
258
+ run "puts Bundler.settings[:foo]"
259
+ expect(out).to match(long_string_without_special_characters)
260
+ end
239
261
  end
240
262
 
241
263
  end
@@ -1,6 +1,11 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe "bundle gem" do
4
+ def reset!
5
+ super
6
+ global_config "BUNDLE_GEM__MIT" => "false", "BUNDLE_GEM__TEST" => "false", "BUNDLE_GEM__COC" => "false"
7
+ end
8
+
4
9
  before do
5
10
  @git_name = `git config --global user.name`.chomp
6
11
  `git config --global user.name "Bundler User"`
@@ -289,4 +289,64 @@ describe "bundle install with gems on multiple sources" do
289
289
  should_be_installed("rack 1.0.0")
290
290
  end
291
291
  end
292
+
293
+ context "when a single source contains multiple locked gems" do
294
+ before do
295
+ # 1. With these gems,
296
+ build_repo4 do
297
+ build_gem "foo", "0.1"
298
+ build_gem "bar", "0.1"
299
+ end
300
+
301
+ # 2. Installing this gemfile will produce...
302
+ gemfile <<-G
303
+ source 'file://#{gem_repo1}'
304
+ gem 'rack'
305
+ gem 'foo', '~> 0.1', :source => 'file://#{gem_repo4}'
306
+ gem 'bar', '~> 0.1', :source => 'file://#{gem_repo4}'
307
+ G
308
+
309
+ # 3. this lockfile.
310
+ lockfile <<-L
311
+ GEM
312
+ remote: file:/Users/andre/src/bundler/bundler/tmp/gems/remote1/
313
+ remote: file:/Users/andre/src/bundler/bundler/tmp/gems/remote4/
314
+ specs:
315
+ bar (0.1)
316
+ foo (0.1)
317
+ rack (1.0.0)
318
+
319
+ PLATFORMS
320
+ ruby
321
+
322
+ DEPENDENCIES
323
+ bar (~> 0.1)!
324
+ foo (~> 0.1)!
325
+ rack
326
+ L
327
+
328
+ bundle "install --path ../gems/system"
329
+
330
+ # 4. Then we add some new versions...
331
+ update_repo4 do
332
+ build_gem "foo", "0.2"
333
+ build_gem "bar", "0.3"
334
+ end
335
+ end
336
+
337
+ it "allows them to be unlocked separately" do
338
+ # 5. and install this gemfile, updating only foo.
339
+ install_gemfile <<-G
340
+ source 'file://#{gem_repo1}'
341
+ gem 'rack'
342
+ gem 'foo', '~> 0.2', :source => 'file://#{gem_repo4}'
343
+ gem 'bar', '~> 0.1', :source => 'file://#{gem_repo4}'
344
+ G
345
+
346
+ # 6. Which should update foo to 0.2, but not the (locked) bar 0.1
347
+ should_be_installed("foo 0.2")
348
+ should_be_installed("bar 0.1")
349
+ end
350
+ end
351
+
292
352
  end
@@ -260,12 +260,15 @@ module Spec
260
260
  FileUtils.rm_rf Dir[gem_repo3("prerelease*")]
261
261
  end
262
262
 
263
- # A repo that has no pre-installed gems included. (The caller completely determines the contents with the block)
264
- def build_repo4(&blk)
263
+ # A repo that has no pre-installed gems included. (The caller completely
264
+ # determines the contents with the block.)
265
+ def build_repo4
265
266
  FileUtils.rm_rf gem_repo4
266
- build_repo(gem_repo4) do
267
- yield if block_given?
268
- end
267
+ build_repo(gem_repo4) { yield }
268
+ end
269
+
270
+ def update_repo4
271
+ update_repo(gem_repo4) { yield }
269
272
  end
270
273
 
271
274
  def update_repo2
@@ -153,8 +153,7 @@ module Spec
153
153
  @exitstatus = $?.exitstatus
154
154
  end
155
155
 
156
- def config(config = nil)
157
- path = bundled_app('.bundle/config')
156
+ def config(config = nil, path = bundled_app('.bundle/config'))
158
157
  return YAML.load_file(path) unless config
159
158
  FileUtils.mkdir_p(File.dirname(path))
160
159
  File.open(path, 'w') do |f|
@@ -163,20 +162,23 @@ module Spec
163
162
  config
164
163
  end
165
164
 
165
+ def global_config(config = nil)
166
+ config(config, home(".bundle/config"))
167
+ end
168
+
166
169
  def gemfile(*args)
167
- path = bundled_app("Gemfile")
168
- path = args.shift if args.first.is_a?(Pathname)
169
- str = args.shift || ""
170
- path.dirname.mkpath
171
- File.open(path.to_s, 'w') do |f|
172
- f.puts strip_whitespace(str)
173
- end
170
+ create_file("Gemfile", *args)
174
171
  end
175
172
 
176
173
  def lockfile(*args)
177
- path = bundled_app("Gemfile.lock")
174
+ create_file("Gemfile.lock", *args)
175
+ end
176
+
177
+ def create_file(*args)
178
+ path = bundled_app(args.shift)
178
179
  path = args.shift if args.first.is_a?(Pathname)
179
180
  str = args.shift || ""
181
+ path.dirname.mkpath
180
182
  File.open(path.to_s, 'w') do |f|
181
183
  f.puts strip_whitespace(str)
182
184
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.13
4
+ version: 1.7.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - André Arko
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-02-08 00:00:00.000000000 Z
14
+ date: 2015-03-30 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: mustache