Sha256: 3e0ab63e235900100c3c54e8ad0d15c3aca12c044a37d49be531b56920753228

Contents?: true

Size: 401 Bytes

Versions: 14

Compression:

Stored size: 401 Bytes

Contents

module Ufo::Hooks
  module Dsl
    def before(*commands, **props)
      commands.each do |name|
        each_hook(:before, name, props)
      end
    end

    def after(*commands, **props)
      commands.each do |name|
        each_hook(:after, name, props)
      end
    end

    def each_hook(type, name, props={})
      @hooks[type][name] ||= []
      @hooks[type][name] << props
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ufo-6.3.13 lib/ufo/hooks/dsl.rb
ufo-6.3.12 lib/ufo/hooks/dsl.rb
ufo-6.3.11 lib/ufo/hooks/dsl.rb
ufo-6.3.10 lib/ufo/hooks/dsl.rb
ufo-6.3.9 lib/ufo/hooks/dsl.rb
ufo-6.3.8 lib/ufo/hooks/dsl.rb
ufo-6.3.7 lib/ufo/hooks/dsl.rb
ufo-6.3.6 lib/ufo/hooks/dsl.rb
ufo-6.3.5 lib/ufo/hooks/dsl.rb
ufo-6.3.4 lib/ufo/hooks/dsl.rb
ufo-6.3.3 lib/ufo/hooks/dsl.rb
ufo-6.3.2 lib/ufo/hooks/dsl.rb
ufo-6.3.1 lib/ufo/hooks/dsl.rb
ufo-6.3.0 lib/ufo/hooks/dsl.rb