Class: GovkitGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/govkit/govkit_generator.rb

Overview

Generator to setup rails app for using GovKit

Instance Method Summary collapse

Constructor Details

#initialize(*runtime_args) ⇒ GovkitGenerator

Returns a new instance of GovkitGenerator.



6
7
8
# File 'lib/generators/govkit/govkit_generator.rb', line 6

def initialize(*runtime_args)
  super
end

Instance Method Details

#copy_initializer_fileObject

Copies the files necessary to use govkit (initializer, migrations, and models)



15
16
17
18
19
# File 'lib/generators/govkit/govkit_generator.rb', line 15

def copy_initializer_file
  copy_file 'govkit.rb', File.join('config', 'initializers', 'govkit.rb')
  copy_file 'mention.rb', File.join('app', 'models', 'mention.rb')
  copy_file 'create_mentions.rb', File.join('db', 'migrate', "#{ Time.now.utc.strftime "%Y%m%d%H%M%S" }create_mentions.rb")
end