Module: Redmine::Utils::Shell

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

Instance Method Summary collapse

Instance Method Details

#shell_quote(str) ⇒ Object


46
47
48
49
50
51
52
# File 'lib/redmine/utils.rb', line 46

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