Class: Dployr::Scripts::Default_Hooks
- Inherits:
-
Object
- Object
- Dployr::Scripts::Default_Hooks
- Defined in:
- lib/dployr/scripts/default_hooks.rb
Instance Method Summary collapse
-
#initialize(ip, config, stage, command) ⇒ Default_Hooks
constructor
A new instance of Default_Hooks.
Constructor Details
#initialize(ip, config, stage, command) ⇒ Default_Hooks
Returns a new instance of Default_Hooks.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/dployr/scripts/default_hooks.rb', line 5 def initialize(ip, config, stage, command) @config = config @ip = ip @stage = stage if @config[:scripts].is_a?(Hash) and @config[:scripts]["pre-#{@stage}"] Dployr::Scripts::Hook.new @ip, config, "pre-#{@stage}" end @ip = command.action() if @config[:scripts].is_a?(Hash) and @config[:scripts][@stage] Dployr::Scripts::Hook.new @ip, config, "#{@stage}" end if @config[:scripts].is_a?(Hash) and @config[:scripts]["post-#{@stage}"] Dployr::Scripts::Hook.new @ip, config, "post-#{@stage}" end end |