# File lib/god/watch.rb, line 157 def call_action(condition, action, command) # before before_items = self.behaviors before_items += [condition] if condition before_items.each { |b| b.send("before_#{action}") } # action if command.kind_of?(String) # string command system(command) else # lambda command command.call end # after after_items = self.behaviors after_items += [condition] if condition after_items.each { |b| b.send("after_#{action}") } end