Module: Redmine::Utils::Shell

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

Overview

Since:

  • 2.1.0

Class Method Summary collapse

Class Method Details

.shell_quote(str) ⇒ Object

Since:

  • 3.4.0



70
71
72
73
74
75
76
# File 'lib/redmine/utils.rb', line 70

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

.shell_quote_command(command) ⇒ Object

Since:

  • 3.4.0



78
79
80
81
82
83
84
# File 'lib/redmine/utils.rb', line 78

def shell_quote_command(command)
  if Redmine::Platform.mswin? && RUBY_PLATFORM == 'java'
    command
  else
    shell_quote(command)
  end
end