Class: Wordmove::Hook
- Inherits:
-
Object
- Object
- Wordmove::Hook
- Defined in:
- lib/wordmove/hook.rb
Defined Under Namespace
Classes: Config, Local, Remote
Class Method Summary collapse
Class Method Details
.logger ⇒ Object
3 4 5 |
# File 'lib/wordmove/hook.rb', line 3 def self.logger Logger.new(STDOUT).tap { |l| l.level = Logger::DEBUG } end |
.run(action, step, cli_options) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/wordmove/hook.rb', line 7 def self.run(action, step, ) movefile = Wordmove::Movefile.new([:config]) = movefile.fetch(false) environment = movefile.environment() hooks = Wordmove::Hook::Config.new( [environment][:hooks], action, step ) unless hooks.local_hooks.empty? Wordmove::Hook::Local.run(hooks.local_hooks, [:simulate]) end return if hooks.remote_hooks.empty? if [environment][:ftp] logger.debug "You have configured remote hooks to run over "\ "an FTP connections, but this is not possible. Skipping." return end Wordmove::Hook::Remote.run( hooks.remote_hooks, [environment], [:simulate] ) end |