class Notiffany::Notifier::TerminalTitle

Shows system notifications in the terminal title bar.

Constants

DEFAULTS

Public Instance Methods

turn_off() click to toggle source

Clears the terminal title

# File lib/notiffany/notifier/terminal_title.rb, line 11
def turn_off
  STDOUT.puts "\e]2;\a"
end

Private Instance Methods

_check_available(_options) click to toggle source
# File lib/notiffany/notifier/terminal_title.rb, line 21
def _check_available(_options)
end
_gem_name() click to toggle source
# File lib/notiffany/notifier/terminal_title.rb, line 17
def _gem_name
  nil
end
_perform_notify(message, opts = {}) click to toggle source

Shows a system notification.

@param [Hash] opts additional notification library options @option opts [String] message the notification message body @option opts [String] type the notification type. Either ‘success’,

'pending', 'failed' or 'notify'

@option opts [String] title the notification title

# File lib/notiffany/notifier/terminal_title.rb, line 32
def _perform_notify(message, opts = {})
  first_line = message.sub(/^\n/, "").sub(/\n.*/m, "")

  STDOUT.puts "\e]2;[#{opts[:title]}] #{first_line}\a"
end