Skip to content

Instantly share code, notes, and snippets.

@andrexduarte
Last active December 24, 2015 14:39
Show Gist options
  • Save andrexduarte/6814315 to your computer and use it in GitHub Desktop.
Save andrexduarte/6814315 to your computer and use it in GitHub Desktop.
Guard para automatizar tarefas.
group :frontend do
guard 'shell' do
watch %r{.+\.(scss|sass)} do |file|
n file[0], "#{file[0]} changed"
`compass compile --sourcemap`
end
end
# Image optimization
guard 'shell' do
watch %r{^images/.} do |file|
n file[0], "#{file[0]} changed"
`open #{file[0]} -a ImageOptim`
end
end
end
group :concat do
guard 'shell' do
watch %r{^js/main.js} do |file|
n file[0], "#{file[0]} changed"
`juicer merge js/app.js js/vendor/* js/main.js --force -s`
end
end
end
group :linter do
# # JsHint
# # JsHint Install
# # npm install jshint
# # npm install --save-dev jshint-stylish
# guard 'shell' do
# watch %r{js/main.js} do |file|
# n file[0], "#{file[0]} changed"
# #`jshint --reporter node_modules/jshint-stylish/stylish.js js/main.js`
# end
# end
guard 'shell' do
watch %r{.+\.(scss|sass)} do |file|
n file[0], "#{file[0]} changed"
`scss-lint sass/ --exclude sass/third-party/*`
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment