summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/model.rb
diff options
context:
space:
mode:
authorSaku Ytti <saku@ytti.fi>2014-08-13 15:12:09 +0300
committerSaku Ytti <saku@ytti.fi>2014-08-13 15:12:09 +0300
commita0115f27c17317cb9d2a2e4012cdbbb88b987063 (patch)
treeab0d310b914dcf524d421732b329002e6c42aa8e /lib/oxidized/model/model.rb
parentef1735ffdadb10371036989b10756d341b64d292 (diff)
fix pre/post blocks
Diffstat (limited to 'lib/oxidized/model/model.rb')
-rw-r--r--lib/oxidized/model/model.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/oxidized/model/model.rb b/lib/oxidized/model/model.rb
index 7258912..d3f54b9 100644
--- a/lib/oxidized/model/model.rb
+++ b/lib/oxidized/model/model.rb
@@ -127,16 +127,16 @@ module Oxidized
def get
outputs = Outputs.new
procs = self.class.procs
- procs[:pre].each do |pre_proc|
- outputs << instance_eval(&pre_proc)
- end
self.class.cmds[:cmd].each do |command, block|
out = cmd command, &block
return false unless out
outputs << out
end
+ procs[:pre].each do |pre_proc|
+ outputs.unshift Oxidized::String.new(instance_eval(&pre_proc))
+ end
procs[:post].each do |post_proc|
- outputs << instance_eval(&post_proc)
+ outputs << Oxidized::String.new(instance_eval(&post_proc))
end
outputs
end