gloo 5.3.5 → 5.3.7
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/VERSION +1 -1
- data/lib/VERSION_NOTES +8 -0
- data/lib/gloo/app/prompt.rb +6 -2
- data/lib/gloo/objs/basic/string_msgs.rb +6 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 99cf3aaaa69bc108816bf0c7d00ce28fdefc8b077518287dd85f7d1122f7ed90
|
|
4
|
+
data.tar.gz: 45146264b60f9d68d5e4e4c30e3f0b6ba295b1985de2beb66d89fff529e3f3e5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 356125b643a512c2f34073d702de9f56ae798b4dd37b20e2de3179eab011c6db0be3d44b897b5a7a26aaa2390c54a32c26d417d7d5a9b885283b671aba438ec5
|
|
7
|
+
data.tar.gz: 6d09402914487f2e00ee23b181e93f629dca1156970e0b06f40bc4ff9d16dea96d5d032327bb07689a21b0b4d401eeaf1cfe20f046973c780684f7f12a40279e
|
data/lib/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
5.3.
|
|
1
|
+
5.3.7
|
data/lib/VERSION_NOTES
CHANGED
data/lib/gloo/app/prompt.rb
CHANGED
|
@@ -24,10 +24,14 @@ module Gloo
|
|
|
24
24
|
# Show the prompt and get input.
|
|
25
25
|
# Use the default prompt if none is provided.
|
|
26
26
|
#
|
|
27
|
-
def ask( prompt=nil )
|
|
27
|
+
def ask( prompt = nil, default_value = nil )
|
|
28
28
|
prompt ||= default_prompt
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
if default_value
|
|
31
|
+
Reline.pre_input_hook = proc { Reline.insert_text( default_value ) }
|
|
32
|
+
end
|
|
33
|
+
response = Reline.readline("#{prompt} ", true)
|
|
34
|
+
Reline.pre_input_hook = nil
|
|
31
35
|
|
|
32
36
|
# I don't like this one because it appends a ':' to the prompt.
|
|
33
37
|
# response = Ask.input prompt
|
|
@@ -15,6 +15,8 @@ module Gloo
|
|
|
15
15
|
# Strip whitespace from the beginning and end of the string.
|
|
16
16
|
#
|
|
17
17
|
def msg_trim
|
|
18
|
+
return '' unless value
|
|
19
|
+
|
|
18
20
|
result = value.strip
|
|
19
21
|
@engine.heap.it.set_to result
|
|
20
22
|
set_value(result)
|
|
@@ -63,6 +65,7 @@ module Gloo
|
|
|
63
65
|
# Substitute the given string with another string.
|
|
64
66
|
#
|
|
65
67
|
def msg_sub
|
|
68
|
+
return '' unless value
|
|
66
69
|
if @params&.token_count&.positive?
|
|
67
70
|
expr = Gloo::Expr::Expression.new( @engine, [ @params.tokens.first ] )
|
|
68
71
|
from = expr.evaluate
|
|
@@ -86,13 +89,15 @@ module Gloo
|
|
|
86
89
|
# Find all occurrences and replace them.
|
|
87
90
|
#
|
|
88
91
|
def msg_gsub
|
|
92
|
+
return '' unless value
|
|
93
|
+
|
|
89
94
|
if @params&.token_count&.positive?
|
|
90
95
|
expr = Gloo::Expr::Expression.new( @engine, [ @params.tokens.first ] )
|
|
91
96
|
from = expr.evaluate
|
|
92
97
|
expr = Gloo::Expr::Expression.new( @engine, [ @params.tokens.last ] )
|
|
93
98
|
to = expr.evaluate
|
|
94
99
|
|
|
95
|
-
result = value.gsub(from, to)
|
|
100
|
+
result = value.gsub(from, to)
|
|
96
101
|
@engine.heap.it.set_to result
|
|
97
102
|
set_value(result)
|
|
98
103
|
return result
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gloo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.3.
|
|
4
|
+
version: 5.3.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Eric Crane
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-05-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|