| Class | Nautilus::Shell |
| In: |
lib/nautilus/shell.rb
|
| Parent: | Object |
# File lib/nautilus/shell.rb, line 9
9: def build_command(command, options = {})
10: actual_command = command.kind_of?(Array) ? command.join(" ") : command
11: if options[:background]
12: if windows?
13: actual_command = "start /wait /b " + command
14: elsif options[:background]
15: actual_command << " &"
16: end
17: end
18: actual_command
19: end
# File lib/nautilus/shell.rb, line 5 5: def run(command, options = {}) 6: sh build_command(command, options) 7: end
# File lib/nautilus/shell.rb, line 25
25: def sh(command)
26: successful = system(command)
27: raise "Error while running >>#{command}<<" unless successful
28: end