recipes/guard.rb in rails_apps_composer-1.1.4 vs recipes/guard.rb in rails_apps_composer-1.1.5
- old
+ new
@@ -1,6 +1,20 @@
-if config['guard']
+case config['guard']
+ when 'no'
+ recipes.delete('guard')
+ say_wizard "Guard recipe skipped."
+ when 'standard'
+ # do nothing
+ when 'LiveReload'
+ recipes << 'guard-LiveReload'
+ else
+ recipes.delete('guard')
+ say_wizard "Guard recipe skipped."
+end
+
+
+if recipes.include? 'guard'
gem 'guard', '>= 0.6.2', :group => :development
prepend_file 'Gemfile' do <<-RUBY
require 'rbconfig'
HOST_OS = RbConfig::CONFIG['host_os']
@@ -42,12 +56,12 @@
guard 'bundler', '>= 0.1.3'
unless recipes.include? 'pow'
guard 'rails', '>= 0.0.3'
end
-
- if config['livereload']
+
+ if recipes.include? 'guard-LiveReload'
guard 'livereload', '>= 0.3.0'
end
if recipes.include? 'rspec'
guard 'rspec', '>= 0.4.3'
@@ -78,10 +92,8 @@
category: other
tags: [dev]
config:
- guard:
- type: boolean
+ type: multiple_choice
prompt: Would you like to use Guard to automate your workflow?
- - livereload:
- type: boolean
- prompt: Would you like to enable the LiveReload guard?
+ choices: [["No", no], ["Guard default configuration", standard], ["Guard with LiveReload", LiveReload]]