Class: String
Instance Method Summary collapse
- #to_io_for_ocmd ⇒ Object
-
#to_ocmd ⇒ Object
Make a command from a String.
- #to_ocmd_args ⇒ Object
- #to_sh ⇒ Object
Instance Method Details
#to_io_for_ocmd ⇒ Object
36 37 38 39 40 |
# File 'lib/objective_command/helpers.rb', line 36 def to_io_for_ocmd tmp = TempPath.new tmp.open('w') { |f| f.write self } tmp.to_io_for_ocmd end |
#to_ocmd ⇒ Object
Make a command from a String.
Split your command using the Shellwords module.
32 33 34 |
# File 'lib/objective_command/helpers.rb', line 32 def to_ocmd Shellwords.shellwords(self).to_ocmd end |
#to_ocmd_args ⇒ Object
42 43 44 |
# File 'lib/objective_command/helpers.rb', line 42 def to_ocmd_args Shellwords.shellwords(self) end |
#to_sh ⇒ Object
46 47 48 |
# File 'lib/objective_command/helpers.rb', line 46 def to_sh (self =~ /[^-\w:_\/\.@]/)? dump : self end |