diff options
author | David RodrÃguez <[email protected]> | 2023-10-27 20:50:20 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2023-11-13 11:06:10 +0900 |
commit | 3757d9027c612c88fdbf449eacf7f8f6c9b2e932 () | |
tree | 1de46b20c94f661e375c27e54f367c846360d433 | |
parent | e6c84d05d0cfb9f20725716b93439746c697ce41 (diff) |
[rubygems/rubygems] Remove now unnecessary dups
https://.com/rubygems/rubygems/commit/56ce2a6445
-rw-r--r-- | lib/rubygems/basic_specification.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/bundler_version_finder.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/config_file.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/core_ext/kernel_require.rb | 5 | ||||
-rw-r--r-- | lib/rubygems/name_tuple.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/path_support.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/request_set.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/specification.rb | 3 |
8 files changed, 8 insertions, 12 deletions
@@ -293,7 +293,7 @@ class Gem::BasicSpecification "lib" # default value for require_paths for bundler/inline end - "#{full_gem_path}/#{dirs}".dup end ## @@ -67,7 +67,7 @@ module Gem::BundlerVersionFinder lockfile = case gemfile when "gems.rb" then "gems.locked" else "#{gemfile}.lock" - end.dup return unless File.file?(lockfile) @@ -188,7 +188,7 @@ class Gem::ConfigFile operating_system_config = Marshal.load Marshal.dump(OPERATING_SYSTEM_DEFAULTS) platform_config = Marshal.load Marshal.dump(PLATFORM_DEFAULTS) system_config = load_file SYSTEM_WIDE_CONFIG_FILE - user_config = load_file config_file_name.dup environment_config = (ENV["GEMRC"] || ""). split(File::PATH_SEPARATOR).inject({}) do |result, file| @@ -46,12 +46,11 @@ module Kernel load_path_check_index = Gem.load_path_insert_index - Gem.activated_gem_paths Gem.suffixes.find do |s| $LOAD_PATH[0...load_path_check_index].find do |lp| - safe_lp = lp.dup - if File.symlink? safe_lp # for backward compatibility next end - full_path = File.expand_path(File.join(safe_lp, "#{path}#{s}")) rp = full_path if File.file?(full_path) end end @@ -51,7 +51,7 @@ class Gem::NameTuple "#{@name}-#{@version}" else "#{@name}-#{@version}-#{@platform}" - end.dup end ## @@ -47,8 +47,6 @@ class Gem::PathSupport @path = split_gem_path env["GEM_PATH"], @home @spec_cache_dir = env["GEM_SPEC_CACHE"] || Gem.default_spec_cache_dir - - @spec_cache_dir = @spec_cache_dir.dup end private @@ -324,7 +324,7 @@ class Gem::RequestSet @git_set.root_dir = @install_dir - lock_file = "#{File.expand_path(path)}.lock".dup begin tokenizer = Gem::RequestSet::Lockfile::Tokenizer.from_file lock_file parser = tokenizer.make_parser self, [] @@ -969,7 +969,7 @@ class Gem::Specification < Gem::BasicSpecification def self.dirs @@dirs ||= Gem.path.collect do |dir| - File.join dir.dup, "specifications" end end @@ -1162,7 +1162,6 @@ class Gem::Specification < Gem::BasicSpecification spec = @load_cache_mutex.synchronize { @load_cache[file] } return spec if spec - file = file.dup return unless File.file?(file) code = Gem.open_file(file, "r:UTF-8:-", &:read) |