Class: FuryDumper::Generators::ConfigGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.gem_rootObject



6
7
8
# File 'lib/generators/fury_dumper/config_generator.rb', line 6

def self.gem_root
  File.expand_path('../../..', __dir__)
end

.source_rootObject



10
11
12
13
# File 'lib/generators/fury_dumper/config_generator.rb', line 10

def self.source_root
  # Use the templates from the 2.3.x generator
  File.join(gem_root, 'rails_generators', 'fury_dumper_config', 'templates')
end

Instance Method Details

#generateObject



15
16
17
18
# File 'lib/generators/fury_dumper/config_generator.rb', line 15

def generate
  template 'fury_dumper.rb', File.join('config', 'initializers', 'fury_dumper.rb')
  template 'fury_dumper.yml', File.join('config', 'fury_dumper.yml')
end