Sha256: 01d850fe0010bcad929ddff38229ba9b0ed9f6e2b41ed9fcec49b45ad9b1fee3

Contents?: true

Size: 828 Bytes

Versions: 7

Compression:

Stored size: 828 Bytes

Contents

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

module MiniScheduler
  module Generators
    class InstallGenerator < ::Rails::Generators::Base
      include Rails::Generators::Migration
      source_root File.expand_path('../templates', __FILE__)
      desc "Generate files for MiniScheduler"

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

      def copy_migrations
        migration_template("create_mini_scheduler_stats.rb", "db/migrate/create_mini_scheduler_stats.rb")
      end

      def copy_initializer_file
        copy_file "mini_scheduler_initializer.rb", "config/initializers/mini_scheduler.rb"
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mini_scheduler-0.10.0 lib/generators/mini_scheduler/install/install_generator.rb
mini_scheduler-0.9.2 lib/generators/mini_scheduler/install/install_generator.rb
mini_scheduler-0.9.1 lib/generators/mini_scheduler/install/install_generator.rb
mini_scheduler-0.9.0 lib/generators/mini_scheduler/install/install_generator.rb
mini_scheduler-0.8.3 lib/generators/mini_scheduler/install/install_generator.rb
mini_scheduler-0.8.2 lib/generators/mini_scheduler/install/install_generator.rb
mini_scheduler-0.8.1 lib/generators/mini_scheduler/install/install_generator.rb