Class Nautilus::Shell
In: lib/nautilus/shell.rb
Parent: Object

Methods

build_command   run   sh   windows?  

Public Instance methods

[Source]

    # 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

[Source]

   # File lib/nautilus/shell.rb, line 5
5:     def run(command, options = {})
6:       sh build_command(command, options)
7:     end

[Source]

    # 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

[Source]

    # File lib/nautilus/shell.rb, line 21
21:     def windows?
22:       RUBY_PLATFORM =~ /mswin/
23:     end

[Validate]