From 70cb33c214ced1235b8e6077e11177a3ba6b7977 Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Sat, 27 Apr 2013 12:16:55 +0300 Subject: Fix timeout on receiving command from input --- lib/oxidized/model/model.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/oxidized/model') diff --git a/lib/oxidized/model/model.rb b/lib/oxidized/model/model.rb index fb27143..8f7b14f 100644 --- a/lib/oxidized/model/model.rb +++ b/lib/oxidized/model/model.rb @@ -40,6 +40,7 @@ module Oxidized def cmd string, &block out = @input.cmd string + return false unless out self.class.cmds[:all].each do |all_block| out = instance_exec out, &all_block end @@ -58,7 +59,9 @@ module Oxidized def get data = '' self.class.cmds[:cmd].each do |command, block| - data << (cmd command, &block).to_s + out = cmd command, &block + return false unless out + data << out.to_s end data << main.to_s if respond_to? :main data -- cgit v1.2.1