Method: Sinatra#run

Defined in:
lib/codebutler/sinatra.rb

#runObject



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/codebutler/sinatra.rb', line 122

def run
  
  begin
    puts "== Sinatra has taken the stage on port #{port} for #{env}"
    require 'pp'
    Rack::Handler::Mongrel.run(build_application, :Port => port) do |server|
      trap(:INT) do
        server.stop
        puts "\n== Sinatra has ended his set (crowd applauds)"
      end
    end
  rescue Errno::EADDRINUSE => e
    puts "== Someone is already performing on port #{port}!"
  end
  
end