ruby_rich 0.4.2 → 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 +11 -5
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
|
|
@@ -103,16 +103,22 @@ dependencies:
|
|
|
103
103
|
name: unicode-display_width
|
|
104
104
|
requirement: !ruby/object:Gem::Requirement
|
|
105
105
|
requirements:
|
|
106
|
-
- - "
|
|
106
|
+
- - ">="
|
|
107
|
+
- !ruby/object:Gem::Version
|
|
108
|
+
version: '1.5'
|
|
109
|
+
- - "<"
|
|
107
110
|
- !ruby/object:Gem::Version
|
|
108
|
-
version: 3.
|
|
111
|
+
version: '3.0'
|
|
109
112
|
type: :runtime
|
|
110
113
|
prerelease: false
|
|
111
114
|
version_requirements: !ruby/object:Gem::Requirement
|
|
112
115
|
requirements:
|
|
113
|
-
- - "
|
|
116
|
+
- - ">="
|
|
117
|
+
- !ruby/object:Gem::Version
|
|
118
|
+
version: '1.5'
|
|
119
|
+
- - "<"
|
|
114
120
|
- !ruby/object:Gem::Version
|
|
115
|
-
version: 3.
|
|
121
|
+
version: '3.0'
|
|
116
122
|
description: A Ruby gem providing rich text formatting, progress bars, tables and
|
|
117
123
|
other console output enhancements
|
|
118
124
|
email: zbw@kaiyuanshe.org
|