Skip to content

Commit

Permalink
* bin/camping: show running status (#66, score another for zimbatm.)
Browse files Browse the repository at this point in the history
  • Loading branch information
_why committed Jul 6, 2006
1 parent 8771109 commit e16c430
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions bin/camping
Original file line number Diff line number Diff line change
Expand Up @@ -162,23 +162,29 @@ when :mongrel
end
end
end
config = Mongrel::Configurator.new :host => host do
listener :port => port do
if apps.length > 1
apps.each do |app|
uri "/#{app.mount}", :handler => Mongrel::Camping::CampingHandler.new(app)
uri "/code/#{app.mount}", :handler => ViewSource.new(app)
begin
config = Mongrel::Configurator.new :host => host do
listener :port => port do
if apps.length > 1
apps.each do |app|
uri "/#{app.mount}", :handler => Mongrel::Camping::CampingHandler.new(app)
uri "/code/#{app.mount}", :handler => ViewSource.new(app)
end
uri "/", :handler => IndexHandler.new(apps)
else
uri "/", :handler => Mongrel::Camping::CampingHandler.new(apps.first)
end
uri "/", :handler => IndexHandler.new(apps)
else
uri "/", :handler => Mongrel::Camping::CampingHandler.new(apps.first)
uri "/favicon.ico", :handler => Mongrel::Error404Handler.new("")
trap("INT") { stop }
run
end
uri "/favicon.ico", :handler => Mongrel::Error404Handler.new("")
trap("INT") { stop }
run
end
end

puts "** Camping running on #{host}:#{port}."
config.join
rescue Errno::EADDRINUSE
puts "** ERROR : address #{host}:#{port} already in use."
end
config.join
when :webrick
require 'webrick/httpserver'
require 'camping/webrick'
Expand Down

0 comments on commit e16c430

Please sign in to comment.