Sha256: 3ecde8c2d7b2a6f2e9b096e6102e9134516d0f7c548f24f9c7f5af28689fbce5
Contents?: true
Size: 875 Bytes
Versions: 25
Compression:
Stored size: 875 Bytes
Contents
module Stove class Plugin::Base include Logify extend Mixin::Optionable extend Mixin::Validatable class << self def run(description, &block) actions << Proc.new do |instance| log.info { description } instance.instance_eval(&block) end end def actions @actions ||= [] end end option :id option :description attr_reader :cookbook attr_reader :options def initialize(cookbook, options = {}) @cookbook, @options = cookbook, options end def run run_validations run_actions end def run_validations self.class.validations.each do |id, validation| validation.run(cookbook, options) end end def run_actions self.class.actions.each do |action| action.call(self) end end end end
Version data entries
25 entries across 25 versions & 3 rubygems