console 1.24.0 → 1.26.0
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/console/adapter.rb +2 -1
- data/lib/console/capture.rb +41 -17
- data/lib/console/compatible/logger.rb +2 -1
- data/lib/console/event/failure.rb +39 -48
- data/lib/console/event/generic.rb +9 -6
- data/lib/console/event/spawn.rb +34 -26
- data/lib/console/event.rb +1 -2
- data/lib/console/filter.rb +10 -7
- data/lib/console/format.rb +1 -5
- data/lib/console/logger.rb +19 -9
- data/lib/console/output/default.rb +5 -5
- data/lib/console/output/null.rb +1 -1
- data/lib/console/output/sensitive.rb +11 -9
- data/lib/console/{serialized/logger.rb → output/serialized.rb} +7 -47
- data/lib/console/output/split.rb +3 -3
- data/lib/console/{terminal/logger.rb → output/terminal.rb} +79 -47
- data/lib/console/output/wrapper.rb +22 -0
- data/lib/console/output.rb +3 -4
- data/lib/console/progress.rb +18 -8
- data/lib/console/terminal/formatter/failure.rb +57 -0
- data/lib/console/terminal/formatter/progress.rb +58 -0
- data/lib/console/terminal/formatter/spawn.rb +42 -0
- data/lib/console/terminal/text.rb +5 -1
- data/lib/console/terminal/xterm.rb +8 -1
- data/lib/console/terminal.rb +19 -2
- data/lib/console/version.rb +2 -2
- data/lib/console.rb +1 -9
- data.tar.gz.sig +0 -0
- metadata +17 -18
- metadata.gz.sig +0 -0
- data/lib/console/buffer.rb +0 -25
- data/lib/console/event/progress.rb +0 -60
- data/lib/console/output/json.rb +0 -16
- data/lib/console/output/text.rb +0 -16
- data/lib/console/output/xterm.rb +0 -16
- data/lib/console/split.rb +0 -10
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: console
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.26.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Samuel Williams
|
|
@@ -46,7 +46,7 @@ cert_chain:
|
|
|
46
46
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
|
47
47
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
|
48
48
|
-----END CERTIFICATE-----
|
|
49
|
-
date: 2024-
|
|
49
|
+
date: 2024-07-17 00:00:00.000000000 Z
|
|
50
50
|
dependencies:
|
|
51
51
|
- !ruby/object:Gem::Dependency
|
|
52
52
|
name: fiber-annotation
|
|
@@ -66,16 +66,16 @@ dependencies:
|
|
|
66
66
|
name: fiber-local
|
|
67
67
|
requirement: !ruby/object:Gem::Requirement
|
|
68
68
|
requirements:
|
|
69
|
-
- - "
|
|
69
|
+
- - "~>"
|
|
70
70
|
- !ruby/object:Gem::Version
|
|
71
|
-
version: '
|
|
71
|
+
version: '1.1'
|
|
72
72
|
type: :runtime
|
|
73
73
|
prerelease: false
|
|
74
74
|
version_requirements: !ruby/object:Gem::Requirement
|
|
75
75
|
requirements:
|
|
76
|
-
- - "
|
|
76
|
+
- - "~>"
|
|
77
77
|
- !ruby/object:Gem::Version
|
|
78
|
-
version: '
|
|
78
|
+
version: '1.1'
|
|
79
79
|
- !ruby/object:Gem::Dependency
|
|
80
80
|
name: json
|
|
81
81
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -99,14 +99,12 @@ files:
|
|
|
99
99
|
- bake/console.rb
|
|
100
100
|
- lib/console.rb
|
|
101
101
|
- lib/console/adapter.rb
|
|
102
|
-
- lib/console/buffer.rb
|
|
103
102
|
- lib/console/capture.rb
|
|
104
103
|
- lib/console/clock.rb
|
|
105
104
|
- lib/console/compatible/logger.rb
|
|
106
105
|
- lib/console/event.rb
|
|
107
106
|
- lib/console/event/failure.rb
|
|
108
107
|
- lib/console/event/generic.rb
|
|
109
|
-
- lib/console/event/progress.rb
|
|
110
108
|
- lib/console/event/spawn.rb
|
|
111
109
|
- lib/console/filter.rb
|
|
112
110
|
- lib/console/format.rb
|
|
@@ -114,27 +112,28 @@ files:
|
|
|
114
112
|
- lib/console/logger.rb
|
|
115
113
|
- lib/console/output.rb
|
|
116
114
|
- lib/console/output/default.rb
|
|
117
|
-
- lib/console/output/json.rb
|
|
118
115
|
- lib/console/output/null.rb
|
|
119
116
|
- lib/console/output/sensitive.rb
|
|
117
|
+
- lib/console/output/serialized.rb
|
|
120
118
|
- lib/console/output/split.rb
|
|
121
|
-
- lib/console/output/
|
|
122
|
-
- lib/console/output/
|
|
119
|
+
- lib/console/output/terminal.rb
|
|
120
|
+
- lib/console/output/wrapper.rb
|
|
123
121
|
- lib/console/progress.rb
|
|
124
122
|
- lib/console/resolver.rb
|
|
125
|
-
- lib/console/serialized/logger.rb
|
|
126
|
-
- lib/console/split.rb
|
|
127
123
|
- lib/console/terminal.rb
|
|
128
|
-
- lib/console/terminal/
|
|
124
|
+
- lib/console/terminal/formatter/failure.rb
|
|
125
|
+
- lib/console/terminal/formatter/progress.rb
|
|
126
|
+
- lib/console/terminal/formatter/spawn.rb
|
|
129
127
|
- lib/console/terminal/text.rb
|
|
130
128
|
- lib/console/terminal/xterm.rb
|
|
131
129
|
- lib/console/version.rb
|
|
132
130
|
- license.md
|
|
133
131
|
- readme.md
|
|
134
|
-
homepage: https://socketry.github.io/console
|
|
132
|
+
homepage: https://socketry.github.io/console
|
|
135
133
|
licenses:
|
|
136
134
|
- MIT
|
|
137
|
-
metadata:
|
|
135
|
+
metadata:
|
|
136
|
+
documentation_uri: https://socketry.github.io/console/
|
|
138
137
|
post_install_message:
|
|
139
138
|
rdoc_options: []
|
|
140
139
|
require_paths:
|
|
@@ -143,14 +142,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
143
142
|
requirements:
|
|
144
143
|
- - ">="
|
|
145
144
|
- !ruby/object:Gem::Version
|
|
146
|
-
version: '3.
|
|
145
|
+
version: '3.1'
|
|
147
146
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
147
|
requirements:
|
|
149
148
|
- - ">="
|
|
150
149
|
- !ruby/object:Gem::Version
|
|
151
150
|
version: '0'
|
|
152
151
|
requirements: []
|
|
153
|
-
rubygems_version: 3.5.
|
|
152
|
+
rubygems_version: 3.5.11
|
|
154
153
|
signing_key:
|
|
155
154
|
specification_version: 4
|
|
156
155
|
summary: Beautiful logging for Ruby.
|
metadata.gz.sig
CHANGED
|
Binary file
|
data/lib/console/buffer.rb
DELETED
|
@@ -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
|
data/lib/console/output/json.rb
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# Released under the MIT License.
|
|
4
|
-
# Copyright, 2021-2023, 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: Format.default_json, **options)
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
data/lib/console/output/text.rb
DELETED
|
@@ -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
|
data/lib/console/output/xterm.rb
DELETED
|
@@ -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
|