Sha256: 056718f3d4f53419b27eb62036d39ece3d75948106cd2a2916c14e80bda711d5

Contents?: true

Size: 851 Bytes

Versions: 9

Compression:

Stored size: 851 Bytes

Contents

# frozen_string_literal: true

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

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

      source_root File.expand_path('../templates', __FILE__)

      def create_talkie_initializer
        copy_file 'talkie.rb', 'config/initializers/talkie.rb'
      end

      def self.next_migration_number(path)
        next_migration_number = current_migration_number(path) + 1
        ActiveRecord::Migration.next_migration_number(next_migration_number)
      end

      def create_talkie_migration
        migration_template "create_talkie_comments.rb", "db/migrate/create_talkie_comments.rb"
      end

      def add_engine_to_routes_file
        route "mount Talkie::Engine => '/talkie'"
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
talkie-0.5.1 lib/generators/talkie/install_generator.rb
talkie-0.5.0 lib/generators/talkie/install_generator.rb
talkie-0.4.1 lib/generators/talkie/install_generator.rb
talkie-0.4.0 lib/generators/talkie/install_generator.rb
talkie-0.3.5 lib/generators/talkie/install_generator.rb
talkie-0.3.4 lib/generators/talkie/install_generator.rb
talkie-0.3.3 lib/generators/talkie/install_generator.rb
talkie-0.3.2 lib/generators/talkie/install_generator.rb
talkie-0.3.1 lib/generators/talkie/install_generator.rb