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

- old
+ new

@@ -1,15 +1,24 @@ module Stationed module Generators module Plugins module SimpleForm + def self.prepended(base) + base.class_option :simple_form, + type: :boolean, + default: true, + desc: 'Include and configure simple_form as FormBuilder' + end + def finish_template + return super unless options[:simple_form] gem 'simple_form' super end def run_bundle super + return unless options[:simple_form] generate 'simple_form:install' remove_file 'config/initializers/simple_form.rb' copy_file 'simple_form.rb', 'config/initializers/simple_form.rb' application do <<-RUBY