extra_print 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/extra_print.rb +16 -13
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab2a835222a0008de12e9ea6bcc2c9102789e67468b9562b67110c577dbb69bc
4
- data.tar.gz: 8a508b8d044cf3fb8c6eafb7c2a1b309dbf0a95a4804b3af9ab8f0fab5ee2794
3
+ metadata.gz: adbf386d2dfa9903c26eae3c7e38bd6fbb4c741d17b04bd330711e7ba1be6661
4
+ data.tar.gz: 7cd482d6bdaad59efacacf7fa4e2e2adda5d8c28a3b4e4a115844cf706f3bfc8
5
5
  SHA512:
6
- metadata.gz: 1c1d08125dcf03a993a339925a5ef6987230c4f13ce92214e372c0c2a1f00ad828c5d5a107d487ac16febd57532b2cff44316ee766c96c4bf359647eb1c219d7
7
- data.tar.gz: 856c29c79fe87cd9e5d94a9f9d7d8e16b62f2c6414237ba65cb9dde140ed4c184fb86dcbc54f15e51fdf472c3c6f67adb65b59450bb11892355a23dfea448add
6
+ metadata.gz: 9113e14108294da5bfeebb56cac2a3811114a7e79099e2662fd808687385353bdbc8e66ec502555d3a5384895200511b8b8553fe54dbfbce333715176656667f
7
+ data.tar.gz: e89ae3160cf57bc03668386fe6dcda1a022faa05a2d307e56165b19735cdc0194bdcdc7ebd04d597426c2ebae78c6eb74e6ee8bdca29d8f15e3b7af31ec70947
@@ -1,4 +1,4 @@
1
- $COLORS = {'red' => '031','green' => '032','yellow' => '033','blue' => '034','magenta' => '035','cyan' => '036'}
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
- # View Methods
70
- display_detail_bar(true)
71
- display_variable(add_amazing_print)
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.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-01 00:00:00.000000000 Z
11
+ date: 2020-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: amazing_print