rubygems-update 3.2.3 → 3.2.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/{History.txt → CHANGELOG.md} +480 -427
  3. data/Manifest.txt +30 -27
  4. data/Rakefile +20 -28
  5. data/bundler/CHANGELOG.md +73 -2
  6. data/bundler/bundler.gemspec +1 -1
  7. data/bundler/lib/bundler.rb +0 -1
  8. data/bundler/lib/bundler/build_metadata.rb +2 -2
  9. data/bundler/lib/bundler/cli.rb +3 -5
  10. data/bundler/lib/bundler/cli/cache.rb +1 -0
  11. data/bundler/lib/bundler/cli/gem.rb +14 -0
  12. data/bundler/lib/bundler/compact_index_client/updater.rb +0 -8
  13. data/bundler/lib/bundler/definition.rb +17 -27
  14. data/bundler/lib/bundler/dep_proxy.rb +15 -8
  15. data/bundler/lib/bundler/feature_flag.rb +0 -1
  16. data/bundler/lib/bundler/fetcher.rb +0 -1
  17. data/bundler/lib/bundler/gem_helper.rb +9 -7
  18. data/bundler/lib/bundler/gem_version_promoter.rb +2 -2
  19. data/bundler/lib/bundler/index.rb +6 -5
  20. data/bundler/lib/bundler/installer.rb +0 -17
  21. data/bundler/lib/bundler/installer/standalone.rb +15 -0
  22. data/bundler/lib/bundler/lazy_specification.rb +9 -18
  23. data/bundler/{man → lib/bundler/man}/bundle-add.1 +1 -1
  24. data/bundler/{man → lib/bundler/man}/bundle-binstubs.1 +1 -1
  25. data/bundler/{man → lib/bundler/man}/bundle-cache.1 +1 -1
  26. data/bundler/{man → lib/bundler/man}/bundle-check.1 +1 -1
  27. data/bundler/{man → lib/bundler/man}/bundle-clean.1 +1 -1
  28. data/bundler/{man → lib/bundler/man}/bundle-config.1 +4 -4
  29. data/bundler/lib/bundler/man/bundle-config.1.ronn +3 -3
  30. data/bundler/{man → lib/bundler/man}/bundle-doctor.1 +1 -1
  31. data/bundler/{man → lib/bundler/man}/bundle-exec.1 +1 -1
  32. data/bundler/{man → lib/bundler/man}/bundle-gem.1 +1 -1
  33. data/bundler/{man → lib/bundler/man}/bundle-info.1 +1 -1
  34. data/bundler/{man → lib/bundler/man}/bundle-init.1 +1 -1
  35. data/bundler/{man → lib/bundler/man}/bundle-inject.1 +1 -1
  36. data/bundler/{man → lib/bundler/man}/bundle-install.1 +1 -1
  37. data/bundler/{man → lib/bundler/man}/bundle-list.1 +1 -1
  38. data/bundler/{man → lib/bundler/man}/bundle-lock.1 +1 -1
  39. data/bundler/{man → lib/bundler/man}/bundle-open.1 +1 -1
  40. data/bundler/{man → lib/bundler/man}/bundle-outdated.1 +1 -1
  41. data/bundler/{man → lib/bundler/man}/bundle-platform.1 +1 -1
  42. data/bundler/{man → lib/bundler/man}/bundle-pristine.1 +1 -1
  43. data/bundler/{man → lib/bundler/man}/bundle-remove.1 +1 -1
  44. data/bundler/{man → lib/bundler/man}/bundle-show.1 +1 -1
  45. data/bundler/{man → lib/bundler/man}/bundle-update.1 +1 -1
  46. data/bundler/{man → lib/bundler/man}/bundle-viz.1 +1 -1
  47. data/bundler/{man → lib/bundler/man}/bundle.1 +1 -1
  48. data/bundler/{man → lib/bundler/man}/gemfile.5 +1 -1
  49. data/bundler/{man → lib/bundler/man}/index.txt +0 -0
  50. data/bundler/lib/bundler/resolver.rb +82 -43
  51. data/bundler/lib/bundler/resolver/spec_group.rb +56 -44
  52. data/bundler/lib/bundler/rubygems_ext.rb +16 -0
  53. data/bundler/lib/bundler/settings.rb +1 -1
  54. data/bundler/lib/bundler/shared_helpers.rb +2 -2
  55. data/bundler/lib/bundler/source/git.rb +19 -17
  56. data/bundler/lib/bundler/source/git/git_proxy.rb +54 -49
  57. data/bundler/lib/bundler/source/path/installer.rb +2 -0
  58. data/bundler/lib/bundler/source/rubygems.rb +10 -2
  59. data/bundler/lib/bundler/source_list.rb +2 -4
  60. data/bundler/lib/bundler/spec_set.rb +5 -4
  61. data/bundler/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
  62. data/bundler/lib/bundler/templates/newgem/Gemfile.tt +1 -1
  63. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +1 -1
  64. data/bundler/lib/bundler/templates/newgem/rubocop.yml.tt +3 -0
  65. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +7 -0
  66. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +0 -1
  67. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +11 -5
  68. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +2 -2
  69. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +11 -0
  70. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +11 -7
  71. data/bundler/lib/bundler/vendor/thor/lib/thor.rb +5 -6
  72. data/bundler/lib/bundler/vendor/thor/lib/thor/actions.rb +1 -1
  73. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +4 -2
  74. data/bundler/lib/bundler/vendor/thor/lib/thor/error.rb +1 -1
  75. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +5 -1
  76. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +9 -8
  77. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +5 -2
  78. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/color.rb +5 -1
  79. data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  80. data/bundler/lib/bundler/version.rb +1 -1
  81. data/lib/rubygems.rb +2 -2
  82. data/lib/rubygems/commands/setup_command.rb +16 -62
  83. data/lib/rubygems/ext/builder.rb +5 -4
  84. data/lib/rubygems/ext/cmake_builder.rb +1 -2
  85. data/lib/rubygems/ext/configure_builder.rb +1 -2
  86. data/lib/rubygems/installer_uninstaller_utils.rb +6 -1
  87. data/lib/rubygems/platform.rb +0 -4
  88. data/lib/rubygems/remote_fetcher.rb +3 -1
  89. data/lib/rubygems/requirement.rb +1 -1
  90. data/lib/rubygems/resolver/best_set.rb +1 -1
  91. data/lib/rubygems/resolver/index_specification.rb +8 -2
  92. data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb +7 -0
  93. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +0 -1
  94. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/vertex.rb +11 -5
  95. data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +2 -2
  96. data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/specification_provider.rb +11 -0
  97. data/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb +11 -7
  98. data/lib/rubygems/specification.rb +18 -14
  99. data/lib/rubygems/test_case.rb +17 -4
  100. data/rubygems-update.gemspec +2 -2
  101. data/test/rubygems/data/null-required-ruby-version.gemspec.rz +0 -0
  102. data/test/rubygems/data/null-required-rubygems-version.gemspec.rz +0 -0
  103. data/test/rubygems/test_gem.rb +5 -0
  104. data/test/rubygems/test_gem_commands_setup_command.rb +21 -37
  105. data/test/rubygems/test_gem_dependency_installer.rb +52 -47
  106. data/test/rubygems/test_gem_ext_builder.rb +30 -6
  107. data/test/rubygems/test_gem_ext_cmake_builder.rb +2 -4
  108. data/test/rubygems/test_gem_ext_configure_builder.rb +2 -2
  109. data/test/rubygems/test_gem_installer.rb +2 -0
  110. data/test/rubygems/test_gem_platform.rb +8 -0
  111. data/test/rubygems/test_gem_remote_fetcher.rb +1 -1
  112. data/test/rubygems/test_gem_requirement.rb +35 -1
  113. data/test/rubygems/test_gem_resolver_best_set.rb +23 -0
  114. data/test/rubygems/test_gem_specification.rb +9 -3
  115. data/test/rubygems/test_gem_stream_ui.rb +1 -1
  116. metadata +34 -55
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - <%= Time.now.strftime('%F') %>
4
+
5
+ - Initial release
@@ -16,5 +16,5 @@ gem "<%= config[:test] %>", "~> <%= config[:test_framework_version] %>"
16
16
  <%- end -%>
17
17
  <%- if config[:rubocop] -%>
18
18
 
19
- gem "rubocop", "~> 0.80"
19
+ gem "rubocop", "~> <%= config[:rubocop_version] %>"
20
20
  <%- end -%>
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
  <%- if config[:mit] -%>
15
15
  spec.license = "MIT"
16
16
  <%- end -%>
17
- spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
17
+ spec.required_ruby_version = Gem::Requirement.new(">= <%= config[:required_ruby_version] %>")
18
18
 
19
19
  spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
20
20
 
@@ -1,3 +1,6 @@
1
+ AllCops:
2
+ TargetRubyVersion: <%= ::Gem::Version.new(config[:required_ruby_version]).segments[0..1].join(".") %>
3
+
1
4
  Style/StringLiterals:
2
5
  Enabled: true
3
6
  EnforcedStyle: double_quotes
@@ -26,6 +26,13 @@ module Bundler::Molinillo
26
26
  end
27
27
  end
28
28
 
29
+ # (see Bundler::Molinillo::SpecificationProvider#dependencies_equal?)
30
+ def dependencies_equal?(dependencies, other_dependencies)
31
+ with_no_such_dependency_error_handling do
32
+ specification_provider.dependencies_equal?(dependencies, other_dependencies)
33
+ end
34
+ end
35
+
29
36
  # (see Bundler::Molinillo::SpecificationProvider#name_for)
30
37
  def name_for(dependency)
31
38
  with_no_such_dependency_error_handling do
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'set'
4
3
  require 'tsort'
5
4
 
6
5
  require_relative 'dependency_graph/log'
@@ -59,7 +59,7 @@ module Bundler::Molinillo
59
59
  # @param [Set<Vertex>] vertices the set to add the predecessors to
60
60
  # @return [Set<Vertex>] the vertices of {#graph} where `self` is a
61
61
  # {#descendent?}
62
- def _recursive_predecessors(vertices = Set.new)
62
+ def _recursive_predecessors(vertices = new_vertex_set)
63
63
  incoming_edges.each do |edge|
64
64
  vertex = edge.origin
65
65
  next unless vertices.add?(vertex)
@@ -85,7 +85,7 @@ module Bundler::Molinillo
85
85
  # @param [Set<Vertex>] vertices the set to add the successors to
86
86
  # @return [Set<Vertex>] the vertices of {#graph} where `self` is an
87
87
  # {#ancestor?}
88
- def _recursive_successors(vertices = Set.new)
88
+ def _recursive_successors(vertices = new_vertex_set)
89
89
  outgoing_edges.each do |edge|
90
90
  vertex = edge.destination
91
91
  next unless vertices.add?(vertex)
@@ -128,7 +128,7 @@ module Bundler::Molinillo
128
128
 
129
129
  # Is there a path from `self` to `other` following edges in the
130
130
  # dependency graph?
131
- # @return true iff there is a path following edges within this {#graph}
131
+ # @return whether there is a path following edges within this {#graph}
132
132
  def path_to?(other)
133
133
  _path_to?(other)
134
134
  end
@@ -138,7 +138,7 @@ module Bundler::Molinillo
138
138
  # @param [Vertex] other the vertex to check if there's a path to
139
139
  # @param [Set<Vertex>] visited the vertices of {#graph} that have been visited
140
140
  # @return [Boolean] whether there is a path to `other` from `self`
141
- def _path_to?(other, visited = Set.new)
141
+ def _path_to?(other, visited = new_vertex_set)
142
142
  return false unless visited.add?(self)
143
143
  return true if equal?(other)
144
144
  successors.any? { |v| v._path_to?(other, visited) }
@@ -147,12 +147,18 @@ module Bundler::Molinillo
147
147
 
148
148
  # Is there a path from `other` to `self` following edges in the
149
149
  # dependency graph?
150
- # @return true iff there is a path following edges within this {#graph}
150
+ # @return whether there is a path following edges within this {#graph}
151
151
  def ancestor?(other)
152
152
  other.path_to?(self)
153
153
  end
154
154
 
155
155
  alias is_reachable_from? ancestor?
156
+
157
+ def new_vertex_set
158
+ require 'set'
159
+ Set.new
160
+ end
161
+ private :new_vertex_set
156
162
  end
157
163
  end
158
164
  end
@@ -34,7 +34,7 @@ module Bundler::Molinillo
34
34
 
35
35
  # An error caused by attempting to fulfil a dependency that was circular
36
36
  #
37
- # @note This exception will be thrown iff a {Vertex} is added to a
37
+ # @note This exception will be thrown if and only if a {Vertex} is added to a
38
38
  # {DependencyGraph} that has a {DependencyGraph::Vertex#path_to?} an
39
39
  # existing {DependencyGraph::Vertex}
40
40
  class CircularDependencyError < ResolverError
@@ -121,7 +121,7 @@ module Bundler::Molinillo
121
121
  t = ''.dup
122
122
  depth = 2
123
123
  tree.each do |req|
124
- t << ' ' * depth << req.to_s
124
+ t << ' ' * depth << printable_requirement.call(req)
125
125
  unless tree.last == req
126
126
  if spec = conflict.activated_by_name[name_for(req)]
127
127
  t << %( was resolved to #{version_for_spec.call(spec)}, which)
@@ -45,6 +45,17 @@ module Bundler::Molinillo
45
45
  true
46
46
  end
47
47
 
48
+ # Determines whether two arrays of dependencies are equal, and thus can be
49
+ # grouped.
50
+ #
51
+ # @param [Array<Object>] dependencies
52
+ # @param [Array<Object>] other_dependencies
53
+ # @return [Boolean] whether `dependencies` and `other_dependencies` should
54
+ # be considered equal.
55
+ def dependencies_equal?(dependencies, other_dependencies)
56
+ dependencies == other_dependencies
57
+ end
58
+
48
59
  # Returns the name for the given `dependency`.
49
60
  # @note This method should be 'pure', i.e. the return value should depend
50
61
  # only on the `dependency` parameter.
@@ -329,11 +329,11 @@ module Bundler::Molinillo
329
329
 
330
330
  # Look for past conflicts that could be unwound to affect the
331
331
  # requirement tree for the current conflict
332
+ all_reqs = last_detail_for_current_unwind.all_requirements
333
+ all_reqs_size = all_reqs.size
332
334
  relevant_unused_unwinds = unused_unwind_options.select do |alternative|
333
- intersecting_requirements =
334
- last_detail_for_current_unwind.all_requirements &
335
- alternative.requirements_unwound_to_instead
336
- next if intersecting_requirements.empty?
335
+ diff_reqs = all_reqs - alternative.requirements_unwound_to_instead
336
+ next if diff_reqs.size == all_reqs_size
337
337
  # Find the highest index unwind whilst looping through
338
338
  current_detail = alternative if alternative > current_detail
339
339
  alternative
@@ -344,8 +344,12 @@ module Bundler::Molinillo
344
344
  state.unused_unwind_options += unwind_details.reject { |detail| detail.state_index == -1 }
345
345
 
346
346
  # Update the requirements_unwound_to_instead on any relevant unused unwinds
347
- relevant_unused_unwinds.each { |d| d.requirements_unwound_to_instead << current_detail.state_requirement }
348
- unwind_details.each { |d| d.requirements_unwound_to_instead << current_detail.state_requirement }
347
+ relevant_unused_unwinds.each do |d|
348
+ (d.requirements_unwound_to_instead << current_detail.state_requirement).uniq!
349
+ end
350
+ unwind_details.each do |d|
351
+ (d.requirements_unwound_to_instead << current_detail.state_requirement).uniq!
352
+ end
349
353
 
350
354
  current_detail
351
355
  end
@@ -803,7 +807,7 @@ module Bundler::Molinillo
803
807
 
804
808
  possibilities.reverse_each do |possibility|
805
809
  dependencies = dependencies_for(possibility)
806
- if current_possibility_set && current_possibility_set.dependencies == dependencies
810
+ if current_possibility_set && dependencies_equal?(current_possibility_set.dependencies, dependencies)
807
811
  current_possibility_set.possibilities.unshift(possibility)
808
812
  else
809
813
  possibility_sets.unshift(PossibilitySet.new(dependencies, [possibility]))
@@ -1,7 +1,7 @@
1
- require "set"
2
1
  require_relative "thor/base"
3
2
 
4
3
  class Bundler::Thor
4
+ $thor_runner ||= false
5
5
  class << self
6
6
  # Allows for custom "Command" package naming.
7
7
  #
@@ -323,7 +323,7 @@ class Bundler::Thor
323
323
  # ==== Parameters
324
324
  # Symbol ...:: A list of commands that should be affected.
325
325
  def stop_on_unknown_option!(*command_names)
326
- stop_on_unknown_option.merge(command_names)
326
+ @stop_on_unknown_option = stop_on_unknown_option | command_names
327
327
  end
328
328
 
329
329
  def stop_on_unknown_option?(command) #:nodoc:
@@ -337,7 +337,7 @@ class Bundler::Thor
337
337
  # ==== Parameters
338
338
  # Symbol ...:: A list of commands that should be affected.
339
339
  def disable_required_check!(*command_names)
340
- disable_required_check.merge(command_names)
340
+ @disable_required_check = disable_required_check | command_names
341
341
  end
342
342
 
343
343
  def disable_required_check?(command) #:nodoc:
@@ -347,12 +347,12 @@ class Bundler::Thor
347
347
  protected
348
348
 
349
349
  def stop_on_unknown_option #:nodoc:
350
- @stop_on_unknown_option ||= Set.new
350
+ @stop_on_unknown_option ||= []
351
351
  end
352
352
 
353
353
  # help command has the required check disabled by default.
354
354
  def disable_required_check #:nodoc:
355
- @disable_required_check ||= Set.new([:help])
355
+ @disable_required_check ||= [:help]
356
356
  end
357
357
 
358
358
  # The method responsible for dispatching given the args.
@@ -398,7 +398,6 @@ class Bundler::Thor
398
398
  # the namespace should be displayed as arguments.
399
399
  #
400
400
  def banner(command, namespace = nil, subcommand = false)
401
- $thor_runner ||= false
402
401
  command.formatted_usage(self, $thor_runner, subcommand).split("\n").map do |formatted_usage|
403
402
  "#{basename} #{formatted_usage}"
404
403
  end.join("\n")
@@ -219,7 +219,7 @@ class Bundler::Thor
219
219
 
220
220
  contents = if is_uri
221
221
  require "open-uri"
222
- open(path, "Accept" => "application/x-thor-template", &:read)
222
+ URI.open(path, "Accept" => "application/x-thor-template", &:read)
223
223
  else
224
224
  open(path, &:read)
225
225
  end
@@ -251,7 +251,8 @@ class Bundler::Thor
251
251
  # path<String>:: path of the file to be changed
252
252
  # flag<Regexp|String>:: the regexp or string to be replaced
253
253
  # replacement<String>:: the replacement, can be also given as a block
254
- # config<Hash>:: give :verbose => false to not log the status.
254
+ # config<Hash>:: give :verbose => false to not log the status, and
255
+ # :force => true, to force the replacement regardles of runner behavior.
255
256
  #
256
257
  # ==== Example
257
258
  #
@@ -262,9 +263,10 @@ class Bundler::Thor
262
263
  # end
263
264
  #
264
265
  def gsub_file(path, flag, *args, &block)
265
- return unless behavior == :invoke
266
266
  config = args.last.is_a?(Hash) ? args.pop : {}
267
267
 
268
+ return unless behavior == :invoke || config.fetch(:force, false)
269
+
268
270
  path = File.expand_path(path, destination_root)
269
271
  say_status :gsub, relative_to_original_destination_root(path), config.fetch(:verbose, true)
270
272
 
@@ -1,5 +1,5 @@
1
1
  class Bundler::Thor
2
- Correctable = if defined?(DidYouMean::SpellChecker) && defined?(DidYouMean::Correctable)
2
+ Correctable = if defined?(DidYouMean::SpellChecker) && defined?(DidYouMean::Correctable) # rubocop:disable Naming/ConstantName
3
3
  # In order to support versions of Ruby that don't have keyword
4
4
  # arguments, we need our own spell checker class that doesn't take key
5
5
  # words. Even though this code wouldn't be hit because of the check
@@ -30,7 +30,11 @@ class Bundler::Thor
30
30
 
31
31
  arguments.each do |argument|
32
32
  if !argument.default.nil?
33
- @assigns[argument.human_name] = argument.default
33
+ begin
34
+ @assigns[argument.human_name] = argument.default.dup
35
+ rescue TypeError # Compatibility shim for un-dup-able Fixnum in Ruby < 2.4
36
+ @assigns[argument.human_name] = argument.default
37
+ end
34
38
  elsif argument.required?
35
39
  @non_assigned_required << argument
36
40
  end
@@ -133,15 +133,16 @@ class Bundler::Thor
133
133
 
134
134
  protected
135
135
 
136
- def assign_result!(option, result)
137
- if option.repeatable && option.type == :hash
138
- (@assigns[option.human_name] ||= {}).merge!(result)
139
- elsif option.repeatable
140
- (@assigns[option.human_name] ||= []) << result
141
- else
142
- @assigns[option.human_name] = result
136
+ def assign_result!(option, result)
137
+ if option.repeatable && option.type == :hash
138
+ (@assigns[option.human_name] ||= {}).merge!(result)
139
+ elsif option.repeatable
140
+ (@assigns[option.human_name] ||= []) << result
141
+ else
142
+ @assigns[option.human_name] = result
143
+ end
143
144
  end
144
- end
145
+
145
146
  # Check if the current value in peek is a registered switch.
146
147
  #
147
148
  # Two booleans are returned. The first is true if the current value
@@ -94,6 +94,8 @@ class Bundler::Thor
94
94
  # say("I know you knew that.")
95
95
  #
96
96
  def say(message = "", color = nil, force_new_line = (message.to_s !~ /( |\t)\Z/))
97
+ return if quiet?
98
+
97
99
  buffer = prepare_message(message, *color)
98
100
  buffer << "\n" if force_new_line && !message.to_s.end_with?("\n")
99
101
 
@@ -230,8 +232,9 @@ class Bundler::Thor
230
232
  paras = message.split("\n\n")
231
233
 
232
234
  paras.map! do |unwrapped|
233
- counter = 0
234
- unwrapped.split(" ").inject do |memo, word|
235
+ words = unwrapped.split(" ")
236
+ counter = words.first.length
237
+ words.inject do |memo, word|
235
238
  word = word.gsub(/\n\005/, "\n").gsub(/\005/, "\n")
236
239
  counter = 0 if word.include? "\n"
237
240
  if (counter + word.length + 1) < width
@@ -97,7 +97,11 @@ class Bundler::Thor
97
97
  protected
98
98
 
99
99
  def can_display_colors?
100
- stdout.tty? && !are_colors_disabled?
100
+ are_colors_supported? && !are_colors_disabled?
101
+ end
102
+
103
+ def are_colors_supported?
104
+ stdout.tty? && ENV["TERM"] != "dumb"
101
105
  end
102
106
 
103
107
  def are_colors_disabled?
@@ -1,3 +1,3 @@
1
1
  class Bundler::Thor
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.2.3".freeze
4
+ VERSION = "2.2.8".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
data/lib/rubygems.rb CHANGED
@@ -8,7 +8,7 @@
8
8
  require 'rbconfig'
9
9
 
10
10
  module Gem
11
- VERSION = "3.2.3".freeze
11
+ VERSION = "3.2.8".freeze
12
12
  end
13
13
 
14
14
  # Must be first since it unloads the prelude from 1.9.2
@@ -469,7 +469,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
469
469
  next if File.exist? subdir
470
470
  begin
471
471
  FileUtils.mkdir_p subdir, **options
472
- rescue Errno::EACCES
472
+ rescue SystemCallError
473
473
  end
474
474
  end
475
475
  ensure
@@ -6,8 +6,8 @@ require 'rubygems/command'
6
6
  # RubyGems checkout or tarball.
7
7
 
8
8
  class Gem::Commands::SetupCommand < Gem::Command
9
- HISTORY_HEADER = /^===\s*[\d.a-zA-Z]+\s*\/\s*\d{4}-\d{2}-\d{2}\s*$/.freeze
10
- VERSION_MATCHER = /^===\s*([\d.a-zA-Z]+)\s*\/\s*\d{4}-\d{2}-\d{2}\s*$/.freeze
9
+ HISTORY_HEADER = /^#\s*[\d.a-zA-Z]+\s*\/\s*\d{4}-\d{2}-\d{2}\s*$/.freeze
10
+ VERSION_MATCHER = /^#\s*([\d.a-zA-Z]+)\s*\/\s*\d{4}-\d{2}-\d{2}\s*$/.freeze
11
11
 
12
12
  ENV_PATHS = %w[/usr/bin/env /bin/env].freeze
13
13
 
@@ -167,19 +167,18 @@ By default, this RubyGems will install gem as:
167
167
  extend MakeDirs
168
168
 
169
169
  lib_dir, bin_dir = make_destination_dirs install_destdir
170
- man_dir = make_man_dir install_destdir
170
+ man_dir = generate_default_man_dir install_destdir
171
171
 
172
172
  install_lib lib_dir
173
173
 
174
- install_man man_dir
175
-
176
174
  install_executables bin_dir
177
175
 
178
176
  remove_old_bin_files bin_dir
179
177
 
180
178
  remove_old_lib_files lib_dir
181
179
 
182
- remove_old_man_files man_dir
180
+ # Can be removed one we drop support for bundler 2.2.3 (the last version installing man files to man_dir)
181
+ remove_old_man_files man_dir if man_dir && File.exist?(man_dir)
183
182
 
184
183
  install_default_bundler_gem bin_dir
185
184
 
@@ -330,21 +329,6 @@ By default, this RubyGems will install gem as:
330
329
  end
331
330
  end
332
331
 
333
- def install_man(man_dir)
334
- mans = { 'Bundler' => 'bundler/man' }
335
- mans.each do |tool, path|
336
- say "Installing #{tool} manpages" if @verbose
337
-
338
- bundler_man1_files = bundler_man1_files_in(path)
339
- bundler_man5_files = bundler_man5_files_in(path)
340
-
341
- Dir.chdir path do
342
- install_file_list(bundler_man1_files, "#{man_dir}/man1")
343
- install_file_list(bundler_man5_files, "#{man_dir}/man5")
344
- end
345
- end
346
- end
347
-
348
332
  def install_rdoc
349
333
  gem_doc_dir = File.join Gem.dir, 'doc'
350
334
  rubygems_name = "rubygems-#{Gem::VERSION}"
@@ -391,9 +375,7 @@ By default, this RubyGems will install gem as:
391
375
  specs_dir = File.join(options[:destdir], specs_dir) unless Gem.win_platform?
392
376
  mkdir_p specs_dir, :mode => 0755
393
377
 
394
- bundler_spec = Gem::Specification.load("bundler/bundler.gemspec")
395
- bundler_spec.files = Dir.chdir("bundler") { Dir["{*.md,{lib,exe,man}/**/*}"] }
396
- bundler_spec.executables -= %w[bundler bundle_ruby]
378
+ bundler_spec = Dir.chdir("bundler") { Gem::Specification.load("bundler.gemspec") }
397
379
 
398
380
  # Remove bundler-*.gemspec in default specification directory.
399
381
  Dir.entries(specs_dir).
@@ -455,19 +437,12 @@ By default, this RubyGems will install gem as:
455
437
  return lib_dir, bin_dir
456
438
  end
457
439
 
458
- def make_man_dir(install_destdir)
459
- man_dir = generate_default_man_dir(install_destdir)
460
-
461
- mkdir_p man_dir, :mode => 0755
462
-
463
- return man_dir
464
- end
465
-
466
440
  def generate_default_man_dir(install_destdir)
467
441
  prefix = options[:prefix]
468
442
 
469
443
  if prefix.empty?
470
444
  man_dir = RbConfig::CONFIG['mandir']
445
+ return unless man_dir
471
446
  else
472
447
  man_dir = File.join prefix, 'man'
473
448
  end
@@ -518,20 +493,6 @@ By default, this RubyGems will install gem as:
518
493
  end
519
494
  end
520
495
 
521
- # for installation of bundler as default gems
522
- def bundler_man1_files_in(dir)
523
- Dir.chdir dir do
524
- Dir['bundle*.1']
525
- end
526
- end
527
-
528
- # for installation of bundler as default gems
529
- def bundler_man5_files_in(dir)
530
- Dir.chdir dir do
531
- Dir['gemfile.5']
532
- end
533
- end
534
-
535
496
  def remove_old_bin_files(bin_dir)
536
497
  old_bin_files = {
537
498
  'gem_mirror' => 'gem mirror',
@@ -585,33 +546,26 @@ abort "#{deprecation_message}"
585
546
  end
586
547
  end
587
548
 
588
- def remove_old_man_files(man_dir)
589
- man_dirs = { man_dir => "bundler/man" }
590
- man_dirs.each do |old_man_dir, new_man_dir|
591
- man1_files = bundler_man1_files_in(new_man_dir)
592
-
593
- old_man1_dir = "#{old_man_dir}/man1"
594
- old_man1_files = bundler_man1_files_in(old_man1_dir)
595
- old_man1_files += Dir.chdir(old_man1_dir) { Dir["bundle*.1.{txt,ronn}"] }
549
+ def remove_old_man_files(old_man_dir)
550
+ old_man1_dir = "#{old_man_dir}/man1"
596
551
 
597
- man1_to_remove = old_man1_files - man1_files
552
+ if File.exist?(old_man1_dir)
553
+ man1_to_remove = Dir.chdir(old_man1_dir) { Dir["bundle*.1{,.txt,.ronn}"] }
598
554
 
599
555
  remove_file_list(man1_to_remove, old_man1_dir)
556
+ end
600
557
 
601
- man5_files = bundler_man5_files_in(new_man_dir)
602
-
603
- old_man5_dir = "#{old_man_dir}/man5"
604
- old_man5_files = bundler_man5_files_in(old_man5_dir)
605
- old_man5_files += Dir.chdir(old_man5_dir) { Dir["gemfile.5.{txt,ronn}"] }
558
+ old_man5_dir = "#{old_man_dir}/man5"
606
559
 
607
- man5_to_remove = old_man5_files - man5_files
560
+ if File.exist?(old_man5_dir)
561
+ man5_to_remove = Dir.chdir(old_man5_dir) { Dir["gemfile.5{,.txt,.ronn}"] }
608
562
 
609
563
  remove_file_list(man5_to_remove, old_man5_dir)
610
564
  end
611
565
  end
612
566
 
613
567
  def show_release_notes
614
- release_notes = File.join Dir.pwd, 'History.txt'
568
+ release_notes = File.join Dir.pwd, 'CHANGELOG.md'
615
569
 
616
570
  release_notes =
617
571
  if File.exist? release_notes