lib/command-builder.rb
##
# Executes the command. If block given, takes it output of the
# command and runs it asynchronously using EventMachine.
#
# @see https://github.com/martinkozak/pipe-run
# @param [Proc] block if asynchronous run
# @return [String] output of the command or nil if asynchronous
#

Executes the command. If block given, takes it output of the
command and runs it asynchronously using EventMachine.
Executes the command . If block given takes it output of the command and runs it asynchronously using EventMachine .
def execute(&block)
        callback = nil
        if not block.nil?
            callback = Proc::new do |out|
                block.call(out, out.strip.empty?)
            end
        end
        Pipe::run(self.to_s, &callback)
    end
def execute ( & block ) callback = nil if not block . nil? callback = Proc :: new do | out | block . call ( out , out . strip . empty? ) end end Pipe :: run ( self . to_s , & callback ) end
Executes the command.
Executes the command .
output of the command or nil if asynchronous
output of the command or nil if asynchronous
String
block
<not_specific>
<not_specific>
block if asynchronous run
block if asynchronous run
see
None