Sha256: b42187db5c47ae08ced8fc8278320bef99c825c6c2ca2b1111df8c0054313b18

Contents?: true

Size: 972 Bytes

Versions: 18

Compression:

Stored size: 972 Bytes

Contents

module Sinatra
  class Base
    class << self
      def run!(options={})
        set options
        handler      = detect_rack_handler
        handler_name = handler.name.gsub(/.*::/, '')
        # handler specific options use the lower case handler name as hash key, if present
        handler_opts = begin
                         send(handler_name.downcase)
                       rescue NoMethodError
                         {}
                       end
        puts "== Sinatra/#{Sinatra::VERSION} has taken the stage " +
          "on #{port} for #{environment} with backup from #{handler_name}" unless handler_name =~/cgi/i
        handler.run self, handler_opts.merge(:Host => bind, :Port => port) do |server|
          [:INT, :TERM].each { |sig| trap(sig) { quit!(server, handler_name) } }
          set :running, true
        end
      rescue Errno::EADDRINUSE => e
        puts "== Someone is already performing on port #{port}!"
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
rest-assured-1.1.10 lib/sinatra/handler_options_patch.rb
rest-assured-1.1.9 lib/sinatra/handler_options_patch.rb
rest-assured-1.1.8 lib/sinatra/handler_options_patch.rb
rest-assured-1.1.7 lib/sinatra/handler_options_patch.rb
rest-assured-1.1.6 lib/sinatra/handler_options_patch.rb
rest-assured-1.1.5 lib/sinatra/handler_options_patch.rb
rest-assured-1.1.4 lib/sinatra/handler_options_patch.rb
rest-assured-1.1.3 lib/sinatra/handler_options_patch.rb
rest-assured-1.1.2 lib/sinatra/handler_options_patch.rb
rest-assured-1.1.1 lib/sinatra/handler_options_patch.rb
rest-assured-1.1.0 lib/sinatra/handler_options_patch.rb
rest-assured-1.0.0 lib/sinatra/handler_options_patch.rb
rest-assured-1.0.0.rc2 lib/sinatra/handler_options_patch.rb
rest-assured-1.0.0.rc1 lib/sinatra/handler_options_patch.rb
rest-assured-0.3.2 lib/sinatra/handler_options_patch.rb
rest-assured-0.3.1 lib/sinatra/handler_options_patch.rb
rest-assured-0.3.0 lib/sinatra/handler_options_patch.rb
rest-assured-0.2.0 lib/sinatra/handler_options_patch.rb