bundler 1.12.0 → 1.12.1

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: 35f0cb52a9b882c8c637ef77113a1489a51dfaab
4
- data.tar.gz: 6360632fce92559605a10156b5461b983ea9a019
3
+ metadata.gz: b30d7f68ab57d609b0945f483f536cafac8d4757
4
+ data.tar.gz: 7a7c04740ead7985a85d89061738f7a654c95c06
5
5
  SHA512:
6
- metadata.gz: d6740f61b4c432e18499bb873d6b37f2faac68f3aedc610a29c8f0e020813d72de618ebe1e0e4f6c63e4cf4e39e0afdc7eb425b4a0c881490bf66e3a12acc3a5
7
- data.tar.gz: 1b6c857370935620790be2a7c6594d9cca98b1048eb2a35c886897848166343f29575b21f46a86f7ee95a37c983bc823c69621dadf2265887ce9ae39c80b2fcb
6
+ metadata.gz: 8a04ea9994afc79eaa115ca259758e15fba0da19228f4210646c2451e0c3b11b0e39278fda7aa56f1c1202993b248a3b16227ceff5ab7d72ecaf4c31be2ccd73
7
+ data.tar.gz: f26a87583ff7b6cf97bb260874117d47cb9636a3051a59d1cb88e4551cae9bdb7ebc745f2e5aa07ec57a1ea96a698d82b2a9b4853947ca392f55b9cc4773162a
@@ -1,3 +1,11 @@
1
+ ## 1.12.1 (2016-04-30)
2
+
3
+ Bugfixes:
4
+ - automatically fallback when the new index has a checksum mismatch instead of erroring (@segiddins)
5
+ - fix computation of new index file local checksums on Windows (#4472, @mwrock)
6
+ - properly handle certain resolver backtracking cases without erroring (@segiddins, #4484)
7
+ - ensure the `$LOAD_PATH` contains specs' load paths in the correct order (@segiddins, #4482)
8
+
1
9
  ## 1.12.0 (2016-04-28)
2
10
 
3
11
  This space intentionally left blank.
@@ -61,6 +61,9 @@ module Bundler
61
61
  def available?
62
62
  # Read info file checksums out of /versions, so we can know if gems are up to date
63
63
  fetch_uri.scheme != "file" && compact_index_client.update_and_parse_checksums!
64
+ rescue CompactIndexClient::Updater::MisMatchedChecksumError => e
65
+ Bundler.ui.warn(e.message)
66
+ nil
64
67
  end
65
68
  compact_index_request :available?
66
69
 
@@ -17,7 +17,7 @@ module Bundler
17
17
  Bundler.rubygems.replace_entrypoints(specs)
18
18
 
19
19
  # Activate the specs
20
- specs.each do |spec|
20
+ load_paths = specs.map do |spec|
21
21
  unless spec.loaded_from
22
22
  raise GemNotFound, "#{spec.full_name} is missing. Run `bundle` to get it."
23
23
  end
@@ -36,18 +36,16 @@ module Bundler
36
36
  end
37
37
 
38
38
  Bundler.rubygems.mark_loaded(spec)
39
- load_paths = spec.load_paths.reject {|path| $LOAD_PATH.include?(path) }
40
-
41
- # See Gem::Specification#add_self_to_load_path (since RubyGems 1.8)
42
- insert_index = Bundler.rubygems.load_path_insert_index
39
+ spec.load_paths.reject {|path| $LOAD_PATH.include?(path) }
40
+ end.reverse.flatten
43
41
 
44
- if insert_index
45
- # Gem directories must come after -I and ENV['RUBYLIB']
46
- $LOAD_PATH.insert(insert_index, *load_paths)
47
- else
48
- # We are probably testing in core, -I and RUBYLIB don't apply
49
- $LOAD_PATH.unshift(*load_paths)
50
- end
42
+ # See Gem::Specification#add_self_to_load_path (since RubyGems 1.8)
43
+ if insert_index = Bundler.rubygems.load_path_insert_index
44
+ # Gem directories must come after -I and ENV['RUBYLIB']
45
+ $LOAD_PATH.insert(insert_index, *load_paths)
46
+ else
47
+ # We are probably testing in core, -I and RUBYLIB don't apply
48
+ $LOAD_PATH.unshift(*load_paths)
51
49
  end
52
50
 
53
51
  setup_manpath
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require "pathname"
2
3
  require "set"
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  class Bundler::CompactIndexClient
2
3
  class Cache
3
4
  attr_reader :directory
@@ -1,9 +1,21 @@
1
+ # frozen_string_literal: true
1
2
  require "stringio"
2
3
  require "zlib"
3
4
 
4
5
  class Bundler::CompactIndexClient
5
6
  class Updater
6
- class MisMatchedChecksumError < Error; end
7
+ class MisMatchedChecksumError < Error
8
+ def initialize(path, server_checksum, local_checksum)
9
+ @path = path
10
+ @server_checksum = server_checksum
11
+ @local_checksum = local_checksum
12
+ end
13
+
14
+ def message
15
+ "The checksum of /#{@path} does not match the checksum provided by the server! Something is wrong " \
16
+ "(local checksum is #{@local_checksum.inspect}, was expecting #{@server_checksum.inspect})."
17
+ end
18
+ end
7
19
 
8
20
  def initialize(fetcher)
9
21
  @fetcher = fetcher
@@ -31,25 +43,28 @@ class Bundler::CompactIndexClient
31
43
  mode = response.is_a?(Net::HTTPPartialContent) ? "a" : "w"
32
44
  local_path.open(mode) {|f| f << content }
33
45
 
34
- return if etag_for(local_path) == response["ETag"]
46
+ response_etag = response["ETag"]
47
+ return if etag_for(local_path) == response_etag
35
48
 
36
49
  if retrying.nil?
37
50
  local_path.delete
38
51
  update(local_path, remote_path, :retrying)
39
52
  else
40
- raise MisMatchedChecksumError, "Checksum of /#{remote_path} " \
41
- "does not match the checksum provided by server! Something is wrong."
53
+ raise MisMatchedChecksumError.new(remote_path, response_etag, etag_for(local_path))
42
54
  end
43
55
  end
44
56
 
45
57
  def etag_for(path)
46
58
  sum = checksum_for_file(path)
47
- sum ? '"' << sum << '"' : nil
59
+ sum ? %("#{sum}") : nil
48
60
  end
49
61
 
50
62
  def checksum_for_file(path)
51
63
  return nil unless path.file?
52
- Digest::MD5.file(path).hexdigest
64
+ # This must use IO.read instead of Digest.file().hexdigest
65
+ # because we need to preserve \n line endings on windows when calculating
66
+ # the checksum
67
+ Digest::MD5.hexdigest(IO.read(path))
53
68
  end
54
69
  end
55
70
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  class Bundler::CompactIndexClient
2
- VERSION = "0.1.0"
3
+ VERSION = "0.1.0".freeze
3
4
  end
@@ -16,7 +16,7 @@ module Bundler::Molinillo
16
16
  include TSort
17
17
 
18
18
  # @visibility private
19
- alias_method :tsort_each_node, :each
19
+ alias tsort_each_node each
20
20
 
21
21
  # @visibility private
22
22
  def tsort_each_child(vertex, &block)
@@ -184,7 +184,7 @@ module Bundler::Molinillo
184
184
 
185
185
  # @return [Boolean] whether the vertex is considered a root vertex
186
186
  attr_accessor :root
187
- alias_method :root?, :root
187
+ alias root? root
188
188
 
189
189
  # Initializes a vertex with the given name and payload.
190
190
  # @param [String] name see {#name}
@@ -262,7 +262,7 @@ module Bundler::Molinillo
262
262
  payload == other.payload
263
263
  end
264
264
 
265
- alias_method :eql?, :==
265
+ alias eql? ==
266
266
 
267
267
  # @return [Fixnum] a hash for the vertex based upon its {#name}
268
268
  def hash
@@ -276,7 +276,7 @@ module Bundler::Molinillo
276
276
  equal?(other) || successors.any? { |v| v.path_to?(other) }
277
277
  end
278
278
 
279
- alias_method :descendent?, :path_to?
279
+ alias descendent? path_to?
280
280
 
281
281
  # Is there a path from `other` to `self` following edges in the
282
282
  # dependency graph?
@@ -285,7 +285,7 @@ module Bundler::Molinillo
285
285
  other.path_to?(self)
286
286
  end
287
287
 
288
- alias_method :is_reachable_from?, :ancestor?
288
+ alias is_reachable_from? ancestor?
289
289
  end
290
290
  end
291
291
  end
@@ -26,7 +26,7 @@ module Bundler::Molinillo
26
26
  def message
27
27
  sources = required_by.map { |r| "`#{r}`" }.join(' and ')
28
28
  message = "Unable to find a specification for `#{dependency}`"
29
- message << " depended upon by #{sources}" unless sources.empty?
29
+ message += " depended upon by #{sources}" unless sources.empty?
30
30
  message
31
31
  end
32
32
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module Bundler::Molinillo
3
3
  # The version of Bundler::Molinillo.
4
- VERSION = '0.4.3'.freeze
4
+ VERSION = '0.4.5'.freeze
5
5
  end
@@ -131,7 +131,7 @@ module Bundler::Molinillo
131
131
  specification_provider.send(instance_method, *args, &block)
132
132
  rescue NoSuchDependencyError => error
133
133
  if state
134
- vertex = activated.vertex_named(name_for error.dependency)
134
+ vertex = activated.vertex_named(name_for(error.dependency))
135
135
  error.required_by += vertex.incoming_edges.map { |e| e.origin.name }
136
136
  error.required_by << name_for_explicit_dependency_source unless vertex.explicit_requirements.empty?
137
137
  end
@@ -345,7 +345,7 @@ module Bundler::Molinillo
345
345
  vertex = swapped.vertex_named(name)
346
346
  vertex.payload = possibility
347
347
  return unless vertex.requirements.
348
- all? { |r| requirement_satisfied_by?(r, swapped, possibility) }
348
+ all? { |r| requirement_satisfied_by?(r, swapped, possibility) }
349
349
  return unless new_spec_satisfied?
350
350
  actual_vertex = activated.vertex_named(name)
351
351
  actual_vertex.payload = possibility
@@ -363,7 +363,13 @@ module Bundler::Molinillo
363
363
  if !dep_names.include?(succ.name) && !succ.root? && succ.predecessors.to_a == [vertex]
364
364
  debug(depth) { "Removing orphaned spec #{succ.name} after swapping #{name}" }
365
365
  activated.detach_vertex_named(succ.name)
366
- requirements.delete_if { |r| name_for(r) == succ.name }
366
+
367
+ all_successor_names = succ.recursive_successors.map(&:name)
368
+
369
+ requirements.delete_if do |requirement|
370
+ requirement_name = name_for(requirement)
371
+ (requirement_name == succ.name) || all_successor_names.include?(requirement_name)
372
+ end
367
373
  end
368
374
  end
369
375
  end
@@ -420,14 +426,14 @@ module Bundler::Molinillo
420
426
  debug(depth) { "Requiring nested dependencies (#{nested_dependencies.join(', ')})" }
421
427
  nested_dependencies.each { |d| activated.add_child_vertex(name_for(d), nil, [name_for(activated_spec)], d) }
422
428
 
423
- push_state_for_requirements(requirements + nested_dependencies, nested_dependencies.size > 0)
429
+ push_state_for_requirements(requirements + nested_dependencies, !nested_dependencies.empty?)
424
430
  end
425
431
 
426
432
  # Pushes a new {DependencyState} that encapsulates both existing and new
427
433
  # requirements
428
434
  # @param [Array] new_requirements
429
435
  # @return [void]
430
- def push_state_for_requirements(new_requirements, requires_sort = true, new_activated = activated.dup)
436
+ def push_state_for_requirements(new_requirements, requires_sort = true, new_activated = activated)
431
437
  new_requirements = sort_dependencies(new_requirements.uniq, new_activated, conflicts) if requires_sort
432
438
  new_requirement = new_requirements.shift
433
439
  new_name = new_requirement ? name_for(new_requirement) : ''
@@ -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" unless defined?(::Bundler::VERSION)
10
+ VERSION = "1.12.1" 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
4
+ version: 1.12.1
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-29 00:00:00.000000000 Z
14
+ date: 2016-04-30 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: automatiek
@@ -353,8 +353,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
353
353
  version: 1.3.6
354
354
  requirements: []
355
355
  rubyforge_project:
356
- rubygems_version: 2.5.1
356
+ rubygems_version: 2.6.3
357
357
  signing_key:
358
358
  specification_version: 4
359
359
  summary: The best way to manage your application's dependencies
360
360
  test_files: []
361
+ has_rdoc: