Class: LSL::CommandExecution::Compound

Inherits:
Base show all
Defined in:
lib/lsl/command/execution.rb

Instance Attribute Summary

Attributes inherited from Base

#command_str, #shell

Instance Method Summary collapse

Instance Method Details

#print!Object



110
111
112
# File 'lib/lsl/command/execution.rb', line 110

def print!
  puts result_str if result
end

#resultObject



113
114
115
# File 'lib/lsl/command/execution.rb', line 113

def result
  command_executions.last.result
end

#result_strObject



116
117
118
119
120
# File 'lib/lsl/command/execution.rb', line 116

def result_str
  res = result
  res = res.join("\n") if res.respond_to?(:join)
  res
end

#run!Object



97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/lsl/command/execution.rb', line 97

def run!
  if !command
    #puts "|#{command_str}|"
    puts "can't parsex"
    return
  end
  command_executions
  if command.output_filename
    ::File.create(command.output_filename,result.join("\n"))
  else
    #puts result_str if result
  end
end