Skip to content

Instantly share code, notes, and snippets.

@xavez
Last active December 24, 2015 01:39
Show Gist options
  • Save xavez/6725533 to your computer and use it in GitHub Desktop.
Save xavez/6725533 to your computer and use it in GitHub Desktop.
Prototyping Guard setup Use Compass, Jekyll and LiveReload to compile static prototypes. `cd`to project directory `bundle install` `bundle exec guard`
destination: ./public
exclude: ['scss','Gem*','Guard*','*.rb','.sass-cache','.git']
# ~/Gemfile
source "http://rubygems.org"
group :development do
# CSS Preprocessing
gem 'sass'
gem 'compass'
gem 'jekyll'
# Guard Specific
gem 'guard'
gem 'guard-compass' # Compile on sass/scss change.
gem 'guard-jekyll' # Jekyll.
gem 'guard-jekyll-plus' # Jekyll Plus.
gem 'guard-livereload' # Browser reload.
gem 'yajl-ruby' # Faster JSON with LiveReload in the browser.
end
# ~/.GuardFile
notification :off
# Sass/Compass https://github.com/guard/guard-compass
if File.exists?("./config.rb")
guard :compass do
watch(%r{(.*)\.s[ac]ss$})
end
end
# Jekyll
guard 'jekyll-plus', :config => ['_config.yml'] do
watch /.*/
ignore /public/
end
# LiveReload https://github.com/guard/guard-livereload
require 'find'
if Find.find(Dir.pwd).detect{|dir|dir=~/.+\.(css|html|js)$/}
guard 'livereload', :grace_period => 0.5 do
watch(%r{.+\.(css|html|js)$})
end
end
@landitus
Copy link

Thank you! this was very useful! Saved me a lot of time.

@xavez
Copy link
Author

xavez commented Dec 12, 2013

You’re welcome @landitus :).

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