diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-06-17 07:42:54 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-06-17 07:42:54 +0000 |
commit | 5744bfc2c6490f1e861c7c206fc698c8e5a7a7f1 (patch) | |
tree | c997ef7098191506dbcc2e8ffe0ffac23c7ab79e /lib/redmine/utils.rb | |
parent | f9ed43ee1543cec6c50fe9a70254a04fe4c4b44a (diff) | |
download | redmine-5744bfc2c6490f1e861c7c206fc698c8e5a7a7f1.tar.gz redmine-5744bfc2c6490f1e861c7c206fc698c8e5a7a7f1.zip |
Removes duplicate shell_quote method (#26149).
Patch by Jens Krämer.
git-svn-id: http://svn.redmine.org/redmine/trunk@16667 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/utils.rb')
-rw-r--r-- | lib/redmine/utils.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/redmine/utils.rb b/lib/redmine/utils.rb index 85d3a4b33..b99849978 100644 --- a/lib/redmine/utils.rb +++ b/lib/redmine/utils.rb @@ -64,6 +64,9 @@ module Redmine end module Shell + + module_function + def shell_quote(str) if Redmine::Platform.mswin? '"' + str.gsub(/"/, '\\"') + '"' @@ -71,6 +74,14 @@ module Redmine "'" + str.gsub(/'/, "'\"'\"'") + "'" end end + + def shell_quote_command(command) + if Redmine::Platform.mswin? && RUBY_PLATFORM == 'java' + command + else + shell_quote(command) + end + end end module DateCalculation |