extra_print 2.1.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/extra_print.rb +16 -13
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: adbf386d2dfa9903c26eae3c7e38bd6fbb4c741d17b04bd330711e7ba1be6661
|
4
|
+
data.tar.gz: 7cd482d6bdaad59efacacf7fa4e2e2adda5d8c28a3b4e4a115844cf706f3bfc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9113e14108294da5bfeebb56cac2a3811114a7e79099e2662fd808687385353bdbc8e66ec502555d3a5384895200511b8b8553fe54dbfbce333715176656667f
|
7
|
+
data.tar.gz: e89ae3160cf57bc03668386fe6dcda1a022faa05a2d307e56165b19735cdc0194bdcdc7ebd04d597426c2ebae78c6eb74e6ee8bdca29d8f15e3b7af31ec70947
|
data/lib/extra_print.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
$COLORS = {'red' => '031','green' => '032','yellow' => '033','blue' => '
|
1
|
+
$COLORS = {'red' => '031','green' => '032','yellow' => '033','blue' => '094','magenta' => '035','cyan' => '036', 'gray' => '037', 'light_red' => '091', 'light_green' => '092', 'light_magenta' => '095', 'light_cyan' => '096'}
|
2
2
|
$EMOJIS = %w"😎 😈 👹 👺 👻 👿 💀 👽 😂 🤣 🎃 🐶 🦊 ⭐ 🌟 🏈 🏀 ⚽ ⛔ ♻️ ❓ 💽 🎁 🌠 🥓 🥑 🥦 🍤 🍗 🍖 🍕 🍰 🥃 💰 🍦 🍭 🤯 🤬 🐞 💛 💚 💙 💜"
|
3
3
|
|
4
4
|
#### DEBUGGING gems ####
|
@@ -53,23 +53,26 @@ def extra_print(variable = nil, msg = nil, add_amazing_print = false)
|
|
53
53
|
# Set variables
|
54
54
|
@msg = msg
|
55
55
|
@variable = variable
|
56
|
+
set_colors
|
57
|
+
# Build upper, center, lower sections
|
58
|
+
display_detail_bar(true)
|
59
|
+
display_variable(add_amazing_print)
|
60
|
+
@msg ? display_msg_footer : display_detail_bar(false)
|
61
|
+
end
|
56
62
|
|
63
|
+
def set_colors
|
57
64
|
# No red/green if calling from a spec
|
65
|
+
@secondary_color = '092'
|
58
66
|
if $0.split('.').last[/spec|test/]
|
59
67
|
$COLORS.delete('red')
|
68
|
+
$COLORS.delete('light_red')
|
69
|
+
$COLORS.delete('light_green')
|
60
70
|
$COLORS.delete('green')
|
61
|
-
@color = $COLORS.values.sample
|
62
|
-
@secondary_color = '034'
|
63
|
-
else
|
64
|
-
@color = $COLORS.values.sample
|
65
|
-
# If the color being passed in is RED set secondary color to BLUE
|
66
|
-
@secondary_color = @color == '031' ? '034' : '031'
|
67
71
|
end
|
68
|
-
|
69
|
-
#
|
70
|
-
|
71
|
-
|
72
|
-
@msg ? display_msg_footer : display_detail_bar(false)
|
72
|
+
@color = $COLORS.values.sample
|
73
|
+
# If primary color passed is GREEN set secondary color to RED
|
74
|
+
@secondary_color = '031' if @color == '092'
|
75
|
+
@secondary_color = '031' if @color == '032'
|
73
76
|
end
|
74
77
|
|
75
78
|
# Checks to see if running in a Ruby file
|
@@ -143,7 +146,7 @@ def display_detail_bar(top_bar = true)
|
|
143
146
|
str += "\033[#{@color}m#{arrow} \033[m" * 5
|
144
147
|
|
145
148
|
# Output completed string
|
146
|
-
puts
|
149
|
+
puts if top_bar # add single line of top padding to eap output
|
147
150
|
puts str
|
148
151
|
|
149
152
|
# Set @length - non encoded string for use in footer
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: extra_print
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hunter T. Chapman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: amazing_print
|