Class: Notify

Inherits:
Object
  • Object
show all
Extended by:
Notifaction::Helpers
Defined in:
lib/notifaction/notify.rb

Class Method Summary collapse

Methods included from Notifaction::Helpers

auto_quit_enabled?, deprecation_notice

Class Method Details

.bubble(message, title) ⇒ Object

Display a notification bubble

Since:

  • 0.1.0



6
7
8
9
10
11
12
13
14
15
# File 'lib/notifaction/notify.rb', line 6

def self.bubble(message, title)
  if Notifaction::Utils.os == :macosx
    handler = Notifaction::Type::OSX.new
  else
    handler = Notifaction::Type::Linux.new
  end

  handler.bubble(message, title)
  handler.quit_ok
end

.error(message, config = {}) ⇒ Object

Prints a pre-formatted error message to the console

Since:

  • 0.1.0



32
33
34
35
36
# File 'lib/notifaction/notify.rb', line 32

def self.error(message, config = {})
  handler = Notifaction::Type::Terminal.new
  handler.error(message, config)
  handler.quit unless auto_quit_enabled?(config, handler.user_conf)
end

.info(message, config = {}) ⇒ Object

Prints a pre-formatted informational message to the console

Since:

  • 0.1.0



47
48
49
50
# File 'lib/notifaction/notify.rb', line 47

def self.info(message, config = {})
  handler = Notifaction::Type::Terminal.new
  handler.info(message, config)
end

Display a modal popup with a close button

Since:

  • 0.1.0



19
20
21
22
23
24
25
26
27
28
# File 'lib/notifaction/notify.rb', line 19

def self.modal(message, title)
  if Notifaction::Utils.os == :macosx
    handler = Notifaction::Type::OSX.new
  else
    handler = Notifaction::Type::Linux.new
  end

  handler.modal(message, title)
  handler.quit_ok
end

.note(message, config = {}) ⇒ Object

Prints a pre-formatted secondary informational message to the console

Since:

  • 0.2.0



54
55
56
57
# File 'lib/notifaction/notify.rb', line 54

def self.note(message, config = {})
  handler = Notifaction::Type::Terminal.new
  handler.note(message, config)
end

.spacer(config = {}) ⇒ Object

pretty-print a spacer

Since:

  • 0.1.0



75
76
77
78
# File 'lib/notifaction/notify.rb', line 75

def self.spacer(config = {})
  handler = Notifaction::Type::Terminal.new
  handler.spacer(config)
end

.spit(message, config = {}) ⇒ Object

Prints a pre-formatted unstyled message to the console

Since:

  • 0.1.0



68
69
70
71
# File 'lib/notifaction/notify.rb', line 68

def self.spit(message, config = {})
  handler = Notifaction::Type::Terminal.new
  handler.spit(message, config)
end

.success(message, config = {}) ⇒ Object

Prints a pre-formatted success message to the console

Since:

  • 0.1.0



61
62
63
64
# File 'lib/notifaction/notify.rb', line 61

def self.success(message, config = {})
  handler = Notifaction::Type::Terminal.new
  handler.success(message, config)
end

.warning(message, config = {}) ⇒ Object

Prints a pre-formatted warning message to the console

Since:

  • 0.1.0



40
41
42
43
# File 'lib/notifaction/notify.rb', line 40

def self.warning(message, config = {})
  handler = Notifaction::Type::Terminal.new
  handler.warning(message, config)
end