Files

Guard::Notifier::TerminalTitle

Shows system notifications in the terminal title bar.

Public Class Methods

turn_off() click to toggle source

Clears the terminal title

# File lib/guard/notifiers/terminal_title.rb, line 28
def self.turn_off
  puts "\e]2;\a"
end

Public Instance Methods

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/guard/notifiers/terminal_title.rb, line 18
def notify(message, opts = {})
  super

  first_line = message.sub(/^\n/, '').sub(/\n.*/, '')

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

[Validate]

Generated with the Darkfish Rdoc Generator 2.