Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/ass_launcher/support/shell.rb

Overview

Monkey patch for [String]

Instance Method Summary collapse

Instance Method Details

#escapeObject



15
16
17
# File 'lib/ass_launcher/support/shell.rb', line 15

def escape
  Shellwords.escape self
end

#to_cmdObject



6
7
8
9
10
11
12
13
# File 'lib/ass_launcher/support/shell.rb', line 6

def to_cmd
  if AssLauncher::Support::Platforms.windows?\
      || AssLauncher::Support::Platforms.cygwin?
    "\"#{self}\""
  else
    escape
  end
end