Sha256: b2b0ef23935f9cfcc17c0c69f58abdff0fbe3dab028a92d5c52308eade642d3e

Contents?: true

Size: 578 Bytes

Versions: 3

Compression:

Stored size: 578 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.13.0 lib/uniform_notifier/terminal_notifier.rb
uniform_notifier-1.12.1 lib/uniform_notifier/terminal_notifier.rb
uniform_notifier-1.12.0 lib/uniform_notifier/terminal_notifier.rb