From 8e37eb1d150a2a0c7fd6c274c8f4ac1c24940849 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 5 Apr 2023 11:05:05 +0900 Subject: [rubygems/rubygems] Extract class method used by self.method https://github.com/rubygems/rubygems/commit/d900453ca2 --- test/rubygems/helper.rb | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'test/rubygems') diff --git a/test/rubygems/helper.rb b/test/rubygems/helper.rb index 7a0853eae6..3c4afca5cd 100644 --- a/test/rubygems/helper.rb +++ b/test/rubygems/helper.rb @@ -1269,21 +1269,17 @@ Also, a list: $VERBOSE = old_verbose end - class << self - # :nodoc: - ## - # Return the join path, with escaping backticks, dollars, and - # double-quotes. Unlike `shellescape`, equal-sign is not escaped. - - private + # :nodoc: + ## + # Return the join path, with escaping backticks, dollars, and + # double-quotes. Unlike `shellescape`, equal-sign is not escaped. - def escape_path(*path) - path = File.join(*path) - if %r{\A[-+:/=@,.\w]+\z}.match?(path) - path - else - "\"#{path.gsub(/[`$"]/, '\\&')}\"" - end + def self.escape_path(*path) + path = File.join(*path) + if %r{\A[-+:/=@,.\w]+\z}.match?(path) + path + else + "\"#{path.gsub(/[`$"]/, '\\&')}\"" end end -- cgit v1.2.1