Guard, livereload, and good times.
I think if you're a web developer, one of the most common keystrokes you'll perform every day is CTRL or CMD-R.
Refresh.
If you're working in Rails, you may not know of a little combination of technologies that will allow your webpage to two do things while you work.
1) Automatically reload the page when it senses HTML changes.
2) Automatically re-render the CSS in the browser without any page reload.
Imagine that.
It's actually really easy to get moving on it. Here's how to set it up in your rails app.
$ gem install guard
Add this to your Gemfile (inside the development group):
gem 'guard'
$ guard init
$ gem install rb-fsevent
Install either the growl_notify or the growl gem if you want notification support:
$ gem install growl_notify
$ # or
$ gem install growl
And add them to your Gemfile:
gem 'rb-fsevent'
gem 'growl'
$ gem install guard-livereload
Add it to your Gemfile (inside development group):
$ gem 'guard-livereload'
Add guard definition to your Guardfile by running this command:
$ guard init livereload
Install LiveReload Safari/Chrome extension:
To optimize communication with the LiveReload extension, install the yajl-ruby to increase JSON performance:
$ gem install yajl-ruby
$ bundle install
restart servers, then start the listener.
$ guard start
Here are some other links, for reference:
a hat tip to @stephencelis for the heads up and changing my life :)
