Reloader paths/

John Sheets fisheye at metacasa.net
Tue Jun 19 21:01:10 EDT 2007


On Jun 19, 2007, at 2:20 PM, carmen wrote:

> after investigating why the reloader wasnt working , i discovered 2  
> probs, one of which was sorta my fault (but will likely happen to  
> others who make one-file apps)

> anyone have any preferences on whether the former or the latter  
> technique is a less world-changing solution? would either one break/ 
> fix RV / TentSteak / CampingServer?

No idea about TentSteak.  Here's my parameterized kickstart method to  
run a Camping app under mongrel, webrick, or CGI (haven't gotten to  
FCGI yet).  Anything clunky in there?  It's kind of an early spitball  
at this point, so lots of room for improvement.

   def self.run_app(app_module, app_base = "app")
     case ARGV.first
     when "mongrel"
       puts "Running Mongrel in FCGI mode"
       require "mongrel/camping"

       app_module::Models::Base.threaded_connections = false
       server = Mongrel::Camping::start("0.0.0.0", 3301, "/# 
{app_base}/", app_module)
       puts "#{app_module} app is running at http://localhost:3301/# 
{app_base}/"
       server.run.join
     when "webrick"
       puts "Running in WEBrick mode"
       require 'webrick/httpserver'
       require 'camping/webrick'

       s = WEBrick::HTTPServer.new(:BindAddress => "0.0.0.0", :Port  
=> 3301)
       s.mount("/#{app_base}", WEBrick::CampingHandler, app_module)
       trap(:INT) { s.shutdown }
       s.start
     else
       # Default to CGI.
       puts app_module.run
     end
   end

John

-- 
"The Internet is not something you just dump something
on.  It's not a big truck.  It's a series of tubes."
  --Senator Ted Stevens, R-AK

John R. Sheets
http://bark.metacasa.net



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/camping-list/attachments/20070619/faf05e67/attachment.html 


More information about the Camping-list mailing list