boppers 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/gems.locked +1 -1
- data/lib/boppers.rb +3 -1
- data/lib/boppers/notifier/stdout.rb +11 -4
- data/lib/boppers/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: 880d01d1b5914389de768e5d00e7dbb90a7dbcb6
|
4
|
+
data.tar.gz: 9e527c42c1da3f026ce7a909fd26f433acd1fac9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf9c094bcd09bf83f20cf22c986bd49a7f506b83e6d3dc4a8bd25bdcda2c6628a90f58d3ccd53aa52c0596c11a6c9202ae439623015ba6850f5c56a701351b5e
|
7
|
+
data.tar.gz: c33b7003fef8a093dc555db43c31ae6675e8252e1a32a68b6e53a83e7dd169e67fb59f36b52877d20c1c5c4b9f254fcc431c2ec07237fe99c55510c07f6a3141
|
data/gems.locked
CHANGED
data/lib/boppers.rb
CHANGED
@@ -8,6 +8,8 @@ module Boppers
|
|
8
8
|
red: "\e[31m"
|
9
9
|
}.freeze
|
10
10
|
|
11
|
+
NO_COLOR = "\e[0m"
|
12
|
+
|
11
13
|
attr_reader :subscribe
|
12
14
|
|
13
15
|
def initialize(subscribe: nil)
|
@@ -15,12 +17,17 @@ module Boppers
|
|
15
17
|
end
|
16
18
|
|
17
19
|
def call(title, message, options)
|
18
|
-
color = COLORS.fetch(options[:color],
|
20
|
+
color = COLORS.fetch(options[:color], NO_COLOR)
|
21
|
+
message = message
|
22
|
+
.gsub(/^/m, " ")
|
23
|
+
.lines
|
24
|
+
.map {|line| "#{color}#{line}#{NO_COLOR}" }
|
25
|
+
.join
|
19
26
|
|
20
27
|
puts [
|
21
|
-
"#{color}## #{title}",
|
22
|
-
message
|
23
|
-
"\
|
28
|
+
"#{color}## #{title}#{NO_COLOR}",
|
29
|
+
message,
|
30
|
+
"\n"
|
24
31
|
].join("\n")
|
25
32
|
end
|
26
33
|
end
|
data/lib/boppers/version.rb
CHANGED