Skip to content

Commit

Permalink
Option to enable growl notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
drnic committed Apr 1, 2012
1 parent 6d32a99 commit 5ac85cb
Showing 1 changed file with 30 additions and 29 deletions.
59 changes: 30 additions & 29 deletions scrolls/guard.rb
@@ -1,5 +1,3 @@
gem 'guard', :group => :development

prepend_file 'Gemfile' do <<-RUBY
require 'rbconfig'
HOST_OS = RbConfig::CONFIG['host_os']
Expand All @@ -9,42 +7,45 @@

append_file 'Gemfile' do <<-RUBY
case HOST_OS
when /darwin/i
gem 'rb-fsevent', :group => :development
when /linux/i
gem 'libnotify', :group => :development
gem 'rb-inotify', :group => :development
when /mswin|windows/i
gem 'rb-fchange', :group => :development
gem 'win32console', :group => :development
gem 'rb-notifu', :group => :development
guard_notifications = #{config['guard_notifications'].inspect}
group :development do
case HOST_OS
when /darwin/i
gem 'rb-fsevent'
gem 'ruby_gntp' if guard_notifications
when /linux/i
gem 'libnotify'
gem 'rb-inotify'
when /mswin|windows/i
gem 'rb-fchange'
gem 'win32console'
gem 'rb-notifu' if guard_notifications
end
end
RUBY
end

# LiveReload

gem 'guard-livereload'
gem_group :development do
gem 'yajl-ruby'
gem 'rack-livereload'
end
# LiveReload

application nil, :env => "development" do
"config.middleware.insert_before(Rack::Lock, Rack::LiveReload)"
end

# Guard for other Scrolls
gem_group :development do
gem 'guard-livereload'
gem 'yajl-ruby'
gem 'rack-livereload'

gem 'guard-bundler'
# Guard for other Scrolls

gem 'guard-test' if scrolls.include? 'test_unit'
gem 'guard-bundler'
gem 'guard-test' if scrolls.include? 'test_unit'

KNOWN_GUARD_SCROLLS = %w[cucumber haml less passenger puma redis resque rspec unicorn]
KNOWN_GUARD_SCROLLS.each do |scroll|
gem "guard-#{scroll}" if scrolls.include? scroll
KNOWN_GUARD_SCROLLS = %w[cucumber haml less passenger puma redis resque rspec unicorn]
KNOWN_GUARD_SCROLLS.each do |scroll|
gem "guard-#{scroll}" if scrolls.include? scroll
end
end

after_bundler do
Expand All @@ -66,7 +67,7 @@
category: other
# exclusive:

# config:
# - foo:
# type: boolean
# prompt: "Is foo true?"
config:
- guard_notifications:
type: boolean
prompt: "Enable desktop Guard/Growl notifications?"

0 comments on commit 5ac85cb

Please sign in to comment.