diff options
author | Takuya Noguchi <takninnovationresearch@gmail.com> | 2022-07-17 08:08:51 +0000 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2022-07-22 12:07:23 +0900 |
commit | d7ffd3fea402239b16833cc434404a7af82d44f3 (patch) | |
tree | 9794942135111c36e6b6bce69e070ca556b89028 /lib/rubygems/defaults.rb | |
parent | 388c4e1076ac5a58d5008abc8e0a8d017698875a (diff) | |
download | ruby-d7ffd3fea402239b16833cc434404a7af82d44f3.tar.gz |
RubyGems: Enable Style/StringLiterals cop
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
Diffstat (limited to 'lib/rubygems/defaults.rb')
-rw-r--r-- | lib/rubygems/defaults.rb | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/rubygems/defaults.rb b/lib/rubygems/defaults.rb index 39b69ddb1c..d27f286265 100644 --- a/lib/rubygems/defaults.rb +++ b/lib/rubygems/defaults.rb @@ -20,10 +20,10 @@ module Gem # specified in the environment def self.default_spec_cache_dir - default_spec_cache_dir = File.join Gem.user_home, '.gem', 'specs' + default_spec_cache_dir = File.join Gem.user_home, ".gem", "specs" unless File.exist?(default_spec_cache_dir) - default_spec_cache_dir = File.join Gem.data_home, 'gem', 'specs' + default_spec_cache_dir = File.join Gem.data_home, "gem", "specs" end default_spec_cache_dir @@ -34,7 +34,7 @@ module Gem # specified in the environment def self.default_dir - @default_dir ||= File.join(RbConfig::CONFIG['rubylibprefix'], 'gems', RbConfig::CONFIG['ruby_version']) + @default_dir ||= File.join(RbConfig::CONFIG["rubylibprefix"], "gems", RbConfig::CONFIG["ruby_version"]) end ## @@ -81,7 +81,7 @@ module Gem Dir.home.dup rescue if Gem.win_platform? - File.expand_path File.join(ENV['HOMEDRIVE'] || ENV['SystemDrive'], '/') + File.expand_path File.join(ENV["HOMEDRIVE"] || ENV["SystemDrive"], "/") else File.expand_path "/" end @@ -103,7 +103,7 @@ module Gem gem_dir = File.join(Gem.user_home, ".gem") gem_dir = File.join(Gem.data_home, "gem") unless File.exist?(gem_dir) parts = [gem_dir, ruby_engine] - parts << RbConfig::CONFIG['ruby_version'] unless RbConfig::CONFIG['ruby_version'].empty? + parts << RbConfig::CONFIG["ruby_version"] unless RbConfig::CONFIG["ruby_version"].empty? File.join parts end @@ -111,14 +111,14 @@ module Gem # The path to standard location of the user's configuration directory. def self.config_home - @config_home ||= (ENV["XDG_CONFIG_HOME"] || File.join(Gem.user_home, '.config')) + @config_home ||= (ENV["XDG_CONFIG_HOME"] || File.join(Gem.user_home, ".config")) end ## # Finds the user's config file def self.find_config_file - gemrc = File.join Gem.user_home, '.gemrc' + gemrc = File.join Gem.user_home, ".gemrc" if File.exist? gemrc gemrc else @@ -137,14 +137,14 @@ module Gem # The path to standard location of the user's cache directory. def self.cache_home - @cache_home ||= (ENV["XDG_CACHE_HOME"] || File.join(Gem.user_home, '.cache')) + @cache_home ||= (ENV["XDG_CACHE_HOME"] || File.join(Gem.user_home, ".cache")) end ## # The path to standard location of the user's data directory. def self.data_home - @data_home ||= (ENV["XDG_DATA_HOME"] || File.join(Gem.user_home, '.local', 'share')) + @data_home ||= (ENV["XDG_DATA_HOME"] || File.join(Gem.user_home, ".local", "share")) end ## @@ -169,7 +169,7 @@ module Gem # Deduce Ruby's --program-prefix and --program-suffix from its install name def self.default_exec_format - exec_format = RbConfig::CONFIG['ruby_install_name'].sub('ruby', '%s') rescue '%s' + exec_format = RbConfig::CONFIG["ruby_install_name"].sub("ruby", "%s") rescue "%s" unless exec_format =~ /%s/ raise Gem::Exception, @@ -183,7 +183,7 @@ module Gem # The default directory for binaries def self.default_bindir - RbConfig::CONFIG['bindir'] + RbConfig::CONFIG["bindir"] end def self.ruby_engine @@ -227,14 +227,14 @@ module Gem # Directory where vendor gems are installed. def self.vendor_dir # :nodoc: - if vendor_dir = ENV['GEM_VENDOR'] + if vendor_dir = ENV["GEM_VENDOR"] return vendor_dir.dup end - return nil unless RbConfig::CONFIG.key? 'vendordir' + return nil unless RbConfig::CONFIG.key? "vendordir" - File.join RbConfig::CONFIG['vendordir'], 'gems', - RbConfig::CONFIG['ruby_version'] + File.join RbConfig::CONFIG["vendordir"], "gems", + RbConfig::CONFIG["ruby_version"] end ## |