Slide 1

Slide 1 text

Rails App Templates How to make your developer's life easier

Slide 2

Slide 2 text

What ? ● Ruby files to automatically add gems/css/javascripts/... and set up your rails app (environment, DB, git, deploy, data seeds, layouts, views, ...)

Slide 3

Slide 3 text

Why ? ● Easy project set up for new developers ● Quickly get an app up and running ● Get rid of boring and repetitive tasks to get all basics stuff working on new apps ● Global productivity increase even if could be time consuming at the beginning

Slide 4

Slide 4 text

How? ● Rails template generators ● Rails templates ● Git ● Combination of all these possibilities Rails template generator Rails app template Rails app Git

Slide 5

Slide 5 text

Rails template generators Write templates using generators Tools ● App drone (http://drone.bz/new) ● Rails apps composer (https://github.com/RailsApps/rails_apps_composer) ● Rails wizard (https://github.com/intridea/rails_wizard) ● Rails templater (https://github.com/kfaustino/rails-templater) ● Thesilverspoon (https://github.com/ptotemy/thesilverspoon) ● Appscrolls (http://appscrolls.org/)

Slide 6

Slide 6 text

Rails template generators Pro's ● Modularity, an infinity of combination ● A lot of basic recipes already available ● Still editable by yourself ● Need small changes when updating to new version ● No need to master the gem to use the recipe Con's ● Generator-specific recipes ● Recipes still missing ● Possibility of incompatibilities between recipes ● Recipes needs to be trusted ● Could lead to weaknesses in gem and system knowledge for developers ● Time consuming if completely handwritten

Slide 7

Slide 7 text

Rails templates Write templates by yourself Tools ● Rails generators based on Thor Pro's ● Handle the complete process Con's ● Monolithic piece of code ● Lot of work ● Not so easy to maintain on the long run

Slide 8

Slide 8 text

Rails templates Links ● http://m.onkey.org/rails-templates ● http://asciicasts.com/episodes/148-app-templates-in-rails-2-3 ● http://railscasts.com/episodes/148-app-templates-in-rails-2-3 ● http://everydayrails.com/2011/02/28/rails-3-application-templates.html ● http://guides.rubyonrails.org/generators.html ● http://edgeguides.rubyonrails.org/rails_application_templates.html ● https://github.com/RailsApps/rails3-application-templates

Slide 9

Slide 9 text

Git Use git repository containing basic app Tools ● Git Pro's ● Easiest way to get a fully set up rails app ● Finest and widest configuration possibilities than other methods Con's ● Not modular at all ● Lot of work ● Not so easy to maintain on the long run

Slide 10

Slide 10 text

Examples ● Generated template (via Drone.bz) ● Existing template (http://railsapps.github.com/tutorial-rails-bootstrap- devise-cancan.html) ● Handwritten template rails new belighted_base_app --builder=http://drone.bz/1047034f-c1aa-4926-b632-eccf1ed977ab.rb rails new rails3-bootstrap-devise-cancan -m https://raw.github.com/RailsApps/rails3-application- templates/master/rails3-bootstrap-devise-cancan-template.rb -T rails new belighted_test -m https://gist.github. com/raw/2958576/a060d3dc6070e730bd03bf921360f113b2409bfe/belighted_template.rb

Slide 11

Slide 11 text

http://platypus.belighted.com/ @stephamant