Sha256: bdc45b8f34c67554cfa1d3f9160b562380aa2a6a3e0a180dc20fd48453135a15

Contents?: true

Size: 864 Bytes

Versions: 1

Compression:

Stored size: 864 Bytes

Contents

module RubyApp

  module Rack
    require 'ruby_app'

    class Application

      def initialize(application, options = {})
        @application = application
        RubyApp::Configuration.load!(options[:configuration_paths])
        RubyApp::Log.open!
        RubyApp::Application.create!
        RubyApp::Session.start_thread!

        Signal.trap('HUP') do
          begin
            RubyApp::Log.reopen!
          rescue => exception
            RubyApp::Log.exception(RubyApp::Log::ERROR, exception)
          end
        end

        Signal.trap('EXIT') do
          begin
            RubyApp::Session.stop_thread!
          rescue => exception
            RubyApp::Log.exception(RubyApp::Log::ERROR, exception)
          end
        end

      end

      def call(environment)
        return @application.call(environment)
      end

    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
RubyApp-0.6.28 lib/ruby_app/rack/application.rb