bundler 1.10.4 → 1.10.5

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: 96e28345d9c519a160bdabca5ae4746d05a1bc4a
4
- data.tar.gz: bb30271388491a82103e07acb7d5e00084b6cfd7
3
+ metadata.gz: 2462b2530c9588977f9eca5df458b9f9cd50f5cf
4
+ data.tar.gz: 3e4c22647357a52bdcea5edcdc4b66af60ab1c1d
5
5
  SHA512:
6
- metadata.gz: 6e5829c1f677281766f56a786ca7e2ba4dedc3aebed23d74e447a762599d77a738dbb1fbad49334d84682cc6ce566e215f7dc62d3377b825c60c9c2f7aad283d
7
- data.tar.gz: 2743f91766b319a5192e0a12aedb5e4ea24d7f412ffdb16feff1a43e3ae7b5db02ec3fe81de4aa7576707d170c36d138362fbd9125ebd5507ab6810ebc62c1ac
6
+ metadata.gz: 0a871b02641e097cb07274f6944e9391950c14e4ac859ac7fe739f75786e37364f851b9b4fab058659bf504918438ff1343207d12f5a7f6bbdb32107404dcce8
7
+ data.tar.gz: a1ea05745751c4f07e5a33bf17ac507a2c4c706c23d3304791ed2618afc1456b85571d2370c67fa4fa2f93c76a35c1ceffaae6154528682435cbd5db4181099a
@@ -1,3 +1,15 @@
1
+ ## 1.10.5 (2015-06-24)
2
+
3
+ Workarounds:
4
+
5
+ - don't add or update BUNDLED WITH during `install` with no changes (@segiddins)
6
+
7
+ Bugfixes:
8
+
9
+ - fix sorting of mixed DependencyLists with RubyGems >= 2.23 (#3762, @tony-spataro-rs)
10
+ - speed up resolver for path and git gems (@segiddins)
11
+ - fix `install --force` to not reinstall Bundler (#3743, @karlo57)
12
+
1
13
  ## 1.10.4 (2015-06-16)
2
14
 
3
15
  Workarounds:
data/README.md CHANGED
@@ -14,9 +14,9 @@ It does this by managing the gems that the application depends on. Given a list
14
14
  ```
15
15
  gem install bundler
16
16
  bundle init
17
- echo "gem 'rails'" >> Gemfile
17
+ echo 'gem "rspec"' >> Gemfile
18
18
  bundle install
19
- bundle exec rails new myapp
19
+ bundle exec rspec
20
20
  ```
21
21
 
22
22
  See [bundler.io](http://bundler.io) for the full documentation.
@@ -34,3 +34,7 @@ Feel free to chat with the Bundler core team (and many other users) on IRC in th
34
34
  ### Contributing
35
35
 
36
36
  If you'd like to contribute to Bundler, that's awesome, and we <3 you. There's a guide to contributing to Bundler (both code and general help) over in [DEVELOPMENT](https://github.com/bundler/bundler/blob/master/DEVELOPMENT.md)
37
+
38
+ ### Code of Conduct
39
+
40
+ Everyone interacting in the Bundler project’s codebases, issue trackers, chat rooms, and mailing lists is expected to follow the [Bundler code of conduct](https://github.com/bundler/bundler/blob/master/CODE_OF_CONDUCT.md).
@@ -248,23 +248,24 @@ module Bundler
248
248
  # i.e., Windows with `git config core.autocrlf=true`
249
249
  contents.gsub!(/\n/, "\r\n") if @lockfile_contents.match("\r\n")
250
250
 
251
- return if lockfiles_equal?(@lockfile_contents, contents, preserve_bundled_with)
252
-
253
- if Bundler.settings[:frozen]
254
- Bundler.ui.error "Cannot write a changed lockfile while frozen."
255
- return
256
- end
257
-
258
251
  if @locked_bundler_version
259
252
  locked_major = @locked_bundler_version.segments.first
260
253
  current_major = Gem::Version.create(Bundler::VERSION).segments.first
261
254
 
262
- if locked_major < current_major
263
- Bundler.ui.warn "Warning: the lockfile is being updated to Bundler #{Bundler::VERSION.split('.').first}, " \
255
+ if updating_major = locked_major < current_major
256
+ Bundler.ui.warn "Warning: the lockfile is being updated to Bundler #{current_major}, " \
264
257
  "after which you will be unable to return to Bundler #{@locked_bundler_version.segments.first}."
265
258
  end
266
259
  end
267
260
 
261
+ preserve_bundled_with ||= !updating_major && (Bundler.settings[:frozen] || !@unlocking)
262
+ return if lockfiles_equal?(@lockfile_contents, contents, preserve_bundled_with)
263
+
264
+ if Bundler.settings[:frozen]
265
+ Bundler.ui.error "Cannot write a changed lockfile while frozen."
266
+ return
267
+ end
268
+
268
269
  File.open(file, 'wb'){|f| f.puts(contents) }
269
270
  rescue Errno::EACCES
270
271
  raise Bundler::InstallError,
@@ -8,6 +8,7 @@ module Bundler
8
8
  # full specification will only be fetched when necessary.
9
9
  class RemoteSpecification
10
10
  include MatchPlatform
11
+ include Comparable
11
12
 
12
13
  attr_reader :name, :version, :platform
13
14
  attr_accessor :source, :remote
@@ -33,17 +34,41 @@ module Bundler
33
34
  end
34
35
  end
35
36
 
37
+ # Compare this specification against another object. Using sort_obj
38
+ # is compatible with Gem::Specification and other Bundler or RubyGems
39
+ # objects. Otherwise, use the default Object comparison.
40
+ def <=>(other)
41
+ if other.respond_to?(:sort_obj)
42
+ sort_obj <=> other.sort_obj
43
+ else
44
+ super
45
+ end
46
+ end
47
+
36
48
  # Because Rubyforge cannot be trusted to provide valid specifications
37
49
  # once the remote gem is downloaded, the backend specification will
38
50
  # be swapped out.
39
51
  def __swap__(spec)
40
- @specification = spec
52
+ @_remote_specification = spec
41
53
  end
42
54
 
43
55
  private
44
56
 
57
+ # Create a delegate used for sorting. This strategy is copied from
58
+ # RubyGems 2.23 and ensures that Bundler's specifications can be
59
+ # compared and sorted with RubyGems' own specifications.
60
+ #
61
+ # @see #<=>
62
+ # @see Gem::Specification#sort_obj
63
+ #
64
+ # @return [Array] an object you can use to compare and sort this
65
+ # specification against other specifications
66
+ def sort_obj
67
+ [@name, @version, @platform == Gem::Platform::RUBY ? -1 : 1]
68
+ end
69
+
45
70
  def _remote_specification
46
- @specification ||= @spec_fetcher.fetch_spec([@name, @version, @platform])
71
+ @_remote_specification ||= @spec_fetcher.fetch_spec([@name, @version, @platform])
47
72
  end
48
73
 
49
74
  def method_missing(method, *args, &blk)
@@ -309,11 +309,13 @@ module Bundler
309
309
  dependency.requirement.satisfied_by?(base.first.version) ? 0 : 1
310
310
  else
311
311
  base_dep = Dependency.new dependency.name, '>= 0.a'
312
- all = search_for(DepProxy.new base_dep, dependency.__platform)
313
- if all.size == 0
312
+ all = search_for(DepProxy.new base_dep, dependency.__platform).size.to_f
313
+ if all.zero?
314
+ 0
315
+ elsif (search = search_for(dependency).size.to_f) == all && all == 1
314
316
  0
315
317
  else
316
- search_for(dependency).size.to_f / all.size.to_f
318
+ search / all
317
319
  end
318
320
  end
319
321
  end
@@ -98,7 +98,7 @@ module Bundler
98
98
  end
99
99
  end
100
100
 
101
- if installed_specs[spec].any? && !force
101
+ if installed?(spec) && (!force || spec.name.eql?("bundler"))
102
102
  Bundler.ui.info "Using #{version_message(spec)}"
103
103
  return nil # no post-install message
104
104
  end
@@ -413,6 +413,10 @@ module Bundler
413
413
  spec.loaded_from && spec.loaded_from.include?("specifications/default/")
414
414
  end
415
415
 
416
+ def installed?(spec)
417
+ installed_specs[spec].any?
418
+ end
419
+
416
420
  end
417
421
  end
418
422
  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.10.4" unless defined?(::Bundler::VERSION)
5
+ VERSION = "1.10.5" unless defined?(::Bundler::VERSION)
6
6
  end
@@ -443,6 +443,16 @@ In the case of the `git` block form, the `:ref`, `:branch`, `:tag`,
443
443
  and `:submodules` options may be passed to the `git` method, and
444
444
  all gems in the block will inherit those options.
445
445
 
446
+ ## INSTALL_IF (#install_if)
447
+
448
+ The `install_if` method allows gems to be installed based on a proc or lambda.
449
+ This is especially useful for optional gems that can only be used if certain
450
+ software is installed or some other conditions are met.
451
+
452
+ install_if -> { RUBY_PLATFORM =~ /darwin/ } do
453
+ gem "pasteboard"
454
+ end
455
+
446
456
  ## GEMSPEC (#gemspec)
447
457
 
448
458
  If you wish to use Bundler to help install dependencies for a gem while it is
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.10.4
4
+ version: 1.10.5
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-06-16 00:00:00.000000000 Z
14
+ date: 2015-06-24 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: mustache