carioca 2.0.5 → 2.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8c9296f0a424070e2bd252fe15432b820cfb6a3e9bd52f45e9fd2a0430d06174
4
- data.tar.gz: 5815c387bafb81c50cb19e659d5440ab8db1654e873be742eaac9857433ad7fd
3
+ metadata.gz: b3c7211d388cceebfe51916c4e7207568c89b4af76499a32cbacf374a16fc17d
4
+ data.tar.gz: d417e3fd8f90130ea0a05e2cb118842defa5dcba1a3c20338ecfde718099f963
5
5
  SHA512:
6
- metadata.gz: 34a33f5e613a1530930cf0e6e53f8c1179a66d8eda41a440766ffeaf6d9060c44efa945ed40af22679e6e7ac90e1c3537222cf82473caaa315561b241b47814a
7
- data.tar.gz: ab2fa5e329b95df2e04f87501ac8ab74a8450e16dbeff5cc61aa374455b4b7bc0c5c8365e198907fb2955e0c786fe3a8011292a33253545653e14ac3be1f9e5c
6
+ metadata.gz: b39f07e6fa2705f0e2537d19b07fe264f57119d9082d2a73c5f16b3da653c29c07598a1b154698728cc38783ec853221153880e72b355c71aeef68f8e78a6dc8
7
+ data.tar.gz: 2eef037d94f4dae0c218f9800c6d616a1d0fd39be6bb1d75d3d964f08377ffcfd2729e644a6ef9df47708b53f52831ee3c27851d0c0abe3e2dc2708cefe397b6
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.5
1
+ 2.0.7
@@ -21,7 +21,8 @@ module Carioca
21
21
  ok: :green,
22
22
  success: :green,
23
23
  debug: :magenta,
24
- flat: :white
24
+ flat: :white,
25
+ skipped: :grey
25
26
  }.freeze
26
27
 
27
28
  EMOJI = {
@@ -41,7 +42,8 @@ module Carioca
41
42
  ok: { value: "\u{1F44D}", alt: '[+]', text: '(OK)' },
42
43
  success: { value: "\u{1F4AA}", alt: '[+]', text: '(SUCCESS)' },
43
44
  debug: { value: "\u{1F41B}", alt: '[D]', text: '(DEBUG)' },
44
- flat: { value: '', alt: '' }
45
+ flat: { value: '', alt: '' },
46
+ skipped: { value: 'U{23E9}', alt: '[I]', text: '(SKIPPED)'}
45
47
  }.freeze
46
48
  LEVELS = %i[debug info warn error fatal unknown].freeze
47
49
  ALIAS = {
@@ -55,7 +57,8 @@ module Carioca
55
57
  sending: :info,
56
58
  calling: :info,
57
59
  receive: :info,
58
- success: :info
60
+ success: :info,
61
+ skipped: :info
59
62
 
60
63
  }.freeze
61
64
  end
@@ -69,15 +72,15 @@ module Carioca
69
72
  @@colors = COLORS.dup
70
73
  @@emoji = EMOJI.dup
71
74
 
72
- MODE = %i[mono dual].freeze
75
+ MODE = %i[mono dual log].freeze
73
76
 
74
77
  LEVELS.each do |method|
75
- define_method(method) do |message, session = '', source = 'Carioca->Output'|
78
+ define_method(method) do |message, session = nil, source = 'Carioca->Output'|
76
79
  display(level: method, message: message, session: session, source: source)
77
80
  end
78
81
  end
79
82
  @@alias.each_key do |method|
80
- define_method(method) do |message, session = '', source = 'Carioca->Output'|
83
+ define_method(method) do |message, session = nil, source = 'Carioca->Output'|
81
84
  display(level: method, message: message, session: session, source: source)
82
85
  end
83
86
  end
@@ -100,7 +103,7 @@ module Carioca
100
103
  raise 'Alias must be a Symbol' unless newalias.instance_of?(Symbol)
101
104
  raise "Bad Level : #{level}" unless LEVELS.include? level
102
105
 
103
- self.class.define_method(newalias) do |message, session = ''|
106
+ self.class.define_method(newalias) do |message, session = nil|
104
107
  display({ level: newalias, message: message, session: session })
105
108
  end
106
109
  end
@@ -160,7 +163,7 @@ module Carioca
160
163
  # @option params [String] :message text
161
164
  # @option params [String] :session an id/timestamp of session
162
165
  def display(level:, message:, session:, source:)
163
- message << "(#{session})" if session
166
+ message << " (#{session})" if session
164
167
  save = message.dup
165
168
  target_level = @@alias.keys.include?(level) ? @@alias[level] : level
166
169
  if @active_levels.include? target_level
@@ -178,7 +181,7 @@ module Carioca
178
181
  block = proc { save }
179
182
  @logger.send target_level, source, &block
180
183
  end
181
- puts message
184
+ puts message if @mode == :mono or @mode == :dual
182
185
  end
183
186
  end
184
187
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carioca
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Romain GEORGES
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-26 00:00:00.000000000 Z
11
+ date: 2022-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deep_merge
@@ -252,7 +252,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
252
252
  - !ruby/object:Gem::Version
253
253
  version: '0'
254
254
  requirements: []
255
- rubygems_version: 3.3.5
255
+ rubygems_version: 3.1.2
256
256
  signing_key:
257
257
  specification_version: 4
258
258
  summary: 'Carioca : Container And Registry with Inversion Of Control for your Applications'