summaryrefslogtreecommitdiff
path: root/test/rubygems
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2023-04-05 11:05:05 +0900
committergit <svn-admin@ruby-lang.org>2023-04-05 05:49:26 +0000
commit8e37eb1d150a2a0c7fd6c274c8f4ac1c24940849 (patch)
treec2831216084745e0ad078dcfb5e257de9777c2c9 /test/rubygems
parent7f9a5a7562e25ee18d167d72a62826ee5ae1e726 (diff)
downloadruby-8e37eb1d150a2a0c7fd6c274c8f4ac1c24940849.tar.gz
[rubygems/rubygems] Extract class method used by self.method
https://github.com/rubygems/rubygems/commit/d900453ca2
Diffstat (limited to 'test/rubygems')
-rw-r--r--test/rubygems/helper.rb24
1 files changed, 10 insertions, 14 deletions
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