全新的 Ruby 的 Web 开发框架:Roda

jopen 10年前

Roda 是一个新的 Ruby   Web 开发框架,通过使用路由树实现更快和 DRY 编码。

# cat config.ru  require "roda"    class App < Roda    use Rack::Session::Cookie, secret: ENV['SECRET']      route do |r|      # matches any GET request      r.get do          # matches GET /        r.is "" do          r.redirect "/hello"        end          # matches GET /hello or GET /hello/.*        r.on "hello" do            # matches GET /hello/world          r.is "world" do            "Hello world!"          end            # matches GET /hello          r.is do            "Hello!"          end        end      end    end  end    run App.app

项目主页:http://www.open-open.com/lib/view/home/1407553136520