Since I did not want to constantly re-invent the wheel I will write down my choices for putting together my Cuba template.
- Choose your favorite version of ruby and install it using rbenv (I happened to use MRI 2.2.3 at this point).
- create your template directory and CD into it.
- fix your ruby version using
rbenv local 2.2.3
or somesuch - create a github repository and follow the instructions for the README.md and the first commit.
- get a Gemfile from a running project and edit away the stuff I considered project specific
- run bundle install, takes a while, but looks nice, remember to add
Gemfile.lock
togit
too - create
routes
andconfig
directories, want to put stuff in there - create an initial
Cuba
route inroutes/default.rb
- create a
config.ru
which runs the defaultCuba
app - when we start the app with
rackup
it already picks uppuma
and runs my app with default setting, first success, get a piece of chocolate :-) - create the
config/puma.rb
, this is picked up automatically if you just runpuma
and allows for customization, I started out with theheroku
defaults for rails, now we can run a multi-worker server with just thepuma
command, answers the/hello
request in a sub-millisecond range - roll your
environment.rb
with corresponding environments, this allows to configure the DB as you wish - create the
views
directory, want to do HTML next - I need a little plugin to roll with my favorite
fortitude
gem so make aplugins
directory and put theforti.rb
there in order to get anforti
command to render afortitude
-class. - Add the
Page
class to theviews
directory, customize to your likings. - Add a simple page and check the basic layout.
- Assets are next,
sprockets
is cool. There iscuba-assets
which did not quite fit my version ofCuba
though, so I forked it to match the versions. I also found it did not exhibit therack
server to mount it so I added that too, just to not have to resort toRack::URLMap
, but on second thought that seems like a bad idea. Have to check out the wayURLMap
s work to be sure. - Nevermind, once I got the
rack
server I was easily able to mount it withinCuba
, serving of assets seemed a little slow at 30 ms odd though. - Add the
Rakefile
, migrations and specs for now - add a
spec_helper.rb
to thespec
directory, basic stuff forminitest/spec
. - Get sidetracked for some time to make
Capybara::Screenshot
work withMinitest::Spec
without ´ActionDispatch::IntegrationTest´ - fix some deprecation warning during testcases by updating to
QT5
,brew install qt5
was only half of the deal, I had tobrew unlink qt
andbrew link --force qt5
and thengem uninstall capybara-webkit
andbundle
it again to get the tests working without the deprecation warning complaining about the QT version (in a "future release", mind you).