Module: RbNotifu

Defined in:
lib/rb-notifu.rb,
lib/rb-notifu/version.rb

Constant Summary collapse

VERSION =
"0.0.1"

Class Method Summary collapse

Class Method Details

.escape(value) ⇒ Object



53
54
55
56
57
58
59
# File 'lib/rb-notifu.rb', line 53

def self.escape(value)
  if value
    return '"' + value.to_s.gsub('"','\"') + '"'
  else
    return ''
  end
end

.show(options = {}) ⇒ Object

:type The type of message to display values are:

info   The message is an informational message
warn   The message is an warning message
error  The message is an error message

:display The number of milliseconds to display (omit or 0 for infinit) :title The title (or prompt) of the ballon :message The message text :icon Specify an icon to use (“parent” uses the icon of the parent process) :baloon Enable ballon tips in the registry (for this user only) :nosound Do not play a sound when the tooltip is displayed :noquiet Show the tooltip even if the user is in the quiet period that follows his very first login (Windows 7 and up) :xp Use IUserNotification interface event when IUserNotification2 is available



42
43
44
45
46
47
48
49
50
51
# File 'lib/rb-notifu.rb', line 42

def self.show(options = {})
  flags = ""
  @option_default.each do |key, value|
    flag = options.key?(key) ? options[key] : value
    if flag
      flags += "/" + @option_to_flag[key] + " " + self.escape(flag) + " "
    end
  end
  system "#{@executable} #{flags}"
end