Sha256: 1a98c60737ce8f84b700dd32a32bef40b97fcfb60dd321260f5bf937f15fb30e

Contents?: true

Size: 860 Bytes

Versions: 31

Compression:

Stored size: 860 Bytes

Contents

module Raygun
  class InstallGenerator < Rails::Generators::Base

    argument :api_key

    desc "This generator creates a configuration file for the Raygun ruby adapter inside config/initializers"
    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
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
raygun4ruby-4.0.2 lib/generators/raygun/install_generator.rb
raygun4ruby-4.0.1 lib/generators/raygun/install_generator.rb
raygun4ruby-4.0.0.pre lib/generators/raygun/install_generator.rb
raygun4ruby-3.2.3 lib/generators/raygun/install_generator.rb
raygun4ruby-3.2.3.pre lib/generators/raygun/install_generator.rb
raygun4ruby-3.2.1 lib/generators/raygun/install_generator.rb
raygun4ruby-3.2.0 lib/generators/raygun/install_generator.rb
raygun4ruby-3.1.1 lib/generators/raygun/install_generator.rb
raygun4ruby-3.1.0 lib/generators/raygun/install_generator.rb
raygun4ruby-3.0.0 lib/generators/raygun/install_generator.rb
raygun4ruby-2.7.1 lib/generators/raygun/install_generator.rb
raygun4ruby-2.7.0 lib/generators/raygun/install_generator.rb
raygun4ruby-2.6.0 lib/generators/raygun/install_generator.rb
raygun4ruby-2.5.0 lib/generators/raygun/install_generator.rb
raygun4ruby-2.4.1 lib/generators/raygun/install_generator.rb
raygun4ruby-2.4.0 lib/generators/raygun/install_generator.rb
raygun4ruby-2.3.0 lib/generators/raygun/install_generator.rb
raygun4ruby-2.2.0 lib/generators/raygun/install_generator.rb
raygun4ruby-2.1.0 lib/generators/raygun/install_generator.rb
raygun4ruby-2.0.0 lib/generators/raygun/install_generator.rb