summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2013-01-08 13:47:54 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2013-01-08 13:47:54 +0100
commit0f9b16f6df09fd835e55bd72898806b27ec93e3f (patch)
tree6ca9686cb788afc8792d2d535063cba0b515a5f4 /lib
parente3c6b822d3fc972bfad1e88ed8461eb928595ae0 (diff)
downloadzorglub-0f9b16f6df09fd835e55bd72898806b27ec93e3f.zip
zorglub-0f9b16f6df09fd835e55bd72898806b27ec93e3f.tar.gz
before_all and after_all accept parameter or proc
Diffstat (limited to 'lib')
-rw-r--r--lib/zorglub/node.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/zorglub/node.rb b/lib/zorglub/node.rb
index 8fe1e4e..253d747 100644
--- a/lib/zorglub/node.rb
+++ b/lib/zorglub/node.rb
@@ -196,8 +196,8 @@ module Zorglub
@cli_vals[:before_all].each do |blk| blk.call obj end
end
#
- def before_all &blk
- @cli_vals[:before_all]<< blk
+ def before_all meth=nil, &blk
+ @cli_vals[:before_all]<< ( meth.nil? ? blk : meth )
@cli_vals[:before_all].uniq!
end
#
@@ -205,8 +205,8 @@ module Zorglub
@cli_vals[:after_all].each do |blk| blk.call obj end
end
#
- def after_all &blk
- @cli_vals[:after_all]<< blk
+ def after_all meth=nil, &blk
+ @cli_vals[:after_all]<< ( meth.nil? ? blk : meth )
@cli_vals[:after_all].uniq!
end
#