Sha256: 7f2ff3cf1fa3260cdc86a0f649503fb8f31c5789be273256ac122af43c2948cd

Contents?: true

Size: 594 Bytes

Versions: 3

Compression:

Stored size: 594 Bytes

Contents

# frozen_string_literal: true

class UniformNotifier
  class TerminalNotifier < Base
    def self.active?
      !!UniformNotifier.terminal_notifier
    end

    protected

    def self._out_of_channel_notify(data)
      unless defined?(::TerminalNotifier)
        begin
          require 'terminal-notifier'
        rescue LoadError
          raise NotificationError,
                'You must install the terminal-notifier gem to use terminal_notifier: `gem install terminal-notifier`'
        end
      end

      ::TerminalNotifier.notify(data[:body], title: data[:title])
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
uniform_notifier-1.14.0 lib/uniform_notifier/terminal_notifier.rb
uniform_notifier-1.13.2 lib/uniform_notifier/terminal_notifier.rb
uniform_notifier-1.13.1 lib/uniform_notifier/terminal_notifier.rb