bundler 1.12.0.rc.2 → 1.12.0.rc.3

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: 288351bf045cbfa98272b96f724ed79211ce00b5
4
- data.tar.gz: a261d17f2a6d093ed18fe154c3a564900fe8b4c4
3
+ metadata.gz: 6c6e3bb6749fe497b955858e6fd5adc9c1ccbe23
4
+ data.tar.gz: cc7858b1fd4b74f7e71c97c62ded46317d02690b
5
5
  SHA512:
6
- metadata.gz: 0c88c4beeb3d543c7e3c9e95f4d3bd3ce4cd4961d17f2c329d934663322d488474c8e43c7cb06f0e733e22fb7e2cef376f6f2a50d89c260ec364ac3a790e2569
7
- data.tar.gz: c8dfcfe5e8ed02350d90f9cffd0bca89be5e7b277eaf927c2795e87960411f8ddac27bd5c429257894bbbebbe1b06936043502ff44a5018b7aef5a6b42cab431
6
+ metadata.gz: f3cfde8e2f4d42e3a83ce2a1a573e4a7e19fd0abdd98f9de9fffa89d6516e6cf28fceddaca0b685d0f4c921ed489901c421773ee4d3079a954e66943a6bde899
7
+ data.tar.gz: 36c8f8d9c9953ac8738c251d4f234dc230a53b29ca65142a3597fe6455ea60181db264295b7c656b3926789c80e32aafe7216da57923194037b69a9d3f827df5
@@ -1,3 +1,9 @@
1
+ ## 1.12.0.rc.3 (2016-04-19)
2
+
3
+ Bugfixes:
4
+
5
+ - don't allow new attributes to dirty a lockfile when running `bundle exec`, `-rbundler/setup`, or `bundle check` (@segiddins)
6
+
1
7
  ## 1.12.0.rc.2 (2016-04-15)
2
8
 
3
9
  Features:
@@ -32,7 +32,7 @@ module Bundler
32
32
  Bundler.ui.error "This bundle has been frozen, but there is no #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} present"
33
33
  exit 1
34
34
  else
35
- Bundler.load.lock(:preserve_bundled_with => true) unless options[:"dry-run"]
35
+ Bundler.load.lock(:preserve_unknown_sections => true) unless options[:"dry-run"]
36
36
  Bundler.ui.info "The Gemfile's dependencies are satisfied"
37
37
  end
38
38
  end
@@ -241,7 +241,7 @@ module Bundler
241
241
  dependencies.map(&:groups).flatten.uniq
242
242
  end
243
243
 
244
- def lock(file, preserve_bundled_with = false)
244
+ def lock(file, preserve_unknown_sections = false)
245
245
  contents = to_lock
246
246
 
247
247
  # Convert to \r\n if the existing lock has them
@@ -258,8 +258,8 @@ module Bundler
258
258
  end
259
259
  end
260
260
 
261
- preserve_bundled_with ||= !updating_major && (Bundler.settings[:frozen] || !@unlocking)
262
- return if lockfiles_equal?(@lockfile_contents, contents, preserve_bundled_with)
261
+ preserve_unknown_sections ||= !updating_major && (Bundler.settings[:frozen] || !@unlocking)
262
+ return if lockfiles_equal?(@lockfile_contents, contents, preserve_unknown_sections)
263
263
 
264
264
  if Bundler.settings[:frozen]
265
265
  Bundler.ui.error "Cannot write a changed lockfile while frozen."
@@ -672,13 +672,17 @@ module Bundler
672
672
  groups - Bundler.settings.without - @optional_groups + Bundler.settings.with
673
673
  end
674
674
 
675
- def lockfiles_equal?(current, proposed, preserve_bundled_with)
676
- if preserve_bundled_with
677
- pattern = /\n\n#{LockfileParser::BUNDLED}\n\s+#{Gem::Version::VERSION_PATTERN}\n/
678
- current.sub(pattern, "\n") == proposed.sub(pattern, "\n")
679
- else
680
- current == proposed
675
+ def lockfiles_equal?(current, proposed, preserve_unknown_sections)
676
+ if preserve_unknown_sections
677
+ sections_to_ignore = LockfileParser.sections_to_ignore(@locked_bundler_version)
678
+ sections_to_ignore += LockfileParser.unknown_sections_in_lockfile(current)
679
+ sections_to_ignore += LockfileParser::ENVIRONMENT_VERSION_SECTIONS
680
+ pattern = /#{Regexp.union(sections_to_ignore)}\n(\s{2,}.*\n)+/
681
+ whitespace_cleanup = /\n{2,}/
682
+ current = current.gsub(pattern, "\n").gsub(whitespace_cleanup, "\n\n").strip
683
+ proposed = proposed.gsub(pattern, "\n").gsub(whitespace_cleanup, "\n\n").strip
681
684
  end
685
+ current == proposed
682
686
  end
683
687
  end
684
688
  end
@@ -32,7 +32,7 @@ module Bundler
32
32
  end
33
33
 
34
34
  def lock(opts = {})
35
- @definition.lock(Bundler.default_lockfile, opts[:preserve_bundled_with])
35
+ @definition.lock(Bundler.default_lockfile, opts[:preserve_unknown_sections])
36
36
  end
37
37
 
38
38
  def update(*gems)
@@ -26,6 +26,35 @@ module Bundler
26
26
  OPTIONS = /^ ([a-z]+): (.*)$/i
27
27
  SOURCE = [GIT, GEM, PATH].freeze
28
28
 
29
+ SECTIONS_BY_VERSION_INTRODUCED = {
30
+ Gem::Version.create("1.0") => [DEPENDENCIES, PLATFORMS, GIT, GEM, PATH].freeze,
31
+ Gem::Version.create("1.10") => [BUNDLED].freeze,
32
+ Gem::Version.create("1.12") => [RUBY].freeze,
33
+ }.freeze
34
+
35
+ KNOWN_SECTIONS = SECTIONS_BY_VERSION_INTRODUCED.values.flatten.freeze
36
+
37
+ ENVIRONMENT_VERSION_SECTIONS = [BUNDLED, RUBY].freeze
38
+
39
+ def self.sections_in_lockfile(lockfile_contents)
40
+ lockfile_contents.scan(/^\w[\w ]*$/).uniq
41
+ end
42
+
43
+ def self.unknown_sections_in_lockfile(lockfile_contents)
44
+ sections_in_lockfile(lockfile_contents) - KNOWN_SECTIONS
45
+ end
46
+
47
+ def self.sections_to_ignore(base_version = nil)
48
+ base_version &&= base_version.release
49
+ base_version ||= Gem::Version.create("1.0")
50
+ attributes = []
51
+ SECTIONS_BY_VERSION_INTRODUCED.each do |version, introduced|
52
+ next if version <= base_version
53
+ attributes += introduced
54
+ end
55
+ attributes
56
+ end
57
+
29
58
  def initialize(lockfile)
30
59
  @platforms = []
31
60
  @sources = []
@@ -52,7 +52,7 @@ module Bundler
52
52
 
53
53
  setup_manpath
54
54
 
55
- lock(:preserve_bundled_with => true)
55
+ lock(:preserve_unknown_sections => true)
56
56
 
57
57
  self
58
58
  end
@@ -7,5 +7,5 @@ module Bundler
7
7
  # We're doing this because we might write tests that deal
8
8
  # with other versions of bundler and we are unsure how to
9
9
  # handle this better.
10
- VERSION = "1.12.0.rc.2" unless defined?(::Bundler::VERSION)
10
+ VERSION = "1.12.0.rc.3" unless defined?(::Bundler::VERSION)
11
11
  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.12.0.rc.2
4
+ version: 1.12.0.rc.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - André Arko
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2016-04-15 00:00:00.000000000 Z
14
+ date: 2016-04-20 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: automatiek