Class: Linner::Notifier

Inherits:
Object
  • Object
show all
Defined in:
lib/linner/notifier.rb

Class Method Summary collapse

Class Method Details

.error(message) ⇒ Object



19
20
21
22
# File 'lib/linner/notifier.rb', line 19

def error(message)
  self.notify(message)
  abort
end

.exitObject



24
25
26
# File 'lib/linner/notifier.rb', line 24

def exit
  puts "\ršŸµ : Let's take a break!"
end

.notify(message) ⇒ Object



12
13
14
15
16
17
# File 'lib/linner/notifier.rb', line 12

def notify(message)
  if Linner.env.notification && TerminalNotifier.available?
    TerminalNotifier.notify message, :title => "Linner"
  end
  puts "šŸ‘» : #{message}!"
end

.profileObject



6
7
8
9
10
# File 'lib/linner/notifier.rb', line 6

def profile
  time = Time.now
  yield
  puts "šŸœ : Done in #{"%.3f" % (Time.now - time)}s."
end