This post originated from an RSS feed registered with Ruby Buzz
by Red Handed.
Original Post: The Camping Server
Feed Title: RedHanded
Feed URL: http://redhanded.hobix.com/index.xml
Feed Description: sneaking Ruby through the system
Lately, I’ve been writing little Camping apps that I can just drop in a directory and they get automatically mounted. I’m running a personal web server with a wiki, CampSh, and development versions of Balloon and Hoodwink.d.
Both Mongrel and FastCGI can be set up to do this. Therefore: the ease of PHP installation, but the cleanliness of mini-Rails.
This idea has been blossoming on the wiki: TheCampingServer. It’s just a set of rules:
Load all Camping apps in a directory.
Load new apps that appear in that directory.
Mount those apps according to their filename. (e.g. blog.rb is mounted at /blog.)
Run each app’s `create` method upon startup.
Reload the app if its modification time changes.
Reload the app if it requires any files under the same directory and one of their modification times changes.
Support the `X-Sendfile` header.
For WEBrick or Mongrel, this setup can be accomplished by using the bin/camping script included with the gem:
I’d really like to see distributions offer a package which would allow simple setup of TheCampingServer, just as you see with PHP. If you’re interested in seeing this happen for the upcoming Camping 1.5 release, introduce yourself on the camping-list.