gloo 5.3.4 → 5.3.6
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 +5 -2
- data/lib/gloo/objs/basic/string.rb +1 -1
- data/lib/gloo/objs/basic/string_msgs.rb +17 -1
- data/lib/gloo/objs/basic/text.rb +1 -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: 4d92500a13610241dd288642f0a86761da713767e266469ab4e0b9c914beb0f7
|
|
4
|
+
data.tar.gz: e469aa328e37e403ca19b477d49e1b2641c80453fc65371c50851657bd4f960c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cbe487b231a297018db8bcde3e2c19bf5254e543c3716213130c95fc750623130e3e2df6caa720af22b40905f09d420501efd5cf0447073cf6e82bc6876d61f8
|
|
7
|
+
data.tar.gz: c47be8e050e265300274f3e69147a3ec4aa1ed70c094aec9d9edeaadc3db834844473524e83c5f08a6e150e1d16664e0e657d2bc18755cc9ddaad3ea055b7f79
|
data/lib/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
5.3.
|
|
1
|
+
5.3.6
|
data/lib/VERSION_NOTES
CHANGED
data/lib/gloo/app/prompt.rb
CHANGED
|
@@ -24,10 +24,13 @@ 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)
|
|
31
34
|
|
|
32
35
|
# I don't like this one because it appends a ':' to the prompt.
|
|
33
36
|
# response = Ask.input prompt
|
|
@@ -45,7 +45,7 @@ module Gloo
|
|
|
45
45
|
#
|
|
46
46
|
def self.messages
|
|
47
47
|
return super + %w[up down size starts_with? ends_with? substring? sub gsub
|
|
48
|
-
count_lines count_words count_chars
|
|
48
|
+
count_lines count_words count_chars trim
|
|
49
49
|
format_for_html encode64 decode64 escape unescape
|
|
50
50
|
gen_alphanumeric gen_uuid gen_hex gen_base64]
|
|
51
51
|
end
|
|
@@ -10,6 +10,19 @@ module Gloo
|
|
|
10
10
|
module Objs
|
|
11
11
|
module StringMsgs
|
|
12
12
|
|
|
13
|
+
|
|
14
|
+
#
|
|
15
|
+
# Strip whitespace from the beginning and end of the string.
|
|
16
|
+
#
|
|
17
|
+
def msg_trim
|
|
18
|
+
return '' unless value
|
|
19
|
+
|
|
20
|
+
result = value.strip
|
|
21
|
+
@engine.heap.it.set_to result
|
|
22
|
+
set_value(result)
|
|
23
|
+
return result
|
|
24
|
+
end
|
|
25
|
+
|
|
13
26
|
#
|
|
14
27
|
# Does the string start with the given string?
|
|
15
28
|
#
|
|
@@ -52,6 +65,7 @@ module Gloo
|
|
|
52
65
|
# Substitute the given string with another string.
|
|
53
66
|
#
|
|
54
67
|
def msg_sub
|
|
68
|
+
return '' unless value
|
|
55
69
|
if @params&.token_count&.positive?
|
|
56
70
|
expr = Gloo::Expr::Expression.new( @engine, [ @params.tokens.first ] )
|
|
57
71
|
from = expr.evaluate
|
|
@@ -75,13 +89,15 @@ module Gloo
|
|
|
75
89
|
# Find all occurrences and replace them.
|
|
76
90
|
#
|
|
77
91
|
def msg_gsub
|
|
92
|
+
return '' unless value
|
|
93
|
+
|
|
78
94
|
if @params&.token_count&.positive?
|
|
79
95
|
expr = Gloo::Expr::Expression.new( @engine, [ @params.tokens.first ] )
|
|
80
96
|
from = expr.evaluate
|
|
81
97
|
expr = Gloo::Expr::Expression.new( @engine, [ @params.tokens.last ] )
|
|
82
98
|
to = expr.evaluate
|
|
83
99
|
|
|
84
|
-
result = value.gsub(from, to)
|
|
100
|
+
result = value.gsub(from, to)
|
|
85
101
|
@engine.heap.it.set_to result
|
|
86
102
|
set_value(result)
|
|
87
103
|
return result
|
data/lib/gloo/objs/basic/text.rb
CHANGED
|
@@ -59,7 +59,7 @@ module Gloo
|
|
|
59
59
|
#
|
|
60
60
|
def self.messages
|
|
61
61
|
return super + %w[up down size starts_with? ends_with? substring? sub gsub
|
|
62
|
-
count_lines count_words count_chars
|
|
62
|
+
count_lines count_words count_chars trim
|
|
63
63
|
format_for_html encode64 decode64 escape unescape
|
|
64
64
|
gen_alphanumeric gen_uuid gen_hex gen_base64]
|
|
65
65
|
end
|
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.6
|
|
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
|