Sha256: dd5535c72a08ef603d6c361dfc81467c18de29401690b1c48392bb3b765f9c86

Contents?: true

Size: 542 Bytes

Versions: 1

Compression:

Stored size: 542 Bytes

Contents

class Subexec
  module Notifications
    module Extensions

      extend ActiveSupport::Concern

      included do
        alias_method_chain :run!, :notifications
      end

      def run_with_notifications!
        ActiveSupport::Notifications.instrument "subexec.run", notification_payload do
          run_without_notifications!
        end
      end

      private

      def notification_payload
        { sub: self, hostname: Socket.gethostname }
      end

    end
  end
end

Subexec.send :include, Subexec::Notifications::Extensions

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
subexec-notifications-1.0.0 lib/subexec/notifications/extensions.rb