Sha256: 003ea68df8359af93bf166b4d5c5eac0050049db3ede5a62ac73795a775336ba

Contents?: true

Size: 874 Bytes

Versions: 12

Compression:

Stored size: 874 Bytes

Contents

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

      desc 'Creates an EffectiveLearndash initializer in your application.'

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

      def self.next_migration_number(dirname)
        if not ActiveRecord::Base.timestamped_migrations
          Time.new.utc.strftime("%Y%m%d%H%M%S")
        else
          '%.3d' % (current_migration_number(dirname) + 1)
        end
      end

      def copy_initializer
        template ('../' * 3) + 'config/effective_learndash.rb', 'config/initializers/effective_learndash.rb'
      end

      def create_migration_file
        migration_template ('../' * 3) + 'db/migrate/01_create_effective_learndash.rb.erb', 'db/migrate/create_effective_learndash.rb'
      end

    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
effective_learndash-0.3.3 lib/generators/effective_learndash/install_generator.rb
effective_learndash-0.3.2 lib/generators/effective_learndash/install_generator.rb
effective_learndash-0.3.1 lib/generators/effective_learndash/install_generator.rb
effective_learndash-0.3.0 lib/generators/effective_learndash/install_generator.rb
effective_learndash-0.2.1 lib/generators/effective_learndash/install_generator.rb
effective_learndash-0.2.0 lib/generators/effective_learndash/install_generator.rb
effective_learndash-0.1.9 lib/generators/effective_learndash/install_generator.rb
effective_learndash-0.1.8 lib/generators/effective_learndash/install_generator.rb
effective_learndash-0.1.7 lib/generators/effective_learndash/install_generator.rb
effective_learndash-0.1.6 lib/generators/effective_learndash/install_generator.rb
effective_learndash-0.1.5 lib/generators/effective_learndash/install_generator.rb
effective_learndash-0.1.4 lib/generators/effective_learndash/install_generator.rb