Sha256: 822226a5b4e0a8624fb1295a56bf16fe8169eee4821ac0776aeb7c990d1fe618

Contents?: true

Size: 249 Bytes

Versions: 4

Compression:

Stored size: 249 Bytes

Contents

module Trestle
  module HookHelper
    def hook(name)
      safe_join(Trestle.config.hooks[name.to_s].map { |hook|
        instance_exec(&hook)
      }, "\n")
    end

    def hook?(name)
      Trestle.config.hooks[name.to_s].any?
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
trestle-0.8.4 app/helpers/trestle/hook_helper.rb
trestle-0.8.3 app/helpers/trestle/hook_helper.rb
trestle-0.8.2 app/helpers/trestle/hook_helper.rb
trestle-0.8.0 app/helpers/trestle/hook_helper.rb