summaryrefslogtreecommitdiff
path: root/lib/bundler/rubygems_ext.rb
diff options
context:
space:
mode:
authorJosef Šimánek <josef.simanek@gmail.com>2023-03-24 21:00:40 +0100
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-03-28 15:25:44 +0900
commit9cfd8330ca875a60c057f97eafb151682dcc581b (patch)
tree93168ce2222486d5a39ff1a5ff913df680c43beb /lib/bundler/rubygems_ext.rb
parent4d4743f7e35ea9d97cde10c9ca6fc35ac568bdb1 (diff)
[rubygems/rubygems] Onboard Rubocop Naming/MemoizedInstanceVariableName rule to Bundler.
https://github.com/rubygems/rubygems/commit/d768be0c65
Diffstat (limited to 'lib/bundler/rubygems_ext.rb')
-rw-r--r--lib/bundler/rubygems_ext.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb
index d298a17672..b96edd5e2d 100644
--- a/lib/bundler/rubygems_ext.rb
+++ b/lib/bundler/rubygems_ext.rb
@@ -66,7 +66,9 @@ module Gem
alias_method :rg_extension_dir, :extension_dir
def extension_dir
- @bundler_extension_dir ||= if source.respond_to?(:extension_dir_name)
+ # following instance variable is already used in original method
+ # and that is the reason to prefix it with bundler_ and add rubocop exception
+ @bundler_extension_dir ||= if source.respond_to?(:extension_dir_name) # rubocop:disable Naming/MemoizedInstanceVariableName
unique_extension_dir = [source.extension_dir_name, File.basename(full_gem_path)].uniq.join("-")
File.expand_path(File.join(extensions_dir, unique_extension_dir))
else
@@ -221,9 +223,9 @@ module Gem
protected
def _requirements_sorted?
- return @_are_requirements_sorted if defined?(@_are_requirements_sorted)
+ return @_requirements_sorted if defined?(@_requirements_sorted)
strings = as_list
- @_are_requirements_sorted = strings == strings.sort
+ @_requirements_sorted = strings == strings.sort
end
def _with_sorted_requirements