Rum based microframework for web development.
Cuba is a light wrapper around Rum, a tiny but powerful mapper for Rack applications.
It integrates many templates via Tilt, and testing via Cutest and Capybara.
Here's a simple application:
# cat hello_world.rb
require "cuba"
Cuba.use Rack::Session::Cookie
Cuba.define do
on get do
on path("hello") do
res.write "Hello world!"
end
on default do
res.redirect "/hello"
end
end
end
# cat hello_world_test.rb
require "cuba/test"
scope do
test "Homepage" do
visit "/"
assert has_content?("Hello world!")
end
end
To run it, you can create a config.ru
:
# cat config.ru
require "hello_world"
run Cuba
That's it, you can now run rackup
and enjoy what you have just created.
For more information about what you can do, check Rum's documentation. To see how you can test it, check the documentation for Cutest and Capybara.
$ gem install cuba