class Gem::Specification

def extension_dir

def extension_dir
  # 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
    rg_extension_dir
  end
end