console 1.19.0 → 1.29.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/bake/console.rb +3 -3
  4. data/lib/console/adapter.rb +2 -1
  5. data/lib/console/capture.rb +46 -17
  6. data/lib/console/compatible/logger.rb +4 -3
  7. data/lib/console/event/failure.rb +43 -39
  8. data/lib/console/event/generic.rb +9 -6
  9. data/lib/console/event/spawn.rb +35 -27
  10. data/lib/console/event.rb +3 -4
  11. data/lib/console/filter.rb +24 -10
  12. data/lib/console/format/safe.rb +136 -0
  13. data/lib/console/format.rb +14 -0
  14. data/lib/console/interface.rb +53 -0
  15. data/lib/console/logger.rb +17 -16
  16. data/lib/console/output/default.rb +8 -5
  17. data/lib/console/output/failure.rb +32 -0
  18. data/lib/console/output/null.rb +5 -1
  19. data/lib/console/output/sensitive.rb +12 -10
  20. data/lib/console/{serialized/logger.rb → output/serialized.rb} +14 -49
  21. data/lib/console/output/split.rb +3 -3
  22. data/lib/console/{terminal/logger.rb → output/terminal.rb} +98 -54
  23. data/lib/console/output/wrapper.rb +28 -0
  24. data/lib/console/output.rb +7 -8
  25. data/lib/console/progress.rb +20 -9
  26. data/lib/console/resolver.rb +5 -5
  27. data/lib/console/terminal/formatter/failure.rb +57 -0
  28. data/lib/console/terminal/formatter/progress.rb +58 -0
  29. data/lib/console/terminal/formatter/spawn.rb +42 -0
  30. data/lib/console/terminal/text.rb +6 -2
  31. data/lib/console/terminal/xterm.rb +10 -3
  32. data/lib/console/terminal.rb +19 -2
  33. data/lib/console/version.rb +2 -2
  34. data/lib/console/warn.rb +33 -0
  35. data/lib/console.rb +4 -22
  36. data/license.md +5 -1
  37. data/readme.md +39 -2
  38. data/releases.md +25 -0
  39. data.tar.gz.sig +0 -0
  40. metadata +31 -92
  41. metadata.gz.sig +0 -0
  42. data/lib/console/buffer.rb +0 -25
  43. data/lib/console/event/progress.rb +0 -60
  44. data/lib/console/output/json.rb +0 -16
  45. data/lib/console/output/text.rb +0 -16
  46. data/lib/console/output/xterm.rb +0 -16
  47. data/lib/console/split.rb +0 -10
metadata CHANGED
@@ -1,16 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: console
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.19.0
4
+ version: 1.29.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  - Robert Schulze
9
9
  - Bryan Powell
10
10
  - Michael Adams
11
+ - Anton Sozontov
11
12
  - Cyril Roelandt
12
13
  - Cédric Boutillier
14
+ - Felix Yan
13
15
  - Olle Jonsson
16
+ - Patrik Wenger
17
+ - William T. Nelson
14
18
  autorequire:
15
19
  bindir: bin
16
20
  cert_chain:
@@ -43,22 +47,8 @@ cert_chain:
43
47
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
44
48
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
45
49
  -----END CERTIFICATE-----
46
- date: 2023-08-02 00:00:00.000000000 Z
50
+ date: 2024-11-06 00:00:00.000000000 Z
47
51
  dependencies:
48
- - !ruby/object:Gem::Dependency
49
- name: fiber-local
50
- requirement: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- type: :runtime
56
- prerelease: false
57
- version_requirements: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
52
  - !ruby/object:Gem::Dependency
63
53
  name: fiber-annotation
64
54
  requirement: !ruby/object:Gem::Requirement
@@ -74,89 +64,33 @@ dependencies:
74
64
  - !ruby/object:Gem::Version
75
65
  version: '0'
76
66
  - !ruby/object:Gem::Dependency
77
- name: bake
78
- requirement: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
- type: :development
84
- prerelease: false
85
- version_requirements: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- - !ruby/object:Gem::Dependency
91
- name: bake-test
92
- requirement: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- type: :development
98
- prerelease: false
99
- version_requirements: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- - !ruby/object:Gem::Dependency
105
- name: bake-test-external
67
+ name: fiber-local
106
68
  requirement: !ruby/object:Gem::Requirement
107
69
  requirements:
108
- - - ">="
70
+ - - "~>"
109
71
  - !ruby/object:Gem::Version
110
- version: '0'
111
- type: :development
72
+ version: '1.1'
73
+ type: :runtime
112
74
  prerelease: false
113
75
  version_requirements: !ruby/object:Gem::Requirement
114
76
  requirements:
115
- - - ">="
77
+ - - "~>"
116
78
  - !ruby/object:Gem::Version
117
- version: '0'
79
+ version: '1.1'
118
80
  - !ruby/object:Gem::Dependency
119
- name: bundler
81
+ name: json
120
82
  requirement: !ruby/object:Gem::Requirement
121
83
  requirements:
122
84
  - - ">="
123
85
  - !ruby/object:Gem::Version
124
86
  version: '0'
125
- type: :development
87
+ type: :runtime
126
88
  prerelease: false
127
89
  version_requirements: !ruby/object:Gem::Requirement
128
90
  requirements:
129
91
  - - ">="
130
92
  - !ruby/object:Gem::Version
131
93
  version: '0'
132
- - !ruby/object:Gem::Dependency
133
- name: covered
134
- requirement: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - "~>"
137
- - !ruby/object:Gem::Version
138
- version: 0.18.1
139
- type: :development
140
- prerelease: false
141
- version_requirements: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - "~>"
144
- - !ruby/object:Gem::Version
145
- version: 0.18.1
146
- - !ruby/object:Gem::Dependency
147
- name: sus
148
- requirement: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - "~>"
151
- - !ruby/object:Gem::Version
152
- version: '0.14'
153
- type: :development
154
- prerelease: false
155
- version_requirements: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - "~>"
158
- - !ruby/object:Gem::Version
159
- version: '0.14'
160
94
  description:
161
95
  email:
162
96
  executables: []
@@ -166,40 +100,45 @@ files:
166
100
  - bake/console.rb
167
101
  - lib/console.rb
168
102
  - lib/console/adapter.rb
169
- - lib/console/buffer.rb
170
103
  - lib/console/capture.rb
171
104
  - lib/console/clock.rb
172
105
  - lib/console/compatible/logger.rb
173
106
  - lib/console/event.rb
174
107
  - lib/console/event/failure.rb
175
108
  - lib/console/event/generic.rb
176
- - lib/console/event/progress.rb
177
109
  - lib/console/event/spawn.rb
178
110
  - lib/console/filter.rb
111
+ - lib/console/format.rb
112
+ - lib/console/format/safe.rb
113
+ - lib/console/interface.rb
179
114
  - lib/console/logger.rb
180
115
  - lib/console/output.rb
181
116
  - lib/console/output/default.rb
182
- - lib/console/output/json.rb
117
+ - lib/console/output/failure.rb
183
118
  - lib/console/output/null.rb
184
119
  - lib/console/output/sensitive.rb
120
+ - lib/console/output/serialized.rb
185
121
  - lib/console/output/split.rb
186
- - lib/console/output/text.rb
187
- - lib/console/output/xterm.rb
122
+ - lib/console/output/terminal.rb
123
+ - lib/console/output/wrapper.rb
188
124
  - lib/console/progress.rb
189
125
  - lib/console/resolver.rb
190
- - lib/console/serialized/logger.rb
191
- - lib/console/split.rb
192
126
  - lib/console/terminal.rb
193
- - lib/console/terminal/logger.rb
127
+ - lib/console/terminal/formatter/failure.rb
128
+ - lib/console/terminal/formatter/progress.rb
129
+ - lib/console/terminal/formatter/spawn.rb
194
130
  - lib/console/terminal/text.rb
195
131
  - lib/console/terminal/xterm.rb
196
132
  - lib/console/version.rb
133
+ - lib/console/warn.rb
197
134
  - license.md
198
135
  - readme.md
199
- homepage: https://github.com/socketry/console
136
+ - releases.md
137
+ homepage: https://socketry.github.io/console
200
138
  licenses:
201
139
  - MIT
202
- metadata: {}
140
+ metadata:
141
+ documentation_uri: https://socketry.github.io/console/
203
142
  post_install_message:
204
143
  rdoc_options: []
205
144
  require_paths:
@@ -208,14 +147,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
208
147
  requirements:
209
148
  - - ">="
210
149
  - !ruby/object:Gem::Version
211
- version: 2.7.3
150
+ version: '3.1'
212
151
  required_rubygems_version: !ruby/object:Gem::Requirement
213
152
  requirements:
214
153
  - - ">="
215
154
  - !ruby/object:Gem::Version
216
155
  version: '0'
217
156
  requirements: []
218
- rubygems_version: 3.4.10
157
+ rubygems_version: 3.5.11
219
158
  signing_key:
220
159
  specification_version: 4
221
160
  summary: Beautiful logging for Ruby.
metadata.gz.sig CHANGED
Binary file
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Released under the MIT License.
4
- # Copyright, 2019-2022, by Samuel Williams.
5
-
6
- require 'stringio'
7
-
8
- module Console
9
- class Buffer < StringIO
10
- def initialize(prefix = nil)
11
- @prefix = prefix
12
-
13
- super()
14
- end
15
-
16
- def puts(*args, prefix: @prefix)
17
- args.each do |arg|
18
- self.write(prefix) if prefix
19
- super(arg)
20
- end
21
- end
22
-
23
- alias << puts
24
- end
25
- end
@@ -1,60 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Released under the MIT License.
4
- # Copyright, 2020-2022, by Samuel Williams.
5
-
6
- require_relative 'generic'
7
-
8
- module Console
9
- module Event
10
- class Progress < Generic
11
- BLOCK = [
12
- " ",
13
- "▏",
14
- "▎",
15
- "▍",
16
- "▌",
17
- "▋",
18
- "▊",
19
- "▉",
20
- "█",
21
- ]
22
-
23
- def initialize(current, total)
24
- @current = current
25
- @total = total
26
- end
27
-
28
- attr :current
29
- attr :total
30
-
31
- def value
32
- @current.to_f / @total.to_f
33
- end
34
-
35
- def bar(value = self.value, width = 70)
36
- blocks = width * value
37
- full_blocks = blocks.floor
38
- partial_block = ((blocks - full_blocks) * BLOCK.size).floor
39
-
40
- if partial_block.zero?
41
- BLOCK.last * full_blocks
42
- else
43
- "#{BLOCK.last * full_blocks}#{BLOCK[partial_block]}"
44
- end.ljust(width)
45
- end
46
-
47
- def self.register(terminal)
48
- terminal[:progress_bar] ||= terminal.style(:blue, :white)
49
- end
50
-
51
- def to_h
52
- {current: @current, total: @total}
53
- end
54
-
55
- def format(output, terminal, verbose)
56
- output.puts "#{terminal[:progress_bar]}#{self.bar}#{terminal.reset} #{sprintf('%6.2f', self.value * 100)}%"
57
- end
58
- end
59
- end
60
- end
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Released under the MIT License.
4
- # Copyright, 2021-2022, by Samuel Williams.
5
-
6
- require_relative '../serialized/logger'
7
-
8
- module Console
9
- module Output
10
- module JSON
11
- def self.new(output, **options)
12
- Serialized::Logger.new(output, format: ::JSON, **options)
13
- end
14
- end
15
- end
16
- end
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Released under the MIT License.
4
- # Copyright, 2021-2022, by Samuel Williams.
5
-
6
- require_relative '../terminal/logger'
7
-
8
- module Console
9
- module Output
10
- module Text
11
- def self.new(output, **options)
12
- Terminal::Logger.new(output, format: Terminal::Text, **options)
13
- end
14
- end
15
- end
16
- end
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Released under the MIT License.
4
- # Copyright, 2021-2022, by Samuel Williams.
5
-
6
- require_relative '../terminal/logger'
7
-
8
- module Console
9
- module Output
10
- module XTerm
11
- def self.new(output, **options)
12
- Terminal::Logger.new(output, format: Terminal::XTerm, **options)
13
- end
14
- end
15
- end
16
- end
data/lib/console/split.rb DELETED
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Released under the MIT License.
4
- # Copyright, 2019-2022, by Samuel Williams.
5
-
6
- require_relative 'output/split'
7
-
8
- module Console
9
- Split = Output::Split
10
- end