ruby_rich 0.4.1 → 0.4.3
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
- data/lib/ruby_rich/agent_shell.rb +10 -2
- data/lib/ruby_rich/version.rb +1 -1
- metadata +21 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9110486cfde27e4e77705f6daa78bd07a66fd9665dcfa3cdb7bbbb13ab1cac82
|
|
4
|
+
data.tar.gz: 46cb92c2621846bab87f0b0cb2c45dfd6bdba6c3f3547ac64bae3f2d2c779333
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c9e7643688bb98f73aa309238413535539448bc20b5ddb05fbdc83c476b8696c09df3990cbae1beb36095f6fd18c8228876026237ca6a934af7e4be1a0ff29d3
|
|
7
|
+
data.tar.gz: 7b9fb1f6844b45679079474aad5a54ef97e343bc56459a873ccdaad7ef4f0e1b080fc1141dcce3647d47c152b9bd2443f164d266cfdaaa66f6dd78dbf6c6e44e
|
|
@@ -219,8 +219,10 @@ module RubyRich
|
|
|
219
219
|
end
|
|
220
220
|
end
|
|
221
221
|
|
|
222
|
-
def handle_interrupt(
|
|
223
|
-
|
|
222
|
+
def handle_interrupt(live = nil, _source = nil)
|
|
223
|
+
input_was_empty = @composer.value.to_s.empty?
|
|
224
|
+
@callbacks[:interrupt]&.call(input_was_empty: input_was_empty)
|
|
225
|
+
live&.stop
|
|
224
226
|
end
|
|
225
227
|
|
|
226
228
|
def handle_eof(live = nil, _source = nil)
|
|
@@ -230,11 +232,17 @@ module RubyRich
|
|
|
230
232
|
|
|
231
233
|
def handle_submit(value, live, attachments = [])
|
|
232
234
|
text = value.to_s
|
|
235
|
+
stripped = text.strip
|
|
233
236
|
if text.start_with?("/")
|
|
234
237
|
command = text.split(/\s+/, 2).first
|
|
235
238
|
@callbacks[:command]&.call(command)
|
|
236
239
|
end
|
|
237
240
|
|
|
241
|
+
if stripped == "/quit"
|
|
242
|
+
live&.stop
|
|
243
|
+
return
|
|
244
|
+
end
|
|
245
|
+
|
|
238
246
|
@callbacks[:submit]&.call(text, attachments)
|
|
239
247
|
end
|
|
240
248
|
|
data/lib/ruby_rich/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby_rich
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- zhuang biaowei
|
|
@@ -41,16 +41,22 @@ dependencies:
|
|
|
41
41
|
name: rouge
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
|
43
43
|
requirements:
|
|
44
|
-
- - "
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '3.14'
|
|
47
|
+
- - "<"
|
|
45
48
|
- !ruby/object:Gem::Version
|
|
46
|
-
version: 4.
|
|
49
|
+
version: '4.0'
|
|
47
50
|
type: :runtime
|
|
48
51
|
prerelease: false
|
|
49
52
|
version_requirements: !ruby/object:Gem::Requirement
|
|
50
53
|
requirements:
|
|
51
|
-
- - "
|
|
54
|
+
- - ">="
|
|
55
|
+
- !ruby/object:Gem::Version
|
|
56
|
+
version: '3.14'
|
|
57
|
+
- - "<"
|
|
52
58
|
- !ruby/object:Gem::Version
|
|
53
|
-
version: 4.
|
|
59
|
+
version: '4.0'
|
|
54
60
|
- !ruby/object:Gem::Dependency
|
|
55
61
|
name: tty-cursor
|
|
56
62
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -97,16 +103,22 @@ dependencies:
|
|
|
97
103
|
name: unicode-display_width
|
|
98
104
|
requirement: !ruby/object:Gem::Requirement
|
|
99
105
|
requirements:
|
|
100
|
-
- - "
|
|
106
|
+
- - ">="
|
|
107
|
+
- !ruby/object:Gem::Version
|
|
108
|
+
version: '1.5'
|
|
109
|
+
- - "<"
|
|
101
110
|
- !ruby/object:Gem::Version
|
|
102
|
-
version: 3.
|
|
111
|
+
version: '3.0'
|
|
103
112
|
type: :runtime
|
|
104
113
|
prerelease: false
|
|
105
114
|
version_requirements: !ruby/object:Gem::Requirement
|
|
106
115
|
requirements:
|
|
107
|
-
- - "
|
|
116
|
+
- - ">="
|
|
117
|
+
- !ruby/object:Gem::Version
|
|
118
|
+
version: '1.5'
|
|
119
|
+
- - "<"
|
|
108
120
|
- !ruby/object:Gem::Version
|
|
109
|
-
version: 3.
|
|
121
|
+
version: '3.0'
|
|
110
122
|
description: A Ruby gem providing rich text formatting, progress bars, tables and
|
|
111
123
|
other console output enhancements
|
|
112
124
|
email: zbw@kaiyuanshe.org
|