Sha256: b9a65a3ae5020e3ad0ccaefe82332032387fd0cfb98928c219fa1ff24b7005cc

Contents?: true

Size: 848 Bytes

Versions: 1

Compression:

Stored size: 848 Bytes

Contents

module Pieces
  class Rails
    class InstallGenerator < ::Rails::Generators::Base
      source_root File.expand_path('../../../../examples', __FILE__)

      def pieces_yml
        copy_file 'rails_app/config/pieces.yml', 'config/pieces.yml'
      end

      def stylesheet
        copy_file 'rails_app/app/assets/stylesheets/pieces.css', 'app/assets/stylesheets/pieces.css'
      end

      def views
        copy_file 'rails_app/app/views/layouts/pieces.html.erb', 'app/views/layouts/pieces.html.erb'
        copy_file 'rails_app/app/views/application/_header.html.erb', 'app/views/application/_header.html.erb'
      end

      def mount_styleguide
        route "mount Pieces::Rails.mount(at: '/styleguide') unless Rails.env.production?"
      end

      def gitignore
        append_to_file '.gitignore', 'build/'
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pieces-0.6.0 lib/pieces/rails/install_generator.rb