Last active
December 24, 2015 01:39
-
-
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`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
destination: ./public | |
exclude: ['scss','Gem*','Guard*','*.rb','.sass-cache','.git'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you! this was very useful! Saved me a lot of time.