Sha256: 3efe8a79f4bb212e510d672e0b114b2e0a2ed88c4d6ab3f3c043c668c7693a92

Contents?: true

Size: 992 Bytes

Versions: 11

Compression:

Stored size: 992 Bytes

Contents

require 'rails/generators'
require 'rails/generators/migration'

module ExceptionNotificationServer
  module Generators
    class InstallGenerator < Rails::Generators::Base
      include Rails::Generators::Migration

      desc 'Generates migration for Notifications'
      def copy_initializer
        template 'exception_notification_server.rb', 'config/initializers/exception_notification_server.rb'
      end

      def mount_engine
        route 'mount ExceptionNotificationServer::Engine, at: \'/notifier\', as: \'notifier\''
      end

      def create_ckeditor_migration
        migration_template('migration.rb', File.join('db/migrate', 'create_exception_notification_server_notifications.rb'))
      end

      class << self
        def source_root
          @source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
        end

        def next_migration_number(_dirname)
          Time.now.strftime('%Y%m%d%H%M%S')
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
exception_notification_server-0.0.11 lib/generators/exception_notification_server/install_generator.rb
exception_notification_server-0.0.10 lib/generators/exception_notification_server/install_generator.rb
exception_notification_server-0.0.9 lib/generators/exception_notification_server/install_generator.rb
exception_notification_server-0.0.8 lib/generators/exception_notification_server/install_generator.rb
exception_notification_server-0.0.7 lib/generators/exception_notification_server/install_generator.rb
exception_notification_server-0.0.6 lib/generators/exception_notification_server/install_generator.rb
exception_notification_server-0.0.5 lib/generators/exception_notification_server/install_generator.rb
exception_notification_server-0.0.4 lib/generators/exception_notification_server/install_generator.rb
exception_notification_server-0.0.3 lib/generators/exception_notification_server/install_generator.rb
exception_notification_server-0.0.2 lib/generators/exception_notification_server/install_generator.rb
exception_notification_server-0.0.1 lib/generators/exception_notification_server/install_generator.rb