console 1.14.0 → 1.15.0

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: 43a78b129f0b1f778d063513a3726aaa832390761f3987fb3b1b77286f51af1a
4
- data.tar.gz: b790c9b840bd37bfcbd6e7f98de70e45bf2d27d049c54b2f9763070edc318a2c
3
+ metadata.gz: c07a7e9199462f58af29e0245ec0bb1bc2320b2fb0ff0538159d8caf50708d71
4
+ data.tar.gz: 7622d420eabaff04e887074aba918a9e25155517641e730a92305eb44de5c911
5
5
  SHA512:
6
- metadata.gz: f58e0e37313d0388c439c80a06e3583f57fa96271be8bd1f1e28e3f4a973ba46618143629af6474bc812b8395c51ace42af4de6a5dcc92f281eba9ce1d66d40a
7
- data.tar.gz: b472be4850adac00472c1abfcadf3f65fc3d1ad4c180d51eb7ef15cf71831757cc411f393b40ca5b71155d9881bb83a445b3fca1ab481e2a2ae93ada1da62158
6
+ metadata.gz: 228f356dfefffa20db989562126ce4d8e2b78584f6c62f1a8750edb8f336b1ea507975cd8963dd895215253b2c1a9bcd765e1f423ae10108219c77922b7e9344
7
+ data.tar.gz: 75b761c38aeda80f76778bf1aa9fc3853f6dda8754066f52f9badd1a56373adfb0d4c56483cda69ffc70f97fa64c4ba2efa8c1334903c6398d136989481d5318
checksums.yaml.gz.sig CHANGED
Binary file
@@ -0,0 +1,85 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright, 2021, by Samuel G. D. Williams. <http://www.codeotaku.com>
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in
13
+ # all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ # THE SOFTWARE.
22
+
23
+ require 'logger'
24
+
25
+ module Console
26
+ module Compatible
27
+ class Logger < ::Logger
28
+ class LogDevice
29
+ def initialize(subject, output)
30
+ @subject = subject
31
+ @output = output
32
+ end
33
+
34
+ def write(message)
35
+ @output.call(@subject, message)
36
+ end
37
+
38
+ def call(*arguments, **options)
39
+ @output.call(*arguments, **options)
40
+ end
41
+
42
+ def reopen
43
+ end
44
+
45
+ def close
46
+ end
47
+ end
48
+
49
+ def initialize(subject, output)
50
+ super(nil)
51
+
52
+ @progname = subject
53
+ @logdev = LogDevice.new(@subject, output)
54
+ end
55
+
56
+ def add(severity, message = nil, progname = nil)
57
+ severity ||= UNKNOWN
58
+
59
+ if @logdev.nil? or severity < level
60
+ return true
61
+ end
62
+
63
+ if progname.nil?
64
+ progname = @progname
65
+ end
66
+
67
+ if message.nil?
68
+ if block_given?
69
+ message = yield
70
+ else
71
+ message = progname
72
+ progname = @progname
73
+ end
74
+ end
75
+
76
+ @logdev.call(
77
+ progname, message,
78
+ severity: format_severity(severity)
79
+ )
80
+
81
+ return true
82
+ end
83
+ end
84
+ end
85
+ end
@@ -21,5 +21,5 @@
21
21
  # THE SOFTWARE.
22
22
 
23
23
  module Console
24
- VERSION = "1.14.0"
24
+ VERSION = "1.15.0"
25
25
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,10 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: console
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.0
4
+ version: 1.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
+ - Robert Schulze
9
+ - Bryan Powell
10
+ - Michael Adams
11
+ - Cyril Roelandt
12
+ - Cédric Boutillier
13
+ - Olle Jonsson
8
14
  autorequire:
9
15
  bindir: bin
10
16
  cert_chain:
@@ -36,7 +42,7 @@ cert_chain:
36
42
  RAOsIl+HOBTb252nx1kIRN5hqQx272AJCbCjKx8egcUQKffFVVCI0nye09v5CK+a
37
43
  HiLJ8VOFx6w=
38
44
  -----END CERTIFICATE-----
39
- date: 2021-11-19 00:00:00.000000000 Z
45
+ date: 2022-03-29 00:00:00.000000000 Z
40
46
  dependencies:
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: fiber-local
@@ -133,6 +139,7 @@ files:
133
139
  - lib/console/buffer.rb
134
140
  - lib/console/capture.rb
135
141
  - lib/console/clock.rb
142
+ - lib/console/compatible/logger.rb
136
143
  - lib/console/event.rb
137
144
  - lib/console/event/failure.rb
138
145
  - lib/console/event/generic.rb
@@ -177,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
184
  - !ruby/object:Gem::Version
178
185
  version: '0'
179
186
  requirements: []
180
- rubygems_version: 3.2.29
187
+ rubygems_version: 3.3.8
181
188
  signing_key:
182
189
  specification_version: 4
183
190
  summary: Beautiful logging for Ruby.
metadata.gz.sig CHANGED
Binary file