Class: Whoop::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#installObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/generators/whoop/install_generator.rb', line 7

def install
  file_contents = <<~TEXT
    Whoop.setup do |config|
      config.logger = ActiveSupport::Logger.new("log/debug.log")
      # config.logger = ActiveSupport::Logger.new("log/\#{Rails.env}.log")
      # config.logger = ActiveSupport::Logger.new($stdout)
      # config.logger = nil # uses `puts`

      config.level = :debug # or :info, :warn, :error
      # config.level = :info
      # config.level = :warn
      # config.level = :error
    end
  TEXT

  create_file "config/initializers/whoop.rb", file_contents
end