Class: NodeConfigGenerator

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

Instance Method Summary collapse

Instance Method Details

#create_configurationObject



25
26
27
# File 'lib/generators/node_config_generator.rb', line 25

def create_configuration
  create_file("config/node_config.yml")
end

#create_rakefileObject



17
18
19
20
21
22
23
# File 'lib/generators/node_config_generator.rb', line 17

def create_rakefile
  rakefile("node_config.rake") do
    %Q{task :node_config do
load File.expand_path("../../../config/node_config.rb", __FILE__)
end}
  end
end

#generate_initializerObject



7
8
9
10
# File 'lib/generators/node_config_generator.rb', line 7

def generate_initializer
  @both_app_modules = Rails.application.class.name
  template("config/initializers/node_config.rb.erb", "config/initializers/node_config.rb")
end

#generate_loaderObject



12
13
14
15
# File 'lib/generators/node_config_generator.rb', line 12

def generate_loader
  @top_level_app_module = Rails.application.class.name.split("::").first
  template("config/node_config.rb.erb", "config/node_config.rb")
end