lib/stationed/generators/plugins/guard.rb in stationed-0.0.1 vs lib/stationed/generators/plugins/guard.rb in stationed-0.1.0

- old
+ new

@@ -1,10 +1,18 @@ module Stationed module Generators module Plugins module Guard + def self.prepended(base) + base.class_option :guard, + type: :boolean, + default: true, + desc: 'Include Guard for Rspec and Livereload' + end + def finish_template + return super unless options[:guard] gem_group :development do gem 'guard' gem 'guard-rspec' gem 'guard-livereload' gem 'terminal-notifier-guard' @@ -12,9 +20,10 @@ super end def run_bundle super + return unless options[:guard] run 'bundle exec guard init rspec' run 'bundle exec guard init livereload' gsub_file 'Guardfile', /guard :rspec do/, "guard :rspec, cmd: 'spring rspec' do"