Sha256: 80da154635f7672de492d26b572a099ef69cc5e322863e1dba8b9b1d1edfe61e

Contents?: true

Size: 705 Bytes

Versions: 1

Compression:

Stored size: 705 Bytes

Contents

module Soonish
  module Generators
    class InstallGenerator < ::Rails::Generators::Base
      desc 'Copy default views and migrations to install Soonish'

      source_root File.expand_path("../../../../../app/views/", __FILE__)

      def copy_layout
        copy_file 'layouts/soonish/soonish.html.erb', 'app/views/layouts/soonish.html.erb'
      end

      def copy_views
        directory 'soonish', 'app/views/soonish'
      end

      def install_migrations
        rake("soonish:install:migrations")
      end

      def mount_engine_to_root
        insert_into_file "config/routes.rb", "\n  mount Soonish::Engine, at: '/'\n", :after => "Application.routes.draw do\n"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
soonish-0.0.1 lib/generators/soonish/install/install_generator.rb