summaryrefslogtreecommitdiff
path: root/lib/command_processor.rb
diff options
context:
space:
mode:
authormo k <mo@mokhan.ca>2012-02-19 16:02:48 -0700
committermo k <mo@mokhan.ca>2012-02-19 16:02:48 -0700
commitcfc1a2184f19700a6a24f73032ad1235953b1661 (patch)
tree9754f5614c96815303ac7876e2b71fde640cd220 /lib/command_processor.rb
parent272c52e0402378d209e96af29a6edce963d8868c (diff)
remove each command from the queue after it is run.
Diffstat (limited to 'lib/command_processor.rb')
-rw-r--r--lib/command_processor.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/command_processor.rb b/lib/command_processor.rb
index 7e9de08..738b9b1 100644
--- a/lib/command_processor.rb
+++ b/lib/command_processor.rb
@@ -6,6 +6,8 @@ class CommandProcessor
@commands << command
end
def run
- @commands.each { |e| e.run }
+ while @commands.length > 0 do
+ @commands.shift.run
+ end
end
end