Sha256: 5097e5a3788010bb46a8f9e3b15a031ab4078dfd32fe2c420d6297ee253f7005

Contents?: true

Size: 813 Bytes

Versions: 1

Compression:

Stored size: 813 Bytes

Contents

module MicMonitorGem
  module Generators
    class InstallGenerator < Rails::Generators::Base
      source_root File.expand_path('templates', __dir__)

      GEM_PATH = "#{Rails.root}/config/initializers/mic_monitor_gem.rb"

      def create_file_mic_monitor_gem
        template 'mic_monitor_gem.rb', GEM_PATH
      end

      def add_config_email
        append_to_file GEM_PATH do
          <<-'RUBY'
if Rails.env.production?
  Rails.application.config.middleware.use ExceptionNotification::Rack,
  email: {
    deliver_with: :deliver, # Rails >= 4.2.1 do not need this option since it defaults to :deliver_now
    email_prefix: ENV['EMAIL_PREFIX'],
    sender_address: ENV['SENDER_ADDRESS'],
    exception_recipients: ENV['EXCEPTION_RECINPIENTS']
  }
end
          RUBY
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mic_monitor_gem-0.3.5 lib/generators/mic_monitor_gem/install_generator.rb