console 1.13.1 → 1.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +1 -0
- data/lib/console/buffer.rb +2 -0
- data/lib/console/capture.rb +2 -0
- data/lib/console/clock.rb +2 -0
- data/lib/console/event/failure.rb +2 -1
- data/lib/console/event/generic.rb +4 -2
- data/lib/console/event/measure.rb +2 -0
- data/lib/console/event/metric.rb +2 -0
- data/lib/console/event/progress.rb +2 -0
- data/lib/console/event/spawn.rb +11 -4
- data/lib/console/event.rb +2 -0
- data/lib/console/filter.rb +2 -0
- data/lib/console/logger.rb +2 -0
- data/lib/console/measure.rb +2 -0
- data/lib/console/output/default.rb +2 -0
- data/lib/console/output/json.rb +2 -0
- data/lib/console/output/sensitive.rb +2 -0
- data/lib/console/output/text.rb +2 -0
- data/lib/console/output/xterm.rb +2 -0
- data/lib/console/output.rb +2 -0
- data/lib/console/progress.rb +2 -0
- data/lib/console/resolver.rb +2 -0
- data/lib/console/serialized/logger.rb +44 -9
- data/lib/console/split.rb +1 -0
- data/lib/console/terminal/logger.rb +2 -0
- data/lib/console/terminal/text.rb +2 -0
- data/lib/console/terminal/xterm.rb +2 -0
- data/lib/console/terminal.rb +2 -0
- data/lib/console/version.rb +3 -1
- data/lib/console.rb +1 -0
- data.tar.gz.sig +0 -0
- metadata +32 -4
- metadata.gz.sig +1 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43a78b129f0b1f778d063513a3726aaa832390761f3987fb3b1b77286f51af1a
|
4
|
+
data.tar.gz: b790c9b840bd37bfcbd6e7f98de70e45bf2d27d049c54b2f9763070edc318a2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f58e0e37313d0388c439c80a06e3583f57fa96271be8bd1f1e28e3f4a973ba46618143629af6474bc812b8395c51ace42af4de6a5dcc92f281eba9ce1d66d40a
|
7
|
+
data.tar.gz: b472be4850adac00472c1abfcadf3f65fc3d1ad4c180d51eb7ef15cf71831757cc411f393b40ca5b71155d9881bb83a445b3fca1ab481e2a2ae93ada1da62158
|
checksums.yaml.gz.sig
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
���u��i��7k�'��È\��a�W�a�0��]:X<�Qw��J��ˈ�
|
data/lib/console/buffer.rb
CHANGED
data/lib/console/capture.rb
CHANGED
data/lib/console/clock.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Copyright, 2019, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
4
|
#
|
3
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
@@ -27,8 +29,8 @@ module Console
|
|
27
29
|
def to_h
|
28
30
|
end
|
29
31
|
|
30
|
-
def
|
31
|
-
to_h
|
32
|
+
def to_json(*arguments)
|
33
|
+
JSON.generate([self.class, to_h], *arguments)
|
32
34
|
end
|
33
35
|
|
34
36
|
def format(buffer, terminal)
|
data/lib/console/event/metric.rb
CHANGED
data/lib/console/event/spawn.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
4
|
#
|
3
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
@@ -26,13 +28,14 @@ module Console
|
|
26
28
|
def self.for(*arguments, **options)
|
27
29
|
# Extract out the command environment:
|
28
30
|
if arguments.first.is_a?(Hash)
|
29
|
-
|
31
|
+
environment = arguments.shift
|
32
|
+
self.new(environment, arguments, options)
|
30
33
|
else
|
31
|
-
self.new(nil, arguments,
|
34
|
+
self.new(nil, arguments, options)
|
32
35
|
end
|
33
36
|
end
|
34
37
|
|
35
|
-
def initialize(environment,
|
38
|
+
def initialize(environment, arguments, options)
|
36
39
|
@environment = environment
|
37
40
|
@arguments = arguments
|
38
41
|
@options = options
|
@@ -53,7 +56,11 @@ module Console
|
|
53
56
|
end
|
54
57
|
|
55
58
|
def to_h
|
56
|
-
|
59
|
+
Hash.new.tap do |hash|
|
60
|
+
hash[:environment] = @environment if @environment&.any?
|
61
|
+
hash[:arguments] = @arguments if @arguments&.any?
|
62
|
+
hash[:options] = @options if @options&.any?
|
63
|
+
end
|
57
64
|
end
|
58
65
|
|
59
66
|
def format(output, terminal, verbose)
|
data/lib/console/event.rb
CHANGED
data/lib/console/filter.rb
CHANGED
data/lib/console/logger.rb
CHANGED
data/lib/console/measure.rb
CHANGED
data/lib/console/output/json.rb
CHANGED
data/lib/console/output/text.rb
CHANGED
data/lib/console/output/xterm.rb
CHANGED
data/lib/console/output.rb
CHANGED
data/lib/console/progress.rb
CHANGED
data/lib/console/resolver.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
4
|
#
|
3
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
@@ -59,26 +61,59 @@ module Console
|
|
59
61
|
record[:subject] = subject
|
60
62
|
end
|
61
63
|
|
62
|
-
|
63
|
-
record[:arguments] = arguments
|
64
|
-
end
|
65
|
-
|
66
|
-
if options.any?
|
67
|
-
record[:options] = options
|
68
|
-
end
|
64
|
+
message = arguments
|
69
65
|
|
70
66
|
if block_given?
|
71
67
|
if block.arity.zero?
|
72
|
-
|
68
|
+
message << yield
|
73
69
|
else
|
74
70
|
buffer = StringIO.new
|
75
71
|
yield buffer
|
76
|
-
|
72
|
+
message << buffer.string
|
77
73
|
end
|
78
74
|
end
|
79
75
|
|
76
|
+
if message.size == 1
|
77
|
+
record[:message] = message.first
|
78
|
+
elsif message.any?
|
79
|
+
record[:message] = message
|
80
|
+
end
|
81
|
+
|
82
|
+
if exception = find_exception(message)
|
83
|
+
record[:error] = {
|
84
|
+
kind: exception.class,
|
85
|
+
message: exception.message,
|
86
|
+
stack: format_stack(exception)
|
87
|
+
}
|
88
|
+
end
|
89
|
+
|
90
|
+
record.update(options)
|
91
|
+
|
80
92
|
@io.puts(self.dump(record))
|
81
93
|
end
|
94
|
+
|
95
|
+
private
|
96
|
+
|
97
|
+
def find_exception(message)
|
98
|
+
message.find{|part| part.is_a?(Exception)}
|
99
|
+
end
|
100
|
+
|
101
|
+
def format_stack(exception)
|
102
|
+
buffer = StringIO.new
|
103
|
+
format_backtrace(exception, buffer)
|
104
|
+
return buffer.string
|
105
|
+
end
|
106
|
+
|
107
|
+
def format_backtrace(exception, buffer)
|
108
|
+
buffer.puts exception.backtrace
|
109
|
+
|
110
|
+
if exception = exception.cause
|
111
|
+
buffer.puts
|
112
|
+
buffer.puts "Caused by: #{exception.class} #{exception.message}"
|
113
|
+
|
114
|
+
format_backtrace(exception, buffer)
|
115
|
+
end
|
116
|
+
end
|
82
117
|
end
|
83
118
|
end
|
84
119
|
end
|
data/lib/console/split.rb
CHANGED
data/lib/console/terminal.rb
CHANGED
data/lib/console/version.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Copyright, 2019, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
4
|
#
|
3
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
@@ -19,5 +21,5 @@
|
|
19
21
|
# THE SOFTWARE.
|
20
22
|
|
21
23
|
module Console
|
22
|
-
VERSION = "1.
|
24
|
+
VERSION = "1.14.0"
|
23
25
|
end
|
data/lib/console.rb
CHANGED
data.tar.gz.sig
ADDED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,42 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: console
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams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HQYDVR0OBBYEFB6ZaeWKxQjGTI+pmz7cKRmMIywwMC4GA1UdEQQnMCWB
|
27
|
+
I3NhbXVlbC53aWxsaWFtc0BvcmlvbnRyYW5zZmVyLmNvLm56MC4GA1UdEgQnMCWB
|
28
|
+
I3NhbXVlbC53aWxsaWFtc0BvcmlvbnRyYW5zZmVyLmNvLm56MA0GCSqGSIb3DQEB
|
29
|
+
CwUAA4IBgQBVoM+pu3dpdUhZM1w051iw5GfiqclAr1Psypf16Tiod/ho//4oAu6T
|
30
|
+
9fj3DPX/acWV9P/FScvqo4Qgv6g4VWO5ZU7z2JmPoTXZtYMunRAmQPFL/gSUc6aK
|
31
|
+
vszMHIyhtyzRc6DnfW2AiVOjMBjaYv8xXZc9bduniRVPrLR4J7ozmGLh4o4uJp7w
|
32
|
+
x9KCFaR8Lvn/r0oJWJOqb/DMAYI83YeN2Dlt3jpwrsmsONrtC5S3gOUle5afSGos
|
33
|
+
bYt5ocnEpKSomR9ZtnCGljds/aeO1Xgpn2r9HHcjwnH346iNrnHmMlC7BtHUFPDg
|
34
|
+
Ts92S47PTOXzwPBDsrFiq3VLbRjHSwf8rpqybQBH9MfzxGGxTaETQYOd6b4e4Ag6
|
35
|
+
y92abGna0bmIEb4+Tx9rQ10Uijh1POzvr/VTH4bbIPy9FbKrRsIQ24qDbNJRtOpE
|
36
|
+
RAOsIl+HOBTb252nx1kIRN5hqQx272AJCbCjKx8egcUQKffFVVCI0nye09v5CK+a
|
37
|
+
HiLJ8VOFx6w=
|
38
|
+
-----END CERTIFICATE-----
|
39
|
+
date: 2021-11-19 00:00:00.000000000 Z
|
12
40
|
dependencies:
|
13
41
|
- !ruby/object:Gem::Dependency
|
14
42
|
name: fiber-local
|
@@ -149,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
177
|
- !ruby/object:Gem::Version
|
150
178
|
version: '0'
|
151
179
|
requirements: []
|
152
|
-
rubygems_version: 3.
|
180
|
+
rubygems_version: 3.2.29
|
153
181
|
signing_key:
|
154
182
|
specification_version: 4
|
155
183
|
summary: Beautiful logging for Ruby.
|
metadata.gz.sig
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
H�.��������Y��Ʒ�~m�:�M�.�̄��@hu|��֊���{�#�2#�
|