Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rubinius/rubinius
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 532cb8091624
Choose a base ref
...
head repository: rubinius/rubinius
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1546181c5e9d
Choose a head ref
  • 2 commits
  • 166 files changed
  • 1 contributor

Commits on Mar 30, 2016

  1. Updated gems_list.txt.

    brixen committed Mar 30, 2016
    Copy the full SHA
    f11a9b0 View commit details
  2. Updated rubygems to 2.6.2

    RubyGems 2.6.2 installed
    
    === 2.6.2 / 2016-03-12
    
    Bug fixes:
    
    * Fix wrong version of gem activation for bin stub. Pull request #1527 by
      Aaron Patterson.
    * Speed up gem activation failures. Pull request #1539 by Aaron Patterson.
    * Fix platform sorting in the resolver. Pull request #1542 by Samuel E.
      Giddins.
    * Ensure we unlock the monitor even if try_activate throws. Pull request
      #1538 by Charles Oliver Nutter.
    
    === 2.6.1 / 2016-02-28
    
    Bug fixes:
    
    * Ensure `default_path` and `home` are set for paths. Pull request #1513
      by Aaron Patterson.
    * Restore but deprecate support for Array values on `Gem.paths=`. Pull
      request #1514 by Aaron Patterson.
    * Fix invalid gem file preventing gem install from working. Pull request
      #1499 by Luis Sagastume.
    
    === 2.6.0 / 2016-02-26
    
    Minor enhancements:
    
    * RubyGems now defaults the `gem push` to the gem's "allowed_push_host"
      metadata setting.  Pull request #1486 by Josh Lane.
    * Update bundled Molinillo to 0.4.3. Pull request #1493 by Samuel E. Giddins.
    * Add version option to gem open command. Pull request #1483 by Hrvoje
      Šimić.
    * Feature/add silent flag. Pull request #1455 by Luis Sagastume.
    * Allow specifying gem requirements via env variables. Pull request #1472
      by Samuel E. Giddins.
    
    Bug fixes:
    
    * RubyGems now stores `gem push` credentials under the host you signed-in for.
      Pull request #1485 by Josh Lane.
    * Move `coding` location to first line. Pull request #1471 by SHIBATA
      Hiroshi.
    * [PathSupport] Handle a regexp path separator. Pull request #1469 by
      Samuel E. Giddins.
    * Clean up the PathSupport object. Pull request #1094 by Aaron Patterson.
    * Join with File::PATH_SEPARATOR in Gem.use_paths. Pull request #1476 by
      Samuel E. Giddins.
    * Handle when the gem home and gem path arent set in the config file. Pull
      request #1478 by Samuel E. Giddins.
    * Terminate TimeoutHandler. Pull request #1479 by Nobuyoshi Nakada.
    * Remove redundant cache. Pull request #1482 by Eileen M. Uchitelle.
    * Freeze `Gem::Version@segments` instance variable. Pull request #1487 by
      Ben Dean.
    * Gem cleanup is trying to uninstall gems outside GEM_HOME and reporting
      an error after it tries. Pull request #1353 by Luis Sagastume.
    * Avoid duplicated sources. Pull request #1489 by Luis Sagastume.
    * Better description for quiet flag. Pull request #1491 by Luis Sagastume.
    * Raise error if find_by_name returns with nil. Pull request #1494 by
      Zoltán Hegedüs.
    * Find_files only from loaded_gems when using gemdeps. Pull request #1277
      by Michal Papis.
    
    === 2.5.2 / 2016-01-31
    
    Bug fixes:
    
    * Fix memoization of Gem::Version#prerelease? Pull request #1125 by Matijs van
      Zuijlen.
    * Handle trailing colons in GEM_PATH, by Damien Robert.
    * Improve the Gemfile `gemspec` method, fixing #1204 and #1033. Pull request
      #1276 by Michael Papis.
    * Warn only once when a gemspec license is invalid. Pull request #1414 by Samuel
      E. Giddins.
    * Check for exact constants before using them, fixing Ruby bug #11940. Pull
      request #1438 by Nobuyoshi Nakada.
    * Fix building C extensions on Ruby 1.9.x on Windows. Pull request #1453 by Marie
      Markwell.
    * Handle symlinks containing ".." correctly. Pull request #1457 by Samuel E.
      Giddins.
    
    Minor enhancements:
    
    * Add `--no-rc` flag, which skips loading `.gemrc`. Pull request #1329 by Luis
      Sagastume.
    * Allow basic auth to be excluded from `allowed_push_host`. By Josh Lane.
    * Add `gem list --exact`, which finds gems by string match instead of regex. Pull
      request #1344 by Luis Sagastume.
    * Suggest alternatives when gem license is unknown. Pull request #1443 by Samuel
      E. Giddins.
    * Print a useful error if a binstub expects a newer version of a gem than is
      installed. Pull request #1407 by Samuel E. Giddins.
    * Allow the (supported) s3:// scheme to be used with `--source`. Pull request
      #1416 by Dave Adams.
    * Add `--[no-]post-install-message` to `install` and `update`. Pull request #1162
      by Josef Šimánek.
    * Add `--host` option to `yank`, providing symmetry with `pull`. Pull request
      #1361 by Mike Virata-Stone.
    * Update bundled Molinillo to 0.4.1. Pull request #1452 by Samuel E. Giddins.
    * Allow calling `build` without '.gemspec'. Pull request #1454 by Stephen
      Blackstone.
    * Add support for `source` option on gems in Gemfile. Pull request #1355 by
      Michael Papis.
    * Function correctly when string literals are frozen on Ruby 2.3. Pull request
      #1408 by Samuel E. Giddins.
    
    === 2.5.1 / 2015-12-10
    
    Bug fixes:
    
    * Ensure platform sorting only uses strings. Affected binary installs on Windows.
      Issue #1369 reported by Ryan Atball (among others).
      Pull request #1375 by Samuel E. Giddins.
    * Revert PR #1332. Unable to reproduce, and nil should be impossible.
    * Gem::Specification#to_fullpath now returns .rb extensions when such a file
      exists.  Pull request #1114 by y-yagi.
    * RubyGems now handles Net::HTTPFatalError instead of crashing.  Pull
      request #1314 by Samuel E. Giddins.
    * Updated bundled Molinillo to 0.4.0.  Pull request #1322, #1396 by Samuel E.
      Giddins.
    * Improved performance of spec loading by reducing likelihood of loading the
      complete specification.  Pull request #1373 by Aaron Patterson.
    * Improved caching of requirable files  Pull request #1377 by Aaron Patterson.
    * Fixed activation of gems with development dependencies.  Pull request #1388
      by Samuel E. Giddins.
    * RubyGems now uses the same Molinillo vendoring strategy as Bundler.  Pull
      request #1397 by Samuel E. Giddins.
    * Fixed documentation of Gem::Requirement.parse.  Pull request #1398 by
      Juanito Fatas.
    * RubyGems no longer warns when a prerelease gem has prerelease dependencies.
      Pull request #1399 by Samuel E. Giddins.
    * Fixed Gem::Version documentation example.  Pull request #1401 by Guilherme
      Goettems Schneider.
    * Updated documentation links to https://.  Pull request #1404 by Suriyaa
      Kudo.
    * Fixed double word typo.  Pull request #1411 by Jake Worth.
    
    ------------------------------------------------------------------------------
    brixen committed Mar 30, 2016
    Copy the full SHA
    1546181 View commit details
Showing with 745 additions and 224 deletions.
  1. +1 −1 gems_list.txt
  2. +1 −0 library/gauntlet_rubygems.rb
  3. +74 −11 library/rubygems.rb
  4. +1 −0 library/rubygems/available_set.rb
  5. +5 −6 library/rubygems/basic_specification.rb
  6. +15 −3 library/rubygems/command.rb
  7. +1 −0 library/rubygems/command_manager.rb
  8. +5 −0 library/rubygems/commands/build_command.rb
  9. +1 −0 library/rubygems/commands/cert_command.rb
  10. +1 −0 library/rubygems/commands/check_command.rb
  11. +9 −3 library/rubygems/commands/cleanup_command.rb
  12. +1 −0 library/rubygems/commands/contents_command.rb
  13. +3 −2 library/rubygems/commands/dependency_command.rb
  14. +3 −3 library/rubygems/commands/environment_command.rb
  15. +1 −0 library/rubygems/commands/fetch_command.rb
  16. +1 −0 library/rubygems/commands/generate_index_command.rb
  17. +1 −0 library/rubygems/commands/help_command.rb
  18. +2 −0 library/rubygems/commands/install_command.rb
  19. +1 −0 library/rubygems/commands/list_command.rb
  20. +1 −0 library/rubygems/commands/lock_command.rb
  21. +1 −0 library/rubygems/commands/mirror_command.rb
  22. +5 −0 library/rubygems/commands/open_command.rb
  23. +1 −0 library/rubygems/commands/outdated_command.rb
  24. +1 −0 library/rubygems/commands/owner_command.rb
  25. +1 −0 library/rubygems/commands/pristine_command.rb
  26. +8 −3 library/rubygems/commands/push_command.rb
  27. +12 −5 library/rubygems/commands/query_command.rb
  28. +1 −0 library/rubygems/commands/rdoc_command.rb
  29. +1 −0 library/rubygems/commands/search_command.rb
  30. +1 −0 library/rubygems/commands/server_command.rb
  31. +1 −0 library/rubygems/commands/setup_command.rb
  32. +1 −0 library/rubygems/commands/sources_command.rb
  33. +1 −0 library/rubygems/commands/specification_command.rb
  34. +1 −0 library/rubygems/commands/stale_command.rb
  35. +1 −0 library/rubygems/commands/uninstall_command.rb
  36. +1 −0 library/rubygems/commands/unpack_command.rb
  37. +2 −0 library/rubygems/commands/update_command.rb
  38. +1 −0 library/rubygems/commands/which_command.rb
  39. +11 −15 library/rubygems/commands/yank_command.rb
  40. +1 −0 library/rubygems/compatibility.rb
  41. +17 −6 library/rubygems/config_file.rb
  42. +1 −0 library/rubygems/core_ext/kernel_gem.rb
  43. +9 −5 library/rubygems/core_ext/kernel_require.rb
  44. +1 −0 library/rubygems/defaults.rb
  45. +12 −9 library/rubygems/dependency.rb
  46. +1 −0 library/rubygems/dependency_installer.rb
  47. +1 −0 library/rubygems/dependency_list.rb
  48. +1 −0 library/rubygems/deprecate.rb
  49. +1 −0 library/rubygems/doctor.rb
  50. +1 −0 library/rubygems/errors.rb
  51. +2 −2 library/rubygems/exceptions.rb
  52. +1 −0 library/rubygems/ext.rb
  53. +1 −0 library/rubygems/ext/build_error.rb
  54. +1 −0 library/rubygems/ext/builder.rb
  55. +1 −0 library/rubygems/ext/cmake_builder.rb
  56. +1 −0 library/rubygems/ext/configure_builder.rb
  57. +15 −4 library/rubygems/ext/ext_conf_builder.rb
  58. +1 −0 library/rubygems/ext/rake_builder.rb
  59. +1 −0 library/rubygems/gem_runner.rb
  60. +18 −4 library/rubygems/gemcutter_utilities.rb
  61. +1 −0 library/rubygems/indexer.rb
  62. +1 −0 library/rubygems/install_default_message.rb
  63. +1 −0 library/rubygems/install_message.rb
  64. +7 −0 library/rubygems/install_update_options.rb
  65. +14 −6 library/rubygems/installer.rb
  66. +3 −0 library/rubygems/installer_test_case.rb
  67. +2 −1 library/rubygems/local_remote_options.rb
  68. +1 −0 library/rubygems/mock_gem_ui.rb
  69. +2 −1 library/rubygems/name_tuple.rb
  70. +3 −2 library/rubygems/package.rb
  71. +1 −0 library/rubygems/package/digest_io.rb
  72. +1 −0 library/rubygems/package/file_source.rb
  73. +1 −0 library/rubygems/package/io_source.rb
  74. +4 −4 library/rubygems/package/old.rb
  75. +1 −0 library/rubygems/package/source.rb
  76. +1 −1 library/rubygems/package/tar_header.rb
  77. +1 −1 library/rubygems/package/tar_reader.rb
  78. +1 −0 library/rubygems/package/tar_reader/entry.rb
  79. +1 −0 library/rubygems/package/tar_test_case.rb
  80. +1 −0 library/rubygems/package/tar_writer.rb
  81. +1 −0 library/rubygems/package_task.rb
  82. +25 −25 library/rubygems/path_support.rb
  83. +1 −0 library/rubygems/platform.rb
  84. +1 −0 library/rubygems/psych_additions.rb
  85. +1 −0 library/rubygems/psych_tree.rb
  86. +1 −0 library/rubygems/rdoc.rb
  87. +1 −0 library/rubygems/remote_fetcher.rb
  88. +3 −2 library/rubygems/request.rb
  89. +1 −0 library/rubygems/request/connection_pools.rb
  90. +1 −0 library/rubygems/request/http_pool.rb
  91. +1 −0 library/rubygems/request/https_pool.rb
  92. +14 −8 library/rubygems/request_set.rb
  93. +54 −6 library/rubygems/request_set/gem_dependency_api.rb
  94. +3 −3 library/rubygems/request_set/lockfile.rb
  95. +18 −9 library/rubygems/request_set/lockfile/parser.rb
  96. +1 −0 library/rubygems/request_set/lockfile/tokenizer.rb
  97. +1 −0 library/rubygems/requirement.rb
  98. +4 −2 library/rubygems/resolver.rb
  99. +18 −5 library/rubygems/resolver/activation_request.rb
  100. +1 −0 library/rubygems/resolver/api_set.rb
  101. +1 −0 library/rubygems/resolver/api_specification.rb
  102. +1 −0 library/rubygems/resolver/best_set.rb
  103. +1 −0 library/rubygems/resolver/composed_set.rb
  104. +1 −0 library/rubygems/resolver/conflict.rb
  105. +1 −0 library/rubygems/resolver/current_set.rb
  106. +1 −0 library/rubygems/resolver/dependency_request.rb
  107. +1 −0 library/rubygems/resolver/git_set.rb
  108. +1 −0 library/rubygems/resolver/git_specification.rb
  109. +1 −0 library/rubygems/resolver/index_set.rb
  110. +1 −0 library/rubygems/resolver/index_specification.rb
  111. +1 −0 library/rubygems/resolver/installed_specification.rb
  112. +9 −4 library/rubygems/resolver/installer_set.rb
  113. +1 −0 library/rubygems/resolver/local_specification.rb
  114. +4 −5 library/rubygems/resolver/lock_set.rb
  115. +6 −2 library/rubygems/resolver/lock_specification.rb
  116. +1 −0 library/rubygems/resolver/molinillo.rb
  117. +5 −0 library/rubygems/resolver/molinillo/lib/molinillo.rb
  118. +14 −0 library/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb
  119. +6 −0 library/rubygems/resolver/molinillo/lib/molinillo/errors.rb
  120. +3 −1 library/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb
  121. +1 −0 library/rubygems/resolver/molinillo/lib/molinillo/modules/specification_provider.rb
  122. +3 −1 library/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb
  123. +39 −14 library/rubygems/resolver/molinillo/lib/molinillo/resolution.rb
  124. +3 −1 library/rubygems/resolver/molinillo/lib/molinillo/resolver.rb
  125. +8 −7 library/rubygems/resolver/molinillo/lib/molinillo/state.rb
  126. +1 −0 library/rubygems/resolver/requirement_list.rb
  127. +1 −0 library/rubygems/resolver/set.rb
  128. +48 −0 library/rubygems/resolver/source_set.rb
  129. +1 −0 library/rubygems/resolver/spec_specification.rb
  130. +1 −0 library/rubygems/resolver/specification.rb
  131. +1 −0 library/rubygems/resolver/stats.rb
  132. +1 −0 library/rubygems/resolver/vendor_set.rb
  133. +1 −0 library/rubygems/resolver/vendor_specification.rb
  134. +3 −2 library/rubygems/security.rb
  135. +1 −0 library/rubygems/security/policies.rb
  136. +2 −2 library/rubygems/security/policy.rb
  137. +1 −0 library/rubygems/security/signer.rb
  138. +1 −0 library/rubygems/security/trust_dir.rb
  139. +1 −0 library/rubygems/server.rb
  140. +1 −0 library/rubygems/source.rb
  141. +1 −0 library/rubygems/source/git.rb
  142. +1 −0 library/rubygems/source/installed.rb
  143. +1 −0 library/rubygems/source/local.rb
  144. +1 −0 library/rubygems/source/lock.rb
  145. +1 −0 library/rubygems/source/specific_file.rb
  146. +1 −0 library/rubygems/source/vendor.rb
  147. +3 −2 library/rubygems/source_list.rb
  148. +1 −0 library/rubygems/source_local.rb
  149. +1 −0 library/rubygems/source_specific_file.rb
  150. +1 −0 library/rubygems/spec_fetcher.rb
  151. +14 −6 library/rubygems/specification.rb
  152. +1 −0 library/rubygems/stub_specification.rb
  153. +1 −0 library/rubygems/syck_hack.rb
  154. +25 −4 library/rubygems/test_case.rb
  155. +1 −0 library/rubygems/test_utilities.rb
  156. +1 −1 library/rubygems/text.rb
  157. +1 −0 library/rubygems/uninstaller.rb
  158. +1 −0 library/rubygems/uri_formatter.rb
  159. +1 −0 library/rubygems/user_interaction.rb
  160. +2 −1 library/rubygems/util.rb
  161. +14 −0 library/rubygems/util/licenses.rb
  162. +1 −0 library/rubygems/util/list.rb
  163. +1 −0 library/rubygems/validator.rb
  164. +21 −13 library/rubygems/version.rb
  165. +1 −0 library/rubygems/version_option.rb
  166. +1 −0 library/ubygems.rb
2 changes: 1 addition & 1 deletion gems_list.txt
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ rubinius-bridge-1.1.0.gem
rubinius-code-3.0.gem
rubinius-compiler-3.1.gem
rubinius-coverage-2.0.3.gem
rubinius-debugger-2.2.1.gem
rubinius-debugger-2.4.gem
rubinius-developer_tools-2.0.0.gem
rubinius-instructions-3.0.gem
rubinius-melbourne-3.4.gem
1 change: 1 addition & 0 deletions library/gauntlet_rubygems.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'rubygems'
require 'gauntlet'

85 changes: 74 additions & 11 deletions library/rubygems.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# -*- ruby -*-
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
@@ -9,7 +10,7 @@
require 'thread'

module Gem
VERSION = '2.5.1'
VERSION = '2.6.2'
end

# Must be first since it unloads the prelude from 1.9.2
@@ -191,8 +192,13 @@ def self.try_activate path

begin
spec.activate
rescue Gem::LoadError # this could fail due to gem dep collisions, go lax
Gem::Specification.find_by_name(spec.name).activate
rescue Gem::LoadError => e # this could fail due to gem dep collisions, go lax
spec_by_name = Gem::Specification.find_by_name(spec.name)
if spec_by_name.nil?
raise e
else
spec_by_name.activate
end
end

return true
@@ -229,16 +235,20 @@ def self.bin_path(name, exec_name = nil, *requirements)
requirements = Gem::Requirement.default if
requirements.empty?

find_spec_for_exe(name, exec_name, requirements).bin_file exec_name
end

def self.find_spec_for_exe name, exec_name, requirements
dep = Gem::Dependency.new name, requirements

loaded = Gem.loaded_specs[name]

return loaded.bin_file exec_name if loaded && dep.matches_spec?(loaded)
return loaded if loaded && dep.matches_spec?(loaded)

specs = dep.matching_specs(true)

raise Gem::GemNotFoundException,
"can't find gem #{name} (#{requirements})" if specs.empty?
"can't find gem #{dep}" if specs.empty?

specs = specs.find_all { |spec|
spec.executables.include? exec_name
@@ -249,6 +259,24 @@ def self.bin_path(name, exec_name = nil, *requirements)
raise Gem::GemNotFoundException, msg
end

spec
end
private_class_method :find_spec_for_exe

##
# Find the full path to the executable for gem +name+. If the +exec_name+
# is not given, the gem's default_executable is chosen, otherwise the
# specified executable's path is returned. +requirements+ allows
# you to specify specific gem versions.
#
# A side effect of this method is that it will activate the gem that
# contains the executable.
#
# This method should *only* be used in bin stub files.

def self.activate_bin_path name, exec_name, requirement # :nodoc:
spec = find_spec_for_exe name, exec_name, [requirement]
Gem::LOADED_SPECS_MUTEX.synchronize { spec.activate }
spec.bin_file exec_name
end

@@ -325,16 +353,38 @@ def self.deflate(data)
# lookup files.

def self.paths
@paths ||= Gem::PathSupport.new
@paths ||= Gem::PathSupport.new(ENV)
end

# Initialize the filesystem paths to use from +env+.
# +env+ is a hash-like object (typically ENV) that
# is queried for 'GEM_HOME', 'GEM_PATH', and 'GEM_SPEC_CACHE'
# Keys for the +env+ hash should be Strings, and values of the hash should
# be Strings or +nil+.

def self.paths=(env)
clear_paths
@paths = Gem::PathSupport.new env
target = {}
env.each_pair do |k,v|
case k
when 'GEM_HOME', 'GEM_PATH', 'GEM_SPEC_CACHE'
case v
when nil, String
target[k] = v
when Array
unless Gem::Deprecate.skip
warn <<-eowarn
Array values in the parameter are deprecated. Please use a String or nil.
An Array was passed in from #{caller[3]}
eowarn
end
target[k] = v.join File::PATH_SEPARATOR
end
else
target[k] = v
end
end
@paths = Gem::PathSupport.new ENV.to_hash.merge(target)
Gem::Specification.dirs = @paths.path
end

@@ -429,7 +479,9 @@ def self.find_files(glob, check_load_path=true)

files = find_files_from_load_path glob if check_load_path

files.concat Gem::Specification.stubs.map { |spec|
gem_specifications = @gemdeps ? Gem.loaded_specs.values : Gem::Specification.stubs

files.concat gem_specifications.map { |spec|
spec.matches_for_glob("#{glob}#{Gem.suffix_pattern}")
}.flatten

@@ -811,6 +863,15 @@ def self.ruby_api_version
@ruby_api_version ||= RbConfig::CONFIG['ruby_version'].dup
end

def self.env_requirement(gem_name)
@env_requirements_by_name ||= {}
@env_requirements_by_name[gem_name] ||= begin
req = ENV["GEM_REQUIREMENT_#{gem_name.upcase}"] || '>= 0'.freeze
Gem::Requirement.create(req)
end
end
post_reset { @env_requirements_by_name = {} }

##
# Returns the latest release-version specification for the gem +name+.

@@ -938,9 +999,11 @@ def self.ui
# by the unit tests to provide environment isolation.

def self.use_paths(home, *paths)
paths = nil if paths == [nil]
paths = paths.first if Array === Array(paths).first
self.paths = { "GEM_HOME" => home, "GEM_PATH" => paths }
paths.flatten!
paths.compact!
hash = { "GEM_HOME" => home, "GEM_PATH" => paths.empty? ? home : paths.join(File::PATH_SEPARATOR) }
hash.delete_if { |_, v| v.nil? }
self.paths = hash
end

##
1 change: 1 addition & 0 deletions library/rubygems/available_set.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class Gem::AvailableSet

include Enumerable
11 changes: 5 additions & 6 deletions library/rubygems/basic_specification.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
##
# BasicSpecification is an abstract class which implements some common code
# used by both Specification and StubSpecification.
@@ -94,7 +95,7 @@ def extension_dir
# Returns path to the extensions directory.

def extensions_dir
@extensions_dir ||= Gem.default_ext_dir_for(base_dir) ||
Gem.default_ext_dir_for(base_dir) ||
File.join(base_dir, 'extensions', Gem::Platform.local.to_s,
Gem.extension_api_version)
end
@@ -124,9 +125,9 @@ def full_gem_path

def full_name
if platform == Gem::Platform::RUBY or platform.nil? then
"#{name}-#{version}".untaint
"#{name}-#{version}".dup.untaint
else
"#{name}-#{version}-#{platform}".untaint
"#{name}-#{version}-#{platform}".dup.untaint
end
end

@@ -195,7 +196,6 @@ def gems_dir

def internal_init # :nodoc:
@extension_dir = nil
@extensions_dir = nil
@full_gem_path = nil
@gem_dir = nil
@ignored = nil
@@ -281,7 +281,7 @@ def lib_dirs_glob
self.require_paths.first
end

"#{self.full_gem_path}/#{dirs}".untaint
"#{self.full_gem_path}/#{dirs}".dup.untaint
end

##
@@ -325,4 +325,3 @@ def have_file? file, suffixes
end

end

18 changes: 15 additions & 3 deletions library/rubygems/command.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
@@ -153,7 +154,7 @@ def execute

def show_lookup_failure(gem_name, version, errors, domain)
if errors and !errors.empty?
msg = "Could not find a valid gem '#{gem_name}' (#{version}), here is why:\n"
msg = "Could not find a valid gem '#{gem_name}' (#{version}), here is why:\n".dup
errors.each { |x| msg << " #{x.wordy}\n" }
alert_error msg
else
@@ -299,6 +300,8 @@ def invoke_with_build_args(args, build_args)

options[:build_args] = build_args

self.ui = Gem::SilentUI.new if options[:silent]

if options[:help] then
show_help
elsif @when_invoked then
@@ -519,10 +522,15 @@ def wrap(text, width) # :doc:
end
end

add_common_option('-q', '--quiet', 'Silence commands') do |value, options|
add_common_option('-q', '--quiet', 'Silence command progress meter') do |value, options|
Gem.configuration.verbose = false
end

add_common_option("--silent",
"Silence rubygems output") do |value, options|
options[:silent] = true
end

# Backtrace and config-file are added so they show up in the help
# commands. Both options are actually handled before the other
# options get parsed.
@@ -539,6 +547,11 @@ def wrap(text, width) # :doc:
'Turn on Ruby debugging') do
end

add_common_option('--norc',
'Avoid loading any .gemrc file') do
end


# :stopdoc:

HELP = <<-HELP
@@ -579,4 +592,3 @@ def wrap(text, width) # :doc:

module Gem::Commands
end

1 change: 1 addition & 0 deletions library/rubygems/command_manager.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
5 changes: 5 additions & 0 deletions library/rubygems/commands/build_command.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/package'

@@ -41,6 +42,10 @@ def usage # :nodoc:
def execute
gemspec = get_one_gem_name

unless File.exist? gemspec
gemspec += '.gemspec' if File.exist? gemspec + '.gemspec'
end

if File.exist? gemspec then
spec = Gem::Specification.load gemspec

1 change: 1 addition & 0 deletions library/rubygems/commands/cert_command.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/security'
begin
1 change: 1 addition & 0 deletions library/rubygems/commands/check_command.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/version_option'
require 'rubygems/validator'
12 changes: 9 additions & 3 deletions library/rubygems/commands/cleanup_command.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/dependency_list'
require 'rubygems/uninstaller'
@@ -75,6 +76,9 @@ def execute
end

def clean_gems
@original_home = Gem.dir
@original_path = Gem.path

get_primary_gems
get_candidate_gems
get_gems_to_cleanup
@@ -86,9 +90,6 @@ def clean_gems

deps = deplist.strongly_connected_components.flatten

@original_home = Gem.dir
@original_path = Gem.path

deps.reverse_each do |spec|
uninstall_dep spec
end
@@ -107,6 +108,7 @@ def get_candidate_gems
end

def get_gems_to_cleanup

gems_to_cleanup = @candidate_gems.select { |spec|
@primary_gems[spec.name].version != spec.version
}
@@ -115,6 +117,10 @@ def get_gems_to_cleanup
spec.default_gem?
}

gems_to_cleanup = gems_to_cleanup.select { |spec|
spec.base_dir == @original_home
}

@default_gems += default_gems
@default_gems.uniq!
@gems_to_cleanup = gems_to_cleanup.uniq
1 change: 1 addition & 0 deletions library/rubygems/commands/contents_command.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'English'
require 'rubygems/command'
require 'rubygems/version_option'
5 changes: 3 additions & 2 deletions library/rubygems/commands/dependency_command.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/local_remote_options'
require 'rubygems/version_option'
@@ -99,7 +100,7 @@ def display_pipe specs # :nodoc:
end

def display_readable specs, reverse # :nodoc:
response = ''
response = String.new

specs.each do |spec|
response << print_dependencies(spec)
@@ -152,7 +153,7 @@ def ensure_specs specs # :nodoc:
end

def print_dependencies(spec, level = 0) # :nodoc:
response = ''
response = String.new
response << ' ' * level + "Gem #{spec.full_name}\n"
unless spec.dependencies.empty? then
spec.dependencies.sort_by { |dep| dep.name }.each do |dep|
Loading