Ruby Weekly is a weekly newsletter covering the latest Ruby and Rails news.

Wuby, another light-weight Web framework for Ruby

By Peter Cooper / November 19, 2007

Wuby
Wuby, developed by Chris Matthieu, is a new light-weight Ruby Web application framework, much in a similar vein to Sinatra or Camping.
One of the differences of Wuby is that no third party applications or gems are required to run Wuby apps, and the Wuby library itself contains everything necessary to run an HTTP daemon and start serving requests. The wuby.org site itself is running on the Wuby system and certainly seems to serve up pages extremely quickly. No database connections are required (although MySQL and SQLite are easily usable), and data can be stored in a persistent hash for ultra simplicity.

I find the example code on wuby.org a little arcane (I'd say it has a bit of a PHP feel about it), but there's some documentation and the framework is easy to download (just one file). Chris has also put together a great 30 minute screencast where he walks through how Wuby works and how to put together an application with it.

Comments

  1. Moeseph says:

    Be sure to click the delete post link on the Wuby homepage, aparently it blows up the site. At least, I think I blew it up. It looks blown up.

  2. Garth says:

    From the example code, I'd say it doesn't even look like Ruby.

  3. Grant Hutchins says:

    What's with the red squigglies on the logo up there?

    Someone misspell something? ;)

  4. Mark Twain says:

    Well, I guess that just like you can write Fortran in any language, you can do the same with PHP. Apparently.

  5. Daniel Berger says:

    Hm, I wonder where he got the name "Wuby" from...

  6. John Joyce says:

    wuby's web site is pretty wrough awround the edges...
    it needs a wittle work...

  7. Ryan Allen says:

    I am so loving all these little Ruby web frameworks :) Though in the case of Wuby, I don't know why you'd just use Rack and Mongrel... I see no benefit in having some 'really really really' standalone library when you can use Mongrel as a web server and Rack as a higher level API to build your even higher level API web framework on.

    I did a presentation on rolling your own with Rack if anyone is interested.

    It's all about the API of ye'ole tiny framework, people!

  8. Chris Matthieu says:

    Hello Everyone! Thanks for your feedback. I am an ex-microsoft developer that has been working in ruby exclusively for a little over a year now. I have built several large rails applications. On several occasions, I needed to deploy a very lightweight web application with little or no database interaction but wanted to use the ruby language. Mongrel, Rack, and Camping required several installations and more memory overhead than was actually needed to accomplish my goal.

    Wuby is a wee-little web server written in ruby; hence the name. There are no installations or setup required to begin serving pages. Simply copy your rhtml files and images and wuby.rb to your directory and type "ruby wuby.rb -d -p xxxx" where xxxx is the port number and a daemon instance of your web server will launch and begin serving your index.rhtml file.

    Directory browsing is also supported by adding a -b as a switch in the launch string. This little web server is very fast and reliable and consumes under 3 MB of RAM to run and it can process 300 http transactions in under 6 seconds. Not too bad...

    Honestly, please continue to share your thoughts. I believe that it meets a need and would like your input to make it better.

    Thank You,
    Chris Matthieu
    http://rubyology.com

  9. James says:

    "I see no benefit in having some 'really really really' standalone library when you can use Mongrel as a web server and Rack as a higher level API to build your even higher level API web framework on."

    Ruby has given us the age of DSA's and DSF's: domain-specific apps and domain-specific frameworks. It's easy enough to roll your own specialized app or framework, something that fits your head better than current off-the-shelf offerings, much as people have being doing with domain-specific languages and domain-specific dialects. Clearly these won't all be to everyone's taste, but that's true of DSLs as well.

    The interesting thing here is not so much that we have Yet Another Web Framework (though I really like Wuby), but that people are increasingly inclined to make them.

    You don't have to like or use Wuby; the key is knowing that you don't have to really like or use *any* Web framework, because crafting your own is very often a real option.

    Rather than harp on this or that flaw one may find in Wuby, people should look at all such apps and tools as conceptual petri dishes full of ideas to steal for their own DSF.

  10. Ryan Allen says:

    James I agree with you completely! And the leverage you can get from Rack and Mongrel is huge - you can construct your best fit with very minimal infrastructure work having being done for you.

    Yet Wuby implements all it's own infrastructure using base Ruby libraries... quite a lot of work from scratch. Using a combination of Rack and Mongrel you can focus on your API knowing that all the nitty gritty is handled and solid.

  11. John Murch says:

    Wuby is great for smaller ruby projects that do not NEED a lot of overhead. Camping is still a bit too much for some projects, but going back and forth between php and ruby drives me nuts.

    As James says, "it doesn't matter if you use or don't use wuby...key is knowing that you don't have to really like or use *any* Web framework". Creating your own frame work for a large project is easy to do with ruby.

    Wuby just is a extremely bare bones framework that is great for smaller projects that need to serve pages up .. fast!

  12. Chris Matthieu says:

    It seems like many people were confused by the demo blog application residing at http://www.wuby.org thinking that the demo was Wuby. In reality, the demo is running on the Wuby web server and built-in Ruby framework.

    The Wuby.org site now has an introduction to explain the Wuby offering along with a link to the blog demo application. The fantastic results from RubyInside's post is that wuby has received a great deal of traffic without failure or degradation in response time!

    Thanks everyone!

  13. Chris Matthieu says:

    Remember the days of IIS and ASP code where you could mix HTML and ASP scripts inside of symbols? Wuby allows you to accomplish the same task but using the Ruby language instead of ASP!

Other Posts to Enjoy

Twitter Mentions