File: install_generator.rb

package info (click to toggle)
ruby-exception-notification 5.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 364 kB
  • sloc: ruby: 1,350; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 687 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

module ExceptionNotification
  module Generators
    class InstallGenerator < ::Rails::Generators::Base
      desc "Creates a ExceptionNotification initializer."

      source_root File.expand_path("templates", __dir__)
      class_option :resque,
        type: :boolean,
        desc: "Add support for sending notifications when errors occur in Resque jobs."
      class_option :sidekiq,
        type: :boolean,
        desc: "Add support for sending notifications when errors occur in Sidekiq jobs."

      def copy_initializer
        template "exception_notification.rb.erb", "config/initializers/exception_notification.rb"
      end
    end
  end
end