Class: Logging::Rails::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Logging::Rails::Generators::InstallGenerator
- Defined in:
- lib/logging/rails/generators/install_generator.rb
Instance Method Summary collapse
- #generate_config ⇒ Object
- #insert_log_to_destinations ⇒ Object
- #insert_show_log_configuration ⇒ Object
Instance Method Details
#generate_config ⇒ Object
7 8 9 |
# File 'lib/logging/rails/generators/install_generator.rb', line 7 def generate_config template 'logging.rb.erb', 'config/logging.rb' end |
#insert_log_to_destinations ⇒ Object
11 12 13 14 15 |
# File 'lib/logging/rails/generators/install_generator.rb', line 11 def insert_log_to_destinations comment = "\n # Set the logging destination(s)\n %s\n" insert_into_file 'config/environments/development.rb', comment % 'config.log_to = %w[stdout file]', :before => %r/^end\s*$/ insert_into_file 'config/environments/production.rb', comment % 'config.log_to = %w[file]', :before => %r/^end\s*$/ end |
#insert_show_log_configuration ⇒ Object
17 18 19 20 21 |
# File 'lib/logging/rails/generators/install_generator.rb', line 17 def insert_show_log_configuration comment = "\n # Show the logging configuration on STDOUT\n config.show_log_configuration = %s\n" insert_into_file 'config/environments/development.rb', comment % 'true', :before => %r/^end\s*$/ insert_into_file 'config/environments/production.rb', comment % 'false', :before => %r/^end\s*$/ end |