Sha256: 612a0fe2a756cb1ba86fe2fb9f6209b2270b32d64b2b7e67a586e99a4a0859d6

Contents?: true

Size: 924 Bytes

Versions: 13

Compression:

Stored size: 924 Bytes

Contents

module Hyperloop
  # Tricky business here. Hyperloop::Store will define boot
  # if it is not already defined.  It creates a minimal compatible
  # API that includes the run and on_dispatch methods.  This way
  # you can use the Boot interface without loading operations.

  # Here we define Boot, but in case it has already been defined
  # we make sure to run the inherited method, and define the
  # on_dispatch and run methods.   Finally we copy any receivers
  # that may have been defined on the existing Boot to the new class.
  class Application
    Operation.inherited(Boot) if defined? Boot
    class Boot < Operation
      def self.on_dispatch(&block)
        _Railway.add_receiver(&block)
      end
      def self.run(*args)
        ClientDrivers.initialize_client_drivers_on_boot
        _run(*args)
      end
    end
    Boot.receivers.each { |r| Boot.on_dispatch &r } if Boot.respond_to? :receivers
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
hyper-operation-0.5.12 lib/hyper-operation/boot.rb
hyper-operation-0.5.11 lib/hyper-operation/boot.rb
hyper-operation-0.5.10 lib/hyper-operation/boot.rb
hyper-operation-0.5.9 lib/hyper-operation/boot.rb
hyper-operation-0.5.8 lib/hyper-operation/boot.rb
hyper-operation-0.5.7 lib/hyper-operation/boot.rb
hyper-operation-0.5.6 lib/hyper-operation/boot.rb
hyper-operation-0.5.5 lib/hyper-operation/boot.rb
hyper-operation-0.5.4 lib/hyper-operation/boot.rb
hyper-operation-0.5.3 lib/hyper-operation/boot.rb
hyper-operation-0.5.2 lib/hyper-operation/boot.rb
hyper-operation-0.5.1 lib/hyper-operation/boot.rb
hyper-operation-0.5.0 lib/hyper-operation/boot.rb