debug_logger 0.0.3 → 0.0.4.1
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.
- checksums.yaml +4 -4
- data/lib/debug_logger.rb +12 -34
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 690e37e85ff91ea12767873db8c67b5a77a87e2ccf5ccfee871060408b022c40
|
4
|
+
data.tar.gz: f657b870ad5e1078c311aa585c0a8005013924353b6516220a7dc9b84a4a6b6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab670cb34fd6b1f604450cdbd273fc6cf7b6a0226388ef9c249be54ab5b3223551c140f0c94665d47a7892391744f56f3a8831cbc502ada5dab81c5d866c6ad1
|
7
|
+
data.tar.gz: ac844829eae9fc24fbfcf7f3b6ac2aa6e6c05dafe768986adfed16da1931b22d42cbd6bfd50e5d0118971fc8d2d677f93d8ee263686c3d5312128b032be90b2f
|
data/lib/debug_logger.rb
CHANGED
@@ -1,52 +1,26 @@
|
|
1
1
|
class DebugLogger
|
2
|
-
def self.log(color, text, variables = nil)
|
3
|
-
requires = Requires.new(color)
|
2
|
+
def self.log(color, text, variables = nil, space = nil)
|
3
|
+
requires = Requires.new(color, space)
|
4
4
|
if variables
|
5
|
-
puts "\e[#{requires.color_signification}m #{text}====================>#{variables}====================\e[0m"
|
5
|
+
puts "#{requires.space_signification} \e[#{requires.color_signification}m #{text}====================>#{variables}====================\e[0m #{requires.space_signification}"
|
6
6
|
else
|
7
|
-
puts "\e[#{requires.color_signification}m #{text}\e[0m"
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.log_space(color, text, variables = nil)
|
12
|
-
requires = Requires.new(color)
|
13
|
-
if variables
|
14
|
-
puts "
|
15
|
-
\n
|
16
|
-
\e[#{requires.color_signification}m #{text}====================>#{variables}====================\e[0m
|
17
|
-
\n
|
18
|
-
"
|
19
|
-
else
|
20
|
-
puts "
|
21
|
-
\n
|
22
|
-
\e[#{requires.color_signification}m #{text}\e[0m
|
23
|
-
\n
|
24
|
-
"
|
7
|
+
puts "#{requires.space_signification} \e[#{requires.color_signification}m #{text}\e[0m #{requires.space_signification}"
|
25
8
|
end
|
26
9
|
end
|
27
10
|
|
28
11
|
def self.color_lists
|
29
12
|
requires = Requires.new
|
30
|
-
puts requires.colors.join('
|
31
|
-
end
|
32
|
-
|
33
|
-
def self.commands
|
34
|
-
puts "
|
35
|
-
* DebugLogger::log(your_color, your_text, your_variable) \n
|
36
|
-
* @your_color = Symbol | color of your log (DebugLogger::color_lists for list all colors) => require \n
|
37
|
-
* @your_text = String | text of your log => require \n
|
38
|
-
* @your_variable = All | variables to debug => optionnal \n
|
39
|
-
* DebugLogger::log_space(your_color, your_text, your_variable) => log with space before and after \n
|
40
|
-
"
|
13
|
+
puts requires.colors.join(' - ')
|
41
14
|
end
|
42
15
|
end
|
43
16
|
|
44
17
|
class DebugLogger::Requires
|
45
18
|
|
46
|
-
attr_reader :color
|
19
|
+
attr_reader :color, :space
|
47
20
|
|
48
|
-
def initialize(color = nil)
|
21
|
+
def initialize(color = nil, space = nil)
|
49
22
|
@color = color
|
23
|
+
@space = space
|
50
24
|
end
|
51
25
|
|
52
26
|
def color_signification
|
@@ -80,6 +54,10 @@ class DebugLogger::Requires
|
|
80
54
|
end
|
81
55
|
end
|
82
56
|
|
57
|
+
def space_signification
|
58
|
+
space ? "\n\n" : nil
|
59
|
+
end
|
60
|
+
|
83
61
|
def colors
|
84
62
|
[:black, :red, :green, :orange, :blue, :pink, :cyan, :white, :normal, :bold, :italic, :underline]
|
85
63
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: debug_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Antonin Touron
|
@@ -10,8 +10,7 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2020-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: A simple gem to help debug
|
14
|
-
documentation.
|
13
|
+
description: A simple gem to help debug.
|
15
14
|
email: antonintouron@gmail.com
|
16
15
|
executables: []
|
17
16
|
extensions: []
|
@@ -21,7 +20,8 @@ files:
|
|
21
20
|
homepage: https://rubygems.org/gems/debug_logger
|
22
21
|
licenses:
|
23
22
|
- MIT
|
24
|
-
metadata:
|
23
|
+
metadata:
|
24
|
+
source_code_uri: https://github.com/antonintouron/debug_logger
|
25
25
|
post_install_message:
|
26
26
|
rdoc_options: []
|
27
27
|
require_paths:
|