Sha256: f2801aa91dcde3e0257b05985808c7d9f94087c29110022640a990620f1e0cc6

Contents?: true

Size: 739 Bytes

Versions: 2

Compression:

Stored size: 739 Bytes

Contents

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

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

      def self.next_migration_number(path)
        ActiveRecord::Generators::Base.next_migration_number(path)
      end

      desc "Installs crono and generates the necessary configuration files"
      source_root File.expand_path("../templates", __FILE__)

      def copy_config
        template 'cronotab.rb.erb', 'config/cronotab.rb'
      end

      def create_migrations
        migration_template 'migrations/create_crono_jobs.rb', 'db/migrate/create_crono_jobs.rb'
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
crono-0.7.0 lib/generators/crono/install/install_generator.rb
crono-0.6.1 lib/generators/crono/install/install_generator.rb