Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/rexec/to_cmd.rb
Instance Method Summary collapse
-
#to_cmd ⇒ Object
Conditionally quote a string if it contains whitespace or quotes.
Instance Method Details
#to_cmd ⇒ Object
Conditionally quote a string if it contains whitespace or quotes.
23 24 25 26 27 28 29 |
# File 'lib/rexec/to_cmd.rb', line 23 def to_cmd if match(/\s|"|'/) self.dump else self end end |