10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/base/array.rb', line 10
def execute value=nil
@env=Environment.new() if @env.nil?
i=0
while i < self.length
self[i]=Command.new({ :input => self[i], :quiet => true }) if(self[i].is_a?(String))
self[i]=Command.new(self[i]) if(self[i].is_a?(Hash) && !self[i].is_a?(Command))
if(!value.nil? && value.is_a?(Hash))
value.each{|k,v|self[i][k]=v}
end
if(self[i].is_a?(Command))
self[i].execute
@env.out self[i].summary
end
i=i+1
end
end
|