Project

derail

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Derail is a collection of helpers and libraries which I use in \ almost every project, and a generator to get started quickly.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 2.0.0.rc3
>= 3.1.rc4
 Project Readme

Derail

A collection of helpers and libraries which I use in almost every project, and a generator to get started quickly.

Some of this stuff may graduate into gems or get contributed back to other projects.

Features

  • Generators:
    • derail:app: Derails a new rails project, basically doing all the following:
      • Configure databases:
        • development: APPNAME_development/development/development
        • test: APPNAME_test/test/test
        • production: read from environment (DATABASE/DATABASE_USERNAME/DATABASE_PASSWORD).
      • Configure ActionMailer:
        • development: default_url_options to _APPNAME_.dev, MailCatcher delivery.
        • test: default_url_options to _APPNAME_.test.
      • Makes SASS the default stylesheet syntax (not SCSS) and converts application.css to application.css.sass.
      • Converts application.js to application.js.coffee.
      • Installs RSpec
      • Installs Cucumber
      • Installs RR
      • Installs Guard (ego, bundler, rspec, cucumber)
      • Runs formtastic:install
      • Runs derail:devise
      • Removes default index.html and rails.png
    • derail:devise: Install devise, setup a user, install remarkable_devise.
    • derail:devise:haml: Installs fully-localizable, HTML5, formtastic Devise HAML templates.
  • Updated scaffold templates:
    • HTML5, formtastic scaffold HAML templates.
    • Responder-based scaffold controller.
  • Helpers:
    • Activated link helper, adapted from a few places. Documentation coming.
    • Flashes helper, lists all your flashes in aside elements.
  • Vendored javascripts:
  • Plenty more to come!

Use

To create a new app, I run:

rails new APPNAME --skip-test-unit --skip-bundle --database=postgresql --template http://sj26.com/derail

For handyness in zsh:

function derail() { rails new $1 --skip-test-unit --skip-bundle --database=postgresql --template http://sj26.com/derail $@[2,-1] }

then

derail APPNAME

You need to skip bundling due to a clash between rails and bundlers' vendored versions of the thor gem.

Vendored javascripts

Add them to your applictation's javascript files using sprockets require directives, a la jQuery:

//= require jquery_innershiv

Caveats

  • It's Rails 3.1 only, but you should be basing your new projects on the latest and greatest! It'll be stable by the time you release... right?

  • I'm presuming your using my devise branch:

      gem "devise", :git => "git://github.com/sj26/devise.git", :branch => "template-inheritence"
    

    If not, copy the HAML templates into your project and re-twiddle the footer partial.

TODO

  • Home generator.
  • Admin generator.
  • Admin scaffold generator.
  • Pages generator.
  • (Some) in-app errors handler generator.
  • Page title helper inspired by page_title_helper
  • Vendored WYSIWYG (can't decide which library).
  • Formtastic WYSIWYG field helpers.
  • Tilt-based renderable activerecord fields with filter white/blacklists and stored filter type.
  • More tests.

License

Copyright (c) 2011 Samuel Cochran, released under the MIT license, see LICENSE.