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.3or 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.locktogittoo - create
routesandconfigdirectories, want to put stuff in there - create an initial
Cubaroute inroutes/default.rb - create a
config.ruwhich runs the defaultCubaapp - when we start the app with
rackupit already picks uppumaand 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 runpumaand allows for customization, I started out with theherokudefaults for rails, now we can run a multi-worker server with just thepumacommand, answers the/hellorequest in a sub-millisecond range - roll your
environment.rbwith corresponding environments, this allows to configure the DB as you wish - create the
viewsdirectory, want to do HTML next - I need a little plugin to roll with my favorite
fortitudegem so make apluginsdirectory and put theforti.rbthere in order to get anforticommand to render afortitude-class. - Add the
Pageclass to theviewsdirectory, customize to your likings. - Add a simple page and check the basic layout.
- Assets are next,
sprocketsis cool. There iscuba-assetswhich did not quite fit my version ofCubathough, so I forked it to match the versions. I also found it did not exhibit therackserver 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 wayURLMaps work to be sure. - Nevermind, once I got the
rackserver 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.rbto thespecdirectory, basic stuff forminitest/spec. - Get sidetracked for some time to make
Capybara::Screenshotwork withMinitest::Specwithout ´ActionDispatch::IntegrationTest´ - fix some deprecation warning during testcases by updating to
QT5,brew install qt5was only half of the deal, I had tobrew unlink qtandbrew link --force qt5and thengem uninstall capybara-webkitandbundleit again to get the tests working without the deprecation warning complaining about the QT version (in a "future release", mind you).