Class: BugCourier::Generators::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#create_initializer_fileObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/generators/bug_courier/install_generator.rb', line 10

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

    BugCourier.configure do |config|
      # Required: GitHub personal access token with 'repo' scope
      config.access_token = ENV["BUG_COURIER_GITHUB_TOKEN"]

      # Required: GitHub repository in "owner/repo" format
      config.repo = ENV["BUG_COURIER_GITHUB_REPO"]

      # Labels to apply to created issues (default: ["bug", "bug_courier"])
      # config.labels = ["bug", "bug_courier"]

      # GitHub usernames to assign to created issues (default: [])
      # config.assignees = ["your-github-username"]

      # Enable/disable BugCourier (default: true)
      # config.enabled = Rails.env.production?

      # Deduplicate issues — adds comments to existing open issues instead
      # of creating new ones (default: true)
      # config.deduplicate = true

      # Maximum number of issues to create per hour (default: 10)
      # config.rate_limit = 10

      # Exception classes to ignore — these will not be reported (default: [])
      # config.ignore_exceptions = [
      #   ActiveRecord::RecordNotFound,
      #   ActionController::RoutingError,
      # ]

      # Optional callback — called after issue creation or commenting
      # config.callback = ->(action, issue) {
      #   Rails.logger.info("[BugCourier] \#{action}: \#{issue['html_url']}")
      # }
    end
  RUBY
end