Sha256: 24967e5323ef1152626eb3d26edf0a23314b7cb85735794d5ee745fb5b01989f

Contents?: true

Size: 783 Bytes

Versions: 3

Compression:

Stored size: 783 Bytes

Contents

require 'runner'
require 'engineyard-serverside/spawner'

module ExecutedCommands
  def self.record(cmd)
    executed.push(cmd)

    EY::Serverside::Spawner::Result.new(cmd, true, nil, nil)
  end

  def self.executed
    @executed ||= []
  end

  def self.reset
    @executed = nil
  end

  def self.deploy_hook_executed?(callback_name)
    executed.
      select {|x|
        x.match(%r{engineyard-serverside-execute-hook #{callback_name}})
      }.length > 0
  end

  def self.service_hook_executed?(service_name, callback_name)
    executed.
      select {|x|
        x.match(
          %r{engineyard-serverside-execute-service-hook #{service_name}/#{callback_name}}
        )
      }.length > 0
  end

end

module Runner
  def run(cmd)
    ExecutedCommands.record(cmd)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
engineyard-serverside-3.0.4 features/support/runner.rb
engineyard-serverside-3.0.3 features/support/runner.rb
engineyard-serverside-2.8.0 features/support/runner.rb