Class: TelebugsGenerator

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

Instance Method Summary collapse

Instance Method Details

#create_initializer_fileObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/generators/telebugs_generator.rb', line 4

def create_initializer_file
  create_file "config/initializers/telebugs.rb", <<~RUBY
    # frozen_string_literal: true

    # Telebugs error monitoring.
    #
    # Rails integration guide:
    # https://telebugs.com/docs/integrations/rails
    #
    # Telebugs library guide:
    # https://telebugs.com/docs/integrations/ruby

    Telebugs.configure do |config|
      config.api_key = ENV["TELEBUGS_API_KEY"] || Rails.application.credentials.telebugs_api_key
    end
  RUBY
end