lib/stationed/generators/plugins/turbolinks.rb in stationed-0.0.1 vs lib/stationed/generators/plugins/turbolinks.rb in stationed-0.1.0
- old
+ new
@@ -1,9 +1,17 @@
module Stationed
module Generators
module Plugins
module Turbolinks
+ def self.prepended(base)
+ base.class_option :turbolinks,
+ type: :boolean,
+ default: true,
+ desc: 'Remove turbolinks from the generated project'
+ end
+
def finish_template
+ return super unless options[:turbolinks]
gsub_file 'Gemfile', /^gem 'turbolinks'.*\n/, ''
gsub_file 'app/assets/javascripts/application.js', %r{//= require turbolinks\n}, ''
super
end
end