Class: GkdPushPod::UI
- Inherits:
-
Object
- Object
- GkdPushPod::UI
- Defined in:
- lib/gkd_push_pod/ui.rb
Class Method Summary collapse
- .err(msg) ⇒ Object
- .log_cmd(msg) ⇒ Object
- .msg(msg) ⇒ Object
- .notification(title: "", message: "", **args) ⇒ Object
- .notification_openurl(title: "", message: "", url: "", **args) ⇒ Object
- .success(msg) ⇒ Object
- .warning(msg) ⇒ Object
Class Method Details
.err(msg) ⇒ Object
6 7 8 9 |
# File 'lib/gkd_push_pod/ui.rb', line 6 def self.err(msg) puts msg.colorize(:red) self.notification(title: 'pod_updater get error', message: msg) end |
.log_cmd(msg) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/gkd_push_pod/ui.rb', line 23 def self.log_cmd(msg) if msg.kind_of?(Array) msg = msg.join(' && ') end puts msg.to_s.colorize(:blue) end |
.msg(msg) ⇒ Object
15 16 17 |
# File 'lib/gkd_push_pod/ui.rb', line 15 def self.msg(msg) puts msg.colorize(:green) end |
.notification(title: "", message: "", **args) ⇒ Object
30 31 32 |
# File 'lib/gkd_push_pod/ui.rb', line 30 def self.notification(title: "", message: "", **args) `terminal-notifier -title '#{title}' -message '#{}' -activate 'com.apple.Terminal'` end |
.notification_openurl(title: "", message: "", url: "", **args) ⇒ Object
34 35 36 |
# File 'lib/gkd_push_pod/ui.rb', line 34 def self.notification_openurl(title: "", message: "", url: "", **args) `terminal-notifier -title '#{title}' -message '#{}' -open '#{url}'` end |
.success(msg) ⇒ Object
11 12 13 |
# File 'lib/gkd_push_pod/ui.rb', line 11 def self.success(msg) puts msg.colorize(:green) end |
.warning(msg) ⇒ Object
19 20 21 |
# File 'lib/gkd_push_pod/ui.rb', line 19 def self.warning(msg) puts msg.colorize(:yellow) end |