Sha256: 56ddd91d70b9a3e69d4c476ae8bfc6fdae9d4985c5d5d25e8afa4898f4a3dd2f
Contents?: true
Size: 625 Bytes
Versions: 25
Compression:
Stored size: 625 Bytes
Contents
module Terraspace::Hooks class Runner include Terraspace::Util def initialize(mod, hook) @mod, @hook = mod, hook @execute = @hook["execute"] end def run case @execute when String Terraspace::Shell.new(@mod, @execute, exit_on_fail: @hook["exit_on_fail"]).run when -> (e) { e.respond_to?(:public_instance_methods) && e.public_instance_methods.include?(:call) } @execute.new.call when -> (e) { e.respond_to?(:call) } @execute.call else logger.warn "WARN: execute option not set for hook: #{@hook.inspect}" end end end end
Version data entries
25 entries across 25 versions & 1 rubygems