Sha256: 87eb03222b86f29543770e15278cc0fbe33456ad05f7f57a5499fa7619a435ca

Contents?: true

Size: 575 Bytes

Versions: 6

Compression:

Stored size: 575 Bytes

Contents

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
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
stationed-0.6.0 lib/stationed/generators/plugins/turbolinks.rb
stationed-0.5.0 lib/stationed/generators/plugins/turbolinks.rb
stationed-0.4.0 lib/stationed/generators/plugins/turbolinks.rb
stationed-0.3.0 lib/stationed/generators/plugins/turbolinks.rb
stationed-0.2.0 lib/stationed/generators/plugins/turbolinks.rb
stationed-0.1.0 lib/stationed/generators/plugins/turbolinks.rb