Class: BusinessTime::Generators::ConfigGenerator

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

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.gem_rootObject



5
6
7
# File 'lib/generators/business_time/config_generator.rb', line 5

def self.gem_root
  File.expand_path("../../../..", __FILE__)
end

.source_rootObject



9
10
11
12
# File 'lib/generators/business_time/config_generator.rb', line 9

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

Instance Method Details

#generateObject



14
15
16
17
# File 'lib/generators/business_time/config_generator.rb', line 14

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