Skip to content
/ cuba Public
forked from soveran/cuba

Rum based microframework for web development.

License

Notifications You must be signed in to change notification settings

gridchin/cuba

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cuba

Rum based microframework for web development.

Cuba and Rum, by Jan Sochor

Description

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.

Usage

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.

Installation

$ gem install cuba

About

Rum based microframework for web development.

Resources

License

Stars

Watchers

Forks

Packages

No packages published