Skip to content

Instantly share code, notes, and snippets.

@bencooling
Last active December 20, 2015 22:09
Show Gist options
  • Select an option

  • Save bencooling/6202931 to your computer and use it in GitHub Desktop.

Select an option

Save bencooling/6202931 to your computer and use it in GitHub Desktop.
Ruby, Gem & Guard
# Gem
# ---
# environment deats i.e.location of gem packages
gem env
# Guard
-------
gem install guard
gem install guard-sass
gem install guard-livereload
gem install guard-shell
# Create Guardfile in project
guard init
# Run guard server
guard
# List all guard plugins
gem search -r guard-
ignore /built\.js/
guard 'shell' do
watch(/script\/(.*).js/) { `node r.js -o build.js` }
end
guard 'shell' do
watch(/sass\/(.*).scss/) { `sass style/style.scss:style/style.css` }
end
# Use guard sass only for single scss files. This outputs to current directory
#guard 'sass', :output => './' do
# watch %r{style.scss}
#end
guard 'livereload', :grace_period =>0, :override_url=>'http://csv-editor.dev' do
watch(%r{templates/.+\.mustache$})
watch(%r{script/.+\.js}) { "script/built.js" }
watch(%r{style/.+\.css})
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment