Sha256: ca1a1e463a8e97063807727cfde84e86e8e97d25bafe5504ce792a1c26515864
Contents?: true
Size: 572 Bytes
Versions: 17
Compression:
Stored size: 572 Bytes
Contents
require_relative 'hook' module Cloudstrap module Hooks def hooks return [] unless Dir.exist? config.hooks_dir Dir .entries(config.hooks_dir) .reject { |entry| %w(. ..).include? entry } .map { |entry| Hook.new entry, host: jumpbox_ip, key: ssh_key.private_file } end def hook(name) hook = hooks.find { |h| h.name == name } return unless hook hook.call end def hooking(event) return unless block_given? hook "pre-#{event}" yield.tap { hook "post-#{event}" } end end end
Version data entries
17 entries across 17 versions & 1 rubygems