Roda is a routing tree web toolkit, designed for building fast and maintainable web applications in ruby.
$ gem install roda
- Website
- Source
- Bugs
- Google Group
-
Simplicity
-
Reliability
-
Extensibility
-
Performance
Roda is designed to be simple, both internally and externally. It uses a routing tree to enable you to write simpler and DRYer code.
Roda supports and encourages immutability. Roda apps are designed to be frozen in production, which eliminates possible thread safety issues. Additionally, Roda limits the instance variables, constants, and methods that it uses, so that they do not conflict with the ones you use for your application.
Roda is built completely out of plugins, which makes it very extensible. You can override any part of Roda and call super to get the default behavior.
Roda has low per-request overhead, and the use of a routing tree and intelligent caching of internal datastructures makes it significantly faster than other popular ruby web frameworks.
Here’s a simple application, showing how the routing tree works:
# cat config.ru require "roda" class App < Roda route do |r| # GET / request r.root do r.redirect "/hello" end # /hello branch r.on "hello" do # Set variable for all routes in /hello branch @greeting = 'Hello' # GET /hello/world request r.get "world" do "#{@greeting} world!" end # /hello request r.is do # GET /hello request r.get do "#{@greeting}!" end # POST /hello request r.post do puts "Someone said #{@greeting}!" r.redirect end end end end end run App.freeze.app