Class: SymmetricEncryption::Generators::ConfigGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/rails/generators/symmetric_encryption/config/config_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject


8
9
10
# File 'lib/rails/generators/symmetric_encryption/config/config_generator.rb', line 8

def self.source_root
  @_symmetric_encryption_source_root ||= File.expand_path("../templates", __FILE__)
end

Instance Method Details

#app_nameObject


12
13
14
# File 'lib/rails/generators/symmetric_encryption/config/config_generator.rb', line 12

def app_name
  Rails::Application.subclasses.first.parent.to_s.underscore
end

#create_config_fileObject


16
17
18
# File 'lib/rails/generators/symmetric_encryption/config/config_generator.rb', line 16

def create_config_file
  template 'symmetric-encryption.yml', File.join('config', "symmetric-encryption.yml")
end