From cfc1a2184f19700a6a24f73032ad1235953b1661 Mon Sep 17 00:00:00 2001 From: mo k Date: Sun, 19 Feb 2012 16:02:48 -0700 Subject: remove each command from the queue after it is run. --- lib/command_processor.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/command_processor.rb') 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 -- cgit v1.2.3