Commandify

A bunch of really awesome, helpful and easy command line tools for Rails apps.

Installation

Add this line to your application's Gemfile:

gem 'commandify'

And then run:

$ bundle install
$ commandify install
$ source ~/.bashrc    

Commandify adds aliases to ~/.bashrc which evaluate strings returned by the Commandify gem in the context of your current shell. After install, ~/.bashrc might look something like this:

# COMMANDIFY [VERSION NUMBER] #
alias r='eval $(bundle exec commandify r)'
alias m='eval $(bundle exec commandify m)'
alias v='eval $(bundle exec commandify v)'
...
# COMMANDIFY END #

When updating Commandify to a newer version, simply re-run commandify install. It will load all new aliases automatically. If you've manually modified aliases in ~/.bashrc and want to return to Commandify defaults, run commandify install! to force a re-installation.

Usage

Nagivation Commands

$ r            # cd to root of rails app
$ p            # cd to public
$ m            # cd to app/models
$ v            # cd to app/views
$ c            # cd to app/controllers
$ a            # cd to app/assets
$ h            # cd to app/helpers
$ j            # cd to app/assets/javascripts
$ s            # cd to app/assets/stylesheets
$ i            # cd to app/assets/images
$ f            # cd to app/assets/fonts
$ e            # cd to config/environments
$ conf         # cd to config
$ init         # cd to config/initializers
$ db           # cd to db
$ l            # cd to lib
$ la           # cd to lib/assets
$ lt           # cd to lib/tasks
$ las          # cd to lib/assets/stylesheets
$ laj          # cd to lib/assets/javascripts
$ v            # cd to vendor
$ va           # cd to vendor/assets
$ vt           # cd to vendor/tasks
$ vas          # cd to vendor/assets/stylesheets
$ vaj          # cd to vendor/assets/javascripts

Process Commands

$ srvstart     # starts rails server on port 3000, automatically kills existing process on same port
$ srvstop      # kills ruby process on port 3000
$ srvrestart   # effectively the same thing as srvstart, might get rid of this one?

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request