A few terminal shortcuts for Rails devs

Here are a few command-line shortcuts for anybody that uses Ruby or Ruby on Rails on a daily basis:

Abbreviate bundle exec [command] #

Replace bundle exec with just be and you no longer have an excuse for running a rake without the dependency-locking prefix.

alias be='bundle exec'

# Example Usage
$ be rake
# equivalent to bundle exec rake

Abbreviate calls to rails … #

And use the binstub! This takes advantage of Spring to avoid reloading the app (if it’s in memory), making a call to br c load up a console much faster.

alias br='./bin/rails'

Get the latest Rails version #

Anytime I launch a new Rails app I check for the latest stable release. Instead of heading to the browser and checking the weblog or Rubygems everytime, I use this handy shortcut:

gem list -r ^rails$ | tail

This will output something like rails (5.1.1). You can then easily compare against what you’ve got installed: rails --version

Don’t want to type it all out or remember it? Me either:

alias latest_rails='gem list -r ^rails$ | tail'

That’s all for now!

 
0
Kudos
 
0
Kudos

Now read this

Don’t Disable My UI

I recently saw another designer using minimal-ui in his <meta name="viewport"> declaration. And then I saw Daniel Eden explain it on Twitter, and go so far as to include it on his own website. Adding “minimal-ui” to the viewport... Continue →