Class: Dragonfly::Shell
Defined Under Namespace
Classes: CommandFailed
Instance Method Summary collapse
Instance Method Details
#escape_args(args) ⇒ Object
17 18 19 20 21 |
# File 'lib/dragonfly/shell.rb', line 17 def escape_args(args) args.shellsplit.map do |arg| quote arg.gsub(/\\?'/, %q('\\\\'')) end.join(' ') end |
#quote(string) ⇒ Object
23 24 25 26 |
# File 'lib/dragonfly/shell.rb', line 23 def quote(string) q = Dragonfly.running_on_windows? ? '"' : "'" q + string + q end |