ruby-changes:62440
From: Karol <ko1@a...>
Date: Fri, 31 Jul 2020 21:08:01 +0900 (JST)
Subject: [ruby-changes:62440] e7b6e0ff58 (master): [rubygems/rubygems] remove explicit require(s) for auto-loaded constant(s)
https://git.ruby-lang.org/ruby.git/commit/?id=e7b6e0ff58 From e7b6e0ff5823c422cd3e508d2b7104a91a2e36f6 Mon Sep 17 00:00:00 2001 From: Karol Bucek <kares@u...> Date: Mon, 22 Jun 2020 23:15:45 +0200 Subject: [rubygems/rubygems] remove explicit require(s) for auto-loaded constant(s) the Gem module's auto-loads will handle loading these as needed, this started as a redundancy found in *rubygems.rb* which had: `autoload :Specification, 'rubygems/specification'` as well as `require 'rubygems/specification'` https://github.com/rubygems/rubygems/commit/43ceae7ac0 diff --git a/lib/rubygems.rb b/lib/rubygems.rb index 68b5061..75122ed 100644 --- a/lib/rubygems.rb +++ b/lib/rubygems.rb @@ -1333,8 +1333,6 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} https://github.com/ruby/ruby/blob/trunk/lib/rubygems.rb#L1333 autoload :Specification, File.expand_path('rubygems/specification', __dir__) autoload :Util, File.expand_path('rubygems/util', __dir__) autoload :Version, File.expand_path('rubygems/version', __dir__) - - require "rubygems/specification" end require 'rubygems/exceptions' diff --git a/lib/rubygems/dependency.rb b/lib/rubygems/dependency.rb index 461c828..8634d71 100644 --- a/lib/rubygems/dependency.rb +++ b/lib/rubygems/dependency.rb @@ -2,9 +2,6 @@ https://github.com/ruby/ruby/blob/trunk/lib/rubygems/dependency.rb#L2 ## # The Dependency class holds a Gem name and a Gem::Requirement. -require "rubygems/bundler_version_finder" -require "rubygems/requirement" - class Gem::Dependency ## # Valid dependency types. diff --git a/lib/rubygems/gem_runner.rb b/lib/rubygems/gem_runner.rb index 48b8cdd..a366745 100644 --- a/lib/rubygems/gem_runner.rb +++ b/lib/rubygems/gem_runner.rb @@ -7,7 +7,6 @@ https://github.com/ruby/ruby/blob/trunk/lib/rubygems/gem_runner.rb#L7 require 'rubygems' require 'rubygems/command_manager' -require 'rubygems/config_file' require 'rubygems/deprecate' ## diff --git a/lib/rubygems/name_tuple.rb b/lib/rubygems/name_tuple.rb index a3fbe95..cb5604e 100644 --- a/lib/rubygems/name_tuple.rb +++ b/lib/rubygems/name_tuple.rb @@ -4,8 +4,6 @@ https://github.com/ruby/ruby/blob/trunk/lib/rubygems/name_tuple.rb#L4 # Represents a gem of name +name+ at +version+ of +platform+. These # wrap the data returned from the indexes. -require 'rubygems/platform' - class Gem::NameTuple def initialize(name, version, platform="ruby") @name = name diff --git a/lib/rubygems/package.rb b/lib/rubygems/package.rb index 46485f8..426d33c 100644 --- a/lib/rubygems/package.rb +++ b/lib/rubygems/package.rb @@ -43,7 +43,6 @@ https://github.com/ruby/ruby/blob/trunk/lib/rubygems/package.rb#L43 require "rubygems" require 'rubygems/security' -require 'rubygems/specification' require 'rubygems/user_interaction' require 'zlib' diff --git a/lib/rubygems/requirement.rb b/lib/rubygems/requirement.rb index c8c9664..65bc837 100644 --- a/lib/rubygems/requirement.rb +++ b/lib/rubygems/requirement.rb @@ -1,5 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/lib/rubygems/requirement.rb#L1 # frozen_string_literal: true -require "rubygems/version" require "rubygems/deprecate" ## diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb index 138e5cb..ddcd0aa 100644 --- a/lib/rubygems/specification.rb +++ b/lib/rubygems/specification.rb @@ -6,9 +6,6 @@ https://github.com/ruby/ruby/blob/trunk/lib/rubygems/specification.rb#L6 # See LICENSE.txt for permissions. #++ -require 'rubygems/version' -require 'rubygems/requirement' -require 'rubygems/platform' require 'rubygems/deprecate' require 'rubygems/basic_specification' require 'rubygems/stub_specification' -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/