Sha256: 211842f5c54197d6025a079052cebb9da7f48264c79d98a496628a187b03671f

Contents?: true

Size: 465 Bytes

Versions: 110

Compression:

Stored size: 465 Bytes

Contents

class FakePassenger
  def initialize
    @handlers = {}
  end

  def on_event(name, &handler)
    @handlers[name] ||= []
    @handlers[name] << handler
  end

  def call_event(name, *args)
    if @handlers[name]
      @handlers[name].each do |handler|
        handler.call(*args)
      end
    end
  end

  def become_master
    $0 = "PassengerApplicationSpawner"
  end

  def spawn
    $0 = "PassengerFork"
    call_event(:starting_worker_process, true)
  end
end

Version data entries

110 entries across 110 versions & 2 rubygems

Version Path
copy_tuner_client-0.19.0 spec/support/fake_passenger.rb
copy_tuner_client-0.18.0 spec/support/fake_passenger.rb
copy_tuner_client-0.17.1 spec/support/fake_passenger.rb
copy_tuner_client-0.16.3 spec/support/fake_passenger.rb
copy_tuner_client-0.16.2 spec/support/fake_passenger.rb
copy_tuner_client-0.16.1 spec/support/fake_passenger.rb
copy_tuner_client-0.16.0 spec/support/fake_passenger.rb
copy_tuner_client-0.15.1 spec/support/fake_passenger.rb
copy_tuner_client-0.15.0 spec/support/fake_passenger.rb
copy_tuner_client-0.14.2 spec/support/fake_passenger.rb
copy_tuner_client-0.14.1 spec/support/fake_passenger.rb
copy_tuner_client-0.14.0 spec/support/fake_passenger.rb
copy_tuner_client-0.13.6 spec/support/fake_passenger.rb
copy_tuner_client-0.13.5 spec/support/fake_passenger.rb
copy_tuner_client-0.13.3 spec/support/fake_passenger.rb
copy_tuner_client-0.13.2 spec/support/fake_passenger.rb
copy_tuner_client-0.13.1 spec/support/fake_passenger.rb
copy_tuner_client-0.13.0 spec/support/fake_passenger.rb
copy_tuner_client-0.12.0 spec/support/fake_passenger.rb
copy_tuner_client-0.11.0 spec/support/fake_passenger.rb