Sha256: 9c18075d24936fa86abb42bd0aac32a06a3194f8a8777cac1b9acd33b595b09d

Contents?: true

Size: 981 Bytes

Versions: 52

Compression:

Stored size: 981 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!
            RubyApp::Application.destroy!
            RubyApp::Log.close!
            RubyApp::Configuration.unload!
          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

52 entries across 52 versions & 1 rubygems

Version Path
RubyApp-0.7.16 lib/ruby_app/rack/application.rb
RubyApp-0.7.15 lib/ruby_app/rack/application.rb
RubyApp-0.7.14 lib/ruby_app/rack/application.rb
RubyApp-0.7.13 lib/ruby_app/rack/application.rb
RubyApp-0.7.12 lib/ruby_app/rack/application.rb
RubyApp-0.7.11 lib/ruby_app/rack/application.rb
RubyApp-0.7.10 lib/ruby_app/rack/application.rb
RubyApp-0.7.9 lib/ruby_app/rack/application.rb
RubyApp-0.7.5 lib/ruby_app/rack/application.rb
RubyApp-0.7.4 lib/ruby_app/rack/application.rb
RubyApp-0.7.3 lib/ruby_app/rack/application.rb
RubyApp-0.7.2 lib/ruby_app/rack/application.rb
RubyApp-0.7.1 lib/ruby_app/rack/application.rb
RubyApp-0.7.0 lib/ruby_app/rack/application.rb
RubyApp-0.6.71 lib/ruby_app/rack/application.rb
RubyApp-0.6.70 lib/ruby_app/rack/application.rb
RubyApp-0.6.69 lib/ruby_app/rack/application.rb
RubyApp-0.6.68 lib/ruby_app/rack/application.rb
RubyApp-0.6.67 lib/ruby_app/rack/application.rb
RubyApp-0.6.66 lib/ruby_app/rack/application.rb