Sha256: 93972c76304e51c4ddb8a6abd93ffa60ac2a3e1e8264cbca2b58561e2bd368f0

Contents?: true

Size: 780 Bytes

Versions: 9

Compression:

Stored size: 780 Bytes

Contents

module JettyRails
  module Adapters
    
    class MerbAdapter < AbstractAdapter
      
      def init_params
        # please refer to goldspike and jruby-rack documentation
        @merb_params ||= {
          'merb.root' => '/',
          'merb.environment' => config[:environment]
        }.merge(base_init_params)
      end
      
      def event_listeners
        [ Rack::MerbServletContextListener.new, SignalHandler.new ]
      end
      
      class SignalHandler
        include Java::JavaxServlet::ServletContextListener
        
        def contextInitialized(cfg)
          trap("INT") do
            puts "\nbye!"
            java.lang.System.exit(0)
          end
        end
        
        def contextDestroyed(cfg)
        end
      end
      
    end
  end
end

Version data entries

9 entries across 9 versions & 3 rubygems

Version Path
mikewadhera-jetty-rails-0.9.1 lib/jetty_rails/adapters/merb_adapter.rb
mikewadhera-jetty-rails-0.9.2 lib/jetty_rails/adapters/merb_adapter.rb
mikewadhera-jetty-rails-0.9.3 lib/jetty_rails/adapters/merb_adapter.rb
mikewadhera-jetty-rails-0.9 lib/jetty_rails/adapters/merb_adapter.rb
nolman-jetty-rails-0.9.6-jruby lib/jetty_rails/adapters/merb_adapter.rb
jetty-rails-0.8.1 lib/jetty_rails/adapters/merb_adapter.rb
jetty-rails-0.6 lib/jetty_rails/adapters/merb_adapter.rb
jetty-rails-0.8 lib/jetty_rails/adapters/merb_adapter.rb
jetty-rails-0.7 lib/jetty_rails/adapters/merb_adapter.rb