Skip to content

Instantly share code, notes, and snippets.

@dnch
Last active December 17, 2015 03:58
Show Gist options
  • Save dnch/5546857 to your computer and use it in GitHub Desktop.
Save dnch/5546857 to your computer and use it in GitHub Desktop.
Guardfile + Required Gems
logger level: :warn
rspec_opts = {
zeus: true,
binstubs: true,
all_on_start: false,
cli: "--order rand:$RANDOM"
}
guard :rspec, rspec_opts do
watch('spec/spec_helper.rb') { "spec" }
watch('config/routes.rb') { "spec/routing" }
watch('app/controllers/application_controller.rb') { "spec/controllers" }
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch(%r{^spec/.+_spec\.rb$})
end
unicorn_opts = {
config_file: "config/unicorn.development.rb",
daemonize: true,
port: 8080,
}
guard :unicorn, unicorn_opts do
watch %r{^config/(.+)\.rb$}
watch %r{^lib/(.+)\.rb$}
end
resque_opts = {
environment: 'development'
}
guard 'resque', resque_opts do
watch %r{^app/models/(.+)\.rb$}
watch %r{^config/(.+)\.rb$}
watch %r{^lib/(.+)\.rb$}
end
group :development, :test do
gem 'guard'
gem 'guard-unicorn'
gem 'guard-resque'
gem 'rb-fsevent', require: false #MacOSX
# gem 'rb-inotify', require: false #Linux
# gem 'rb-fchange', require: false #Windows
# Mac OS X 10.8 Notification integration
gem 'terminal-notifier-guard'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment