summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/model.rb
diff options
context:
space:
mode:
authorFlorian Hibler <fhibler@users.noreply.github.com>2015-02-26 16:47:18 +0000
committerFlorian Hibler <fhibler@users.noreply.github.com>2015-02-26 16:47:18 +0000
commit1c85b3202033ed965abe16e15688f0b0025561ea (patch)
tree4ea9288b7a3dc774a60cdbd096761df4da147f8e /lib/oxidized/model/model.rb
parent19de2ac51cd765e1c7b7fe731759fb50086675b5 (diff)
parentdb165b5e1ebb3091a49029d739b68a913bc75db6 (diff)
Merge pull request #1 from ytti/master
Merge to latest
Diffstat (limited to 'lib/oxidized/model/model.rb')
-rw-r--r--lib/oxidized/model/model.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/oxidized/model/model.rb b/lib/oxidized/model/model.rb
index d3f54b9..899b40a 100644
--- a/lib/oxidized/model/model.rb
+++ b/lib/oxidized/model/model.rb
@@ -133,10 +133,10 @@ module Oxidized
outputs << out
end
procs[:pre].each do |pre_proc|
- outputs.unshift Oxidized::String.new(instance_eval(&pre_proc))
+ outputs.unshift process_cmd_output(instance_eval(&pre_proc), '')
end
procs[:post].each do |post_proc|
- outputs << Oxidized::String.new(instance_eval(&post_proc))
+ outputs << process_cmd_output(instance_eval(&post_proc), '')
end
outputs
end
@@ -152,9 +152,8 @@ module Oxidized
private
def process_cmd_output output, name
- if output.class != Oxidized::String
- output = Oxidized::String.new output
- end
+ output = Oxidized::String.new output if ::String === output
+ output = Oxidized::String.new '' unless Oxidized::String === output
output.set_cmd(name)
output
end