Shinkansen

Spin up well-configured Rails apps in minutes rather than hours. A personal-flavored fork of Gypsum, which itself was a fork of Prologue.

Installation

$ gem install shinkansen

Usage

$ shinkansen new some_project
$ cd some_project
$ rails s

A git repository is initialized and commit to after generating the initial stock Rails app. You can get a sense for which configuration changes Shinkansen has made by doing:

$ git diff

Once you've reviewed those changes and are satisfied, you should do an initial:

$ git add -A
$ git commit -m "Initial commit from Shinkansen."

Thanks

Shinkansen is a fork

What's in the Box

Tools of the Trade

All generated ERB files are converted to Haml.

Authentication and Authorization

Authentication and authorization are provided by devise and cancan. We've also kept Quickleft's out-of-the-box implementation for users having many roles and simple checking of roles like so:

user.is?(:admin)

A sample admin user ([email protected]) and regular user ([email protected]) is created as well. The password for both accounts is password!

Admin Console

Customers can manage their data easily using rails_admin.

Helpers

Dates

Format your times and dates naturally with stamp:

%p You last signed in on #{current_user.last_sign_in_at.stamp('Saturday, January 1, 2012')}

Grammar

Present grammatically correct possessives like Andrew's and Silas' with possessive:

%h2= #{user.name.possessive} Friends

Randomness

Fetch random records using randumb

@five_friends = user.friends.random(5)

Cross-Browser CSS3

Use CSS3 with confidence with bourbon's Sass mixins.

Convert Markdown to HTML

Converting Markdown to HTML is a great way to let users format their content, which I use BlueCloth for.

.content
  = BlueCloth.new(@user.profile).to_html.html_safe

We typically just role that into a markdown() view helper, but haven't included that yet.

File Attachments

In addition to including paperclip by default, I also include paperclip-s3 which means you don't need any configuration code for file attachments to work on Heroku. Instead, just create a bucket and register the details like so:

heroku config:add S3_BUCKET=your_bucket_name
heroku config:add S3_KEY=your_access_key
heroku config:add S3_SECRET=your_secret_key

Scalability

Write code that scales better with delayed_job.

Usability

Report on Validation Errors

Find out which validation errors you users run into again-and-again with tripwire_notifier.

Parse Natural Language Dates

Or any format really, with chronic

Responsive Development without Command + Tab

Automatic in-browser refreshing on page save with guard-livereload and rack-livereload. When you have a guard process running from the project directory, pages will automatically refresh when you save Haml, assets, view helpers, locales, etc.

$ guard

User-friendly and SEO-friendly URLs

That's what friendly_id is for. (Note to self, I should add this to users by default as an example.)

The Testing Suite

  • rspec
  • capybara and capybara-webkit
  • shoulda-matchers
  • webmock
  • vcr
  • email_spec
  • timecop
  • factory_girl_rails