From 64f1b7e45906857841b7cdfbeb3d4afb97429eb0 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Wed, 15 Sep 2010 16:48:21 +0200 Subject: [PATCH] Stopped using Array#index as it is not compatible with ruby 1.8.5 --- src/mad/ruby/VirtualMachineDriver.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/mad/ruby/VirtualMachineDriver.rb b/src/mad/ruby/VirtualMachineDriver.rb index ec42758be4..5a5c1be48d 100644 --- a/src/mad/ruby/VirtualMachineDriver.rb +++ b/src/mad/ruby/VirtualMachineDriver.rb @@ -168,11 +168,16 @@ private end def get_first_runable - action_index=@action_queue.index do |action| - if action[:args][HOST_ARG] - !@hosts.include? action[:args][HOST_ARG] + action_index=nil + @action_queue.each_with_index do |action, index| + if action[:args][HOST_ARG] + if !@hosts.include?(action[:args][HOST_ARG]) + action_index=index + break + end else - true + action_index=index + break end end