Class: Roleplayer::Generators::Base

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/roleplayer.rb

Overview

:nodoc:

Direct Known Subclasses

MigrationGenerator

Class Method Summary collapse

Class Method Details

.next_migration_number(dirname) ⇒ Object

Required interface for Rails::Generators::Migration



15
16
17
18
19
20
21
# File 'lib/generators/roleplayer.rb', line 15

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

.source_rootObject



10
11
12
# File 'lib/generators/roleplayer.rb', line 10

def self.source_root
  @_roleplayer_source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'roleplayer', generator_name, 'templates'))
end