Module: Redmine::Utils::Shell

Included in:
Thumbnail
Defined in:
lib/redmine/utils.rb

Overview

Since:

  • 2.1.0

Instance Method Summary collapse

Instance Method Details

#shell_quote(str) ⇒ Object



67
68
69
70
71
72
73
# File 'lib/redmine/utils.rb', line 67

def shell_quote(str)
  if Redmine::Platform.mswin?
    '"' + str.gsub(/"/, '\\"') + '"'
  else
    "'" + str.gsub(/'/, "'\"'\"'") + "'"
  end
end