Sha256: aa8c9d6bbca03f4b0568c5a1c199ed91afcdf51dfbcc4bc4db1e11cb1e815317

Contents?: true

Size: 559 Bytes

Versions: 3

Compression:

Stored size: 559 Bytes

Contents

module Stationed
  module Generators
    module Plugins
      module Layout
        def self.prepended(base)
          base.class_option :layout,
            type: :boolean,
            default: true,
            desc: 'Add a generic Haml application layout file'
        end

        def finish_template
          return super unless options[:layout]
          remove_file 'app/views/layouts/application.html.haml'
          copy_file 'application.html.haml', 'app/views/layouts/application.html.haml'
          super
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
stationed-0.3.0 lib/stationed/generators/plugins/layout.rb
stationed-0.2.0 lib/stationed/generators/plugins/layout.rb
stationed-0.1.0 lib/stationed/generators/plugins/layout.rb