Class: Raygun::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#create_configuration_fileObject



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

def create_configuration_file
  filter_parameters = if defined?(Rails)
                        "config.filter_parameters = Rails.application.config.filter_parameters"
                      else
                        "config.filter_parameters = [ :password, :card_number, :cvv ] # don't forget to filter out sensitive parameters"
                      end
  initializer "raygun.rb" do
    <<-EOS
Raygun.setup do |config|
  config.api_key = "#{api_key}"
  #{filter_parameters}

  # The default is Rails.env.production?
  # config.enable_reporting = !Rails.env.development? && !Rails.env.test?
end
EOS
  end
end