notifaction 0.3.0 → 0.3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/notifaction.rb +0 -2
- data/lib/notifaction/notify.rb +3 -3
- data/lib/notifaction/type.rb +9 -1
- data/lib/notifaction/types/terminal.rb +3 -3
- data/lib/notifaction/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77df94c1102f5000ccf7ed328b995f6b00959421
|
4
|
+
data.tar.gz: d4cafdd7d6cd7282e158c6e5759bc7e605e70699
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 595feaf6b98cea3fb016df821b678800db211e5b69b7b1995ea724a8bacb0018549d17810c7a36c82c735e0691242f9ccfa6b6fc61b295cbec8ecc0f72558c72
|
7
|
+
data.tar.gz: a47f2a2474241f442f88193b34ac53c9f3fa269a26379b32493b4e2a20bdc98e319c2a1ad4ebc8ecfe3f198a0b1354fb4c3b4d11296ad91be179e4fb21314193
|
data/lib/notifaction.rb
CHANGED
data/lib/notifaction/notify.rb
CHANGED
@@ -26,7 +26,7 @@ class Notify
|
|
26
26
|
def self.error(message, config = {})
|
27
27
|
handler = Notifaction::Type::Terminal.new
|
28
28
|
handler.error(message, config)
|
29
|
-
handler.quit unless self.auto_quit_enabled(config)
|
29
|
+
handler.quit unless self.auto_quit_enabled(config, handler.user_conf)
|
30
30
|
end
|
31
31
|
|
32
32
|
# Prints a pre-formatted warning message to the console
|
@@ -104,7 +104,7 @@ class Notify
|
|
104
104
|
|
105
105
|
#
|
106
106
|
# @since 0.3.0
|
107
|
-
def self.auto_quit_enabled(config)
|
108
|
-
config[:auto_quit] == false ||
|
107
|
+
def self.auto_quit_enabled(config, user_conf)
|
108
|
+
config[:auto_quit] == false || user_conf.conf["auto_quit"] == false
|
109
109
|
end
|
110
110
|
end
|
data/lib/notifaction/type.rb
CHANGED
@@ -4,6 +4,14 @@ require "uri"
|
|
4
4
|
module Notifaction
|
5
5
|
module Type
|
6
6
|
class Base
|
7
|
+
attr_accessor :user_conf
|
8
|
+
|
9
|
+
#
|
10
|
+
# @since 0.3.0.1
|
11
|
+
def initialize
|
12
|
+
@user_conf = Notifaction::Cfg.new
|
13
|
+
end
|
14
|
+
|
7
15
|
#
|
8
16
|
# @since 0.2.8
|
9
17
|
def deprecation_notice(version)
|
@@ -19,7 +27,7 @@ module Notifaction
|
|
19
27
|
#
|
20
28
|
# @since 0.3.0
|
21
29
|
def fire_hooks(payload)
|
22
|
-
hooks =
|
30
|
+
hooks = @user_conf.hooks
|
23
31
|
|
24
32
|
return if hooks.nil?
|
25
33
|
|
@@ -82,15 +82,15 @@ module Notifaction
|
|
82
82
|
end
|
83
83
|
|
84
84
|
def show_symbol(config)
|
85
|
-
config[:symbol] || config[:fancy] ||
|
85
|
+
config[:symbol] || config[:fancy] || @user_conf.conf["fancy"] == true
|
86
86
|
end
|
87
87
|
|
88
88
|
def show_time(config)
|
89
|
-
config[:show_time] ||
|
89
|
+
config[:show_time] || @user_conf.conf["show_time"]
|
90
90
|
end
|
91
91
|
|
92
92
|
def show_message(config)
|
93
|
-
config[:print] == false ||
|
93
|
+
config[:print] == false || @user_conf.conf["print"] == false
|
94
94
|
end
|
95
95
|
end
|
96
96
|
end
|
data/lib/notifaction/version.rb
CHANGED