# File lib/rvm/shell/utility.rb, line 17 def escape_argument(s) return "''" if s.empty? s.scan(/('+|[^']+)/).map do |section| section = section.first if section[0] == ?' "\\'" * section.length else "'#{section}'" end end.join end