Blank is GiraffeSoft’s starter Rails application.
It makes heavy use of our standard toolset. Controllers are mostly written using ResourceController
, and it is tested entirely with Thoughtbot’s Shoulda
. Integration testing is taken care of by Cucumber
.
Tools we use in nearly all of our applications are vendored, as is Rails:
- active_presenter - andand - hoptoad - mocha - rake - restful_authentication - ruby-openid - will_paginate
Installing Blank is as easy as running a Rake task. Except that Blank uses Thor instead, because it’s the new hotness, and it supports remote tasks.
Just install Thor:
$ sudo gem install thor
…then install Blank’s Thor tasks:
$ thor install http://github.com/giraffesoft/blank/tree/master%2Fthorfiles%2Fblank.thor?raw=true
…then you’re ready to create a new application with Blank:
$ thor blank:new_app the_name_of_my_app the_git_repo_it_will_live_in
That’s it! There are a few Rake notes that will inform you about some places that you need to replace Blank’s name with your application’s name.
Also, you need to go fill in your HopToad API key in config/initializers/hoptoad.rb
If we improve the Thor file, all you have to do is run
$ thor update blank
before creating your next application, and you’ll get the changes automagically.
Your application will share Blank’s git history. This means that when Blank gets patched, you’ll be able to merge our commits back into your application. Like when we get around to implementing OpenID, you’ll get it for free in your application, if you started with Blank. Just pull from the blank repository (set up as a remote called ‘blank’ in your app).
$ git fetch blank $ git merge blank/master
All development will be done at the GitHub repository. Fork away :)
After cloning, to get tests passing:
$ rake blank:build
If you want to deploy to Heroku, there’s a built-in Rake task to generate Heroku’s .gems
file:
$ rake heroku:gems
This task will create or update .gems
with new dependencies coming from config/environment.rb. The task will also commit the changes to your repository.
Using JRuby 1.2, I was able to successfully run the functional tests with this in my config/database.yml:
# If you use SQLite3 under JRuby, use these blocks instead development: adapter: jdbcsqlite3 database: db/development.sqlite3 test: adapter: jdbcsqlite3 database: db/test.sqlite3
Of course, you’ll need the proper gems installed:
$ jruby -S gem install activerecord activerecord-jdbc-adapter activerecord-jdbcsqlite3-adapter jdbc-sqlite3
I had the following versions installed:
-
activerecord (2.3.2)
-
activerecord-jdbc-adapter (0.9.1)
-
activerecord-jdbcsqlite3-adapter (0.9.1)
-
jdbc-sqlite3 (3.6.3.054)
I said “functional tests” above because there were some minor unit test failures as well as integration test failures. These aren’t show stoppers though.
Blank was created by James Golick. Its development is funded by GiraffeSoft Inc.
Daniel Haran also contributed several patches, and his ongoing thoughts and critiques.
François Beausoleil updated Blank to Rails 2.3.2.
Blank is available under the MIT License, as is all of the code generated by the Rails generator.