Skip to content

Commit

Permalink
Fixed merge.
Browse files Browse the repository at this point in the history
  • Loading branch information
David Balatero committed Jun 10, 2009
2 parents 6a68fb4 + f8b46a6 commit 8194682
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions lib/sinatra/base.rb
Expand Up @@ -353,7 +353,6 @@ class Base

def initialize(app=nil)
@app = app
@running = false
yield self if block_given?
end

Expand Down Expand Up @@ -873,15 +872,6 @@ def use(middleware, *args, &block)
@middleware << [middleware, args, block]
end

# Allow someone to externally query Sinatra to see if it
# is up and running yet (trap(:INT) has been set, etc).
#
# This is useful for Sinatra apps embedded inside of another
# program.
def running?
@running
end

# Run the Sinatra app as a self-hosted server using
# Thin, Mongrel or WEBrick (in that order)
def run!(options={})
Expand All @@ -896,10 +886,8 @@ def run!(options={})
server.respond_to?(:stop!) ? server.stop! : server.stop
puts "\n== Sinatra has ended his set (crowd applauds)" unless handler_name =~/cgi/i
end

@running = true
end

set :running, true
rescue Errno::EADDRINUSE => e
puts "== Someone is already performing on port #{port}!"
end
Expand Down Expand Up @@ -997,7 +985,8 @@ def caller_locations
set :static, false
set :environment, (ENV['RACK_ENV'] || :development).to_sym

set :run, false
set :run, false # start server via at-exit hook?
set :running, false # is the built-in server running now?
set :server, %w[thin mongrel webrick]
set :host, '0.0.0.0'
set :port, 4567
Expand Down Expand Up @@ -1086,8 +1075,8 @@ def #{method_name}(*args, &b)
end

delegate :get, :put, :post, :delete, :head, :template, :layout, :before,
:error, :not_found, :configures, :configure, :set, :set_option,
:set_options, :enable, :disable, :use, :development?, :test?,
:error, :not_found, :configure, :set,
:enable, :disable, :use, :development?, :test?,
:production?, :use_in_file_templates!, :helpers
end

Expand Down

0 comments on commit 8194682

Please sign in to comment.