Class: NodeConfigGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- NodeConfigGenerator
- Defined in:
- lib/generators/node_config_generator.rb
Instance Method Summary collapse
- #create_configuration ⇒ Object
- #create_rakefile ⇒ Object
- #generate_initializer ⇒ Object
- #generate_loader ⇒ Object
Instance Method Details
#create_configuration ⇒ Object
25 26 27 |
# File 'lib/generators/node_config_generator.rb', line 25 def create_configuration create_file("config/node_config.yml") end |
#create_rakefile ⇒ Object
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_initializer ⇒ Object
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_loader ⇒ Object
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 |