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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/debug_logger.rb +12 -34
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36ef1c073cb55866161c4074ed2387376bf8f5c6585adb9b14005d8433ba441c
4
- data.tar.gz: 11bf475e017f2c437787a52ad110ed9afd9e08827a601766f35fdd971347e656
3
+ metadata.gz: 690e37e85ff91ea12767873db8c67b5a77a87e2ccf5ccfee871060408b022c40
4
+ data.tar.gz: f657b870ad5e1078c311aa585c0a8005013924353b6516220a7dc9b84a4a6b6f
5
5
  SHA512:
6
- metadata.gz: 63311e8b36c1461298e62cd0dd392ab142ba2d958e107e36b88f0591d9cf9a45d4adbe992b24dbf69d5260dbc7e42bacab5b1a08a727cd21d5d9feb9d8397ee6
7
- data.tar.gz: d0dbcdccb07bb19647fae18a3bbe05ae622c983d458d31ac662545948eecb8c4a25cc070b0353a94b78e9a07f59ece4fab1702c2180c041d2a7ba75e39064e1b
6
+ metadata.gz: ab670cb34fd6b1f604450cdbd273fc6cf7b6a0226388ef9c249be54ab5b3223551c140f0c94665d47a7892391744f56f3a8831cbc502ada5dab81c5d866c6ad1
7
+ data.tar.gz: ac844829eae9fc24fbfcf7f3b6ac2aa6e6c05dafe768986adfed16da1931b22d42cbd6bfd50e5d0118971fc8d2d677f93d8ee263686c3d5312128b032be90b2f
@@ -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.3
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 with log. DebugLogger::commands to see the
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: