Class: Sequel::Generators::Base

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

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.base_nameObject



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

def self.base_name
  @_sequel_base_name ||= 'sequel'
end

.next_migration_number(dirname) ⇒ Object

Implement the required interface for Rails::Generators::Migration.



22
23
24
25
# File 'lib/generators/sequel.rb', line 22

def self.next_migration_number(dirname) #:nodoc:
  next_migration_number = current_migration_number(dirname) + 1
  [Time.now.utc.strftime('%Y%m%d%H%M%S'), format('%.14d', next_migration_number)].max
end

.source_rootObject



14
15
16
17
18
# File 'lib/generators/sequel.rb', line 14

def self.source_root
  @_sequel_source_root ||= File.expand_path(
    "../#{base_name}/#{generator_name}/templates", __FILE__
  )
end