Skip to content

Instantly share code, notes, and snippets.

@karimmtarek
Forked from Patru/Cuba Setup.md
Created March 16, 2017 18:02
Show Gist options
  • Save karimmtarek/e069e29cc5f70be5a7d77b1367f658f8 to your computer and use it in GitHub Desktop.
Save karimmtarek/e069e29cc5f70be5a7d77b1367f658f8 to your computer and use it in GitHub Desktop.
Setting up Cuba with Sequel, Fortitude, Capybara and Minitest

Setup for Cuba in a sample app

I recently read up quite some articles on microframworks and I liked the idea to try out Cuba instead of the regular Sinatra for a change. Here is what I ended up with.

First of all my Gemfile:

source "https://rubygems.org"
ruby "2.0.0"

gem 'cuba', '3.3.0'
gem 'rack-protection'
gem 'rack-flash3'
gem 'fortitude'
gem 'sequel'
gem 'forme'
gem 'pony'

group :test, :development do
  gem 'sqlite3'
end
 
group :test do
  gem 'nokogiri'
  gem "rack-test"
  gem "capybara-webkit"
  gem 'capybara_minitest_spec'
  gem "launchy"
  gem 'delorean'
  gem 'email_spec'
  gem 'minitest-matchers_vaccine'
end

You won't find too many surprises here. I started with Cuba and included the things I liked or wanted to try out.

Most every rack app will need some protection and we all know the use of flash as well. Since I wanted to stay fairly minimal I did not include tilt as I planned to use [fortitude](https://github.com/ageweke/fortitude) as my main templating engine.

I started out with sequel as the database engine and quickly started to like it. forme is a form building gem that integrates well with sequel. I like the simplicity of pony for E-mailing and did not want to install PostGreSQL on my local machine, so I went with sqlite for development and test as I did not have any fancy requirements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment