summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosef Šimánek <[email protected]>2023-03-24 20:41:46 +0100
committerHiroshi SHIBATA <[email protected]>2023-03-28 15:27:35 +0900
commit1cbb5011274399527c26eb3c6dd98c7947140f83 ()
treea08228826d485d03d6aa6386d9dbfecf4ed4f385
parent2322b189b6ac650199f09895dd9870fc0466d492 (diff)
Onboard Rubocop Naming/MemoizedInstanceVariableName rule to RubyGems.
-rw-r--r--lib/rubygems/command_manager.rb4
-rw-r--r--lib/rubygems/installer.rb2
-rw-r--r--lib/rubygems/request_set.rb4
-rw-r--r--lib/rubygems/specification.rb4
-rw-r--r--lib/rubygems/stub_specification.rb3
5 files changed, 10 insertions, 7 deletions
@@ -84,7 +84,7 @@ class Gem::CommandManager
# Return the authoritative instance of the command manager.
def self.instance
- @command_manager ||= new
end
##
@@ -99,7 +99,7 @@ class Gem::CommandManager
# Reset the authoritative instance of the command manager.
def self.reset
- @command_manager = nil
end
##
@@ -387,7 +387,7 @@ class Gem::Installer
# we'll be installing into.
def installed_specs
- @specs ||= begin
specs = []
Gem::Util.glob_files_in_dir("*.gemspec", File.join(gem_home, "specifications")).each do |path|
@@ -108,7 +108,7 @@ class Gem::RequestSet
@requests = []
@sets = []
@soft_missing = false
- @sorted = nil
@specs = nil
@vendor_set = nil
@source_set = nil
@@ -426,7 +426,7 @@ class Gem::RequestSet
end
def sorted_requests
- @sorted ||= strongly_connected_components.flatten
end
def specs
@@ -2236,7 +2236,7 @@ class Gem::Specification < Gem::BasicSpecification
# The platform this gem runs on. See Gem::Platform for details.
def platform
- @new_platform ||= Gem::Platform::RUBY
end
def pretty_print(q) # :nodoc:
@@ -2711,6 +2711,8 @@ class Gem::Specification < Gem::BasicSpecification
end
@installed_by_version ||= nil
end
def flatten_require_paths # :nodoc:
@@ -182,7 +182,7 @@ class Gem::StubSpecification < Gem::BasicSpecification
##
# The full Gem::Specification for this gem, loaded from evalling its gemspec
- def to_spec
@spec ||= if @data
loaded = Gem.loaded_specs[name]
loaded if loaded && loaded.version == version
@@ -190,6 +190,7 @@ class Gem::StubSpecification < Gem::BasicSpecification
@spec ||= Gem::Specification.load(loaded_from)
end
##
# Is this StubSpecification valid? i.e. have we found a stub line, OR does