diff options
Diffstat (limited to 'test/rubygems/helper.rb')
-rw-r--r-- | test/rubygems/helper.rb | 24 |
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 |