Skip to content

Instantly share code, notes, and snippets.

@jtallant
Last active December 22, 2015 05:58
Show Gist options
  • Save jtallant/6427833 to your computer and use it in GitHub Desktop.
Save jtallant/6427833 to your computer and use it in GitHub Desktop.
Guard Setup

Guard

Guard is a command line tool to easily handle events on file system modifications. http://guardgem.org

Github: https://github.com/guard/guard

Guard can be used for many different things related to file system modifications. Our most common use cases will be live-reload and stylesheet compilation.

Just installing guard alone won't give you all the features. You need to install guard as well as the plugins you want to use with it. Jeffrey Way has a great video on installing/using guard. guard-is-your-best-friend

Installing Guard

You shouldn't have to run all the commands below manually. Instead we will use bundler to manage dependencies. Any project we set up should come with a Gemfile. The Gemfile is just a list of gems we will need for the project. If you have bundler installed, you can just run bundle install to get all of the dependencies.

gem install bundler

From the project root run bundle install

Requirements

  • Ruby - Comes pre installed on the mac but I suggest you install RVM. RVM will allow you to easily install/manage multiple versions of Ruby.
  • Ruby Gems installation
gem install guard
gem install guard-sass
gem install guard-livereload
gem install guard-uglify
gem install guard-compass

guard
guard-livereload
guard-sass
guard-uglify
guard-compass

Using Guard

General Help

guard --help
Read the guard README.md file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment