Chris Mendez in Javascript, Ruby

Rails in a single command

Rails is always evolving. Sure, many people will argue that the framework (and subsequent community) is not iterating as quickly as Javascript but for many people, that's a good thing :smile:.

As for me, I started developing Rails apps in 2007 and I think it continues to do what it does best, focus on it's core product offering: metaprogramming. For example, here are a few commands that continue to make the Rails experience awesome.

Create an out-of-the-box app using a single line of code:

rails new [app_name] -m https://raw.github.com/RailsApps/rails-composer/master/composer.rb  

Why does this single line of code kick ass? Simple, the prompt helps you build out your entire development and production environment using a single line of code.

First it asks whether you want to build a starter application.
Pick a Starter Application

Then it asks you which type of application. I picked rails-devise-roles so that I can offer user registration, authentication and roles.

If you're not familiar with Devise, I suggest reading this SitePoint tutorial.

I've tried Pundit too and it's also easy to work with.

Pick a type of app

Pick your development server.
Pick your development server.

Pick your production server. I usually just pick whatever Heroku uses.
Pick your production server.

Pick your database. Again, I just pick whatever Heroku uses.
Pick your database.

I find erb to be painful to work with so I'll pick HAML.
Pick your templating engine.

I love that I get to pick a test framework. If you're not familiar with Rspec or Capybara, I suggest this Pluralsight tutorial.
Pick your test framework

Decide if you care about Continuous testing.
Pick continuous testing

I usually pick Bootstrap for a front-end development.
Pick front-end framework

I'm a big fan of SendGrid for mail. Gmail is good too.
Pick an e-mail system

A second question about Devise. I pick #2 or #3 (Invitable).

Yes, I want an Admin interface for the database.

Yes, I will eventually add my Google Analytics tracking code.

I will likely deploy on Heroku.
Deploy on Heroku

Keep on Turbolinks to speed up my app.
Use turbolinks

Yes, please at a robots.txt for SEO.
Include a robots.txt

Yes, please publish it to my Github repo.

WOW! All of that from a single command line. Amazing!


JS on the up-and-up

ExpressJS has a similar command-line generator. So does Angular 2 and Yeoman so I'm optimistic that Atwood's Law will eventually become a reality.


Resources