Sha256: d7e9105e265f1e78c170debfcf91462d7e04ab06f05c5c8d03366f7c4750e301

Contents?: true

Size: 408 Bytes

Versions: 89

Compression:

Stored size: 408 Bytes

Contents

module Terraspace::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

89 entries across 89 versions & 1 rubygems

Version Path
terraspace-2.2.17 lib/terraspace/hooks/dsl.rb
terraspace-2.2.16 lib/terraspace/hooks/dsl.rb
terraspace-2.2.15 lib/terraspace/hooks/dsl.rb
terraspace-2.2.14 lib/terraspace/hooks/dsl.rb
terraspace-2.2.13 lib/terraspace/hooks/dsl.rb
terraspace-2.2.12 lib/terraspace/hooks/dsl.rb
terraspace-2.2.11 lib/terraspace/hooks/dsl.rb
terraspace-2.2.10 lib/terraspace/hooks/dsl.rb
terraspace-2.2.9 lib/terraspace/hooks/dsl.rb
terraspace-2.2.8 lib/terraspace/hooks/dsl.rb
terraspace-2.2.7 lib/terraspace/hooks/dsl.rb
terraspace-2.2.6 lib/terraspace/hooks/dsl.rb
terraspace-2.2.5 lib/terraspace/hooks/dsl.rb
terraspace-2.2.4 lib/terraspace/hooks/dsl.rb
terraspace-2.2.3 lib/terraspace/hooks/dsl.rb
terraspace-2.2.2 lib/terraspace/hooks/dsl.rb
terraspace-2.2.1 lib/terraspace/hooks/dsl.rb
terraspace-2.2.0 lib/terraspace/hooks/dsl.rb
terraspace-2.1.7 lib/terraspace/hooks/dsl.rb
terraspace-2.1.6 lib/terraspace/hooks/dsl.rb