gloo 5.3.2 → 5.3.4
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/objs/basic/string.rb +1 -1
- data/lib/gloo/objs/basic/string_msgs.rb +45 -0
- data/lib/gloo/objs/basic/text.rb +1 -1
- data/lib/gloo/objs/system/file_handle.rb +2 -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: 96b8b9b082d0a4cbc0e83f4abcffadc71275bd669b6016c71aa67e0926b7f62a
|
|
4
|
+
data.tar.gz: 57c3ad84fb52fa0ccac719cb574e3469a0347157feb9d2b63c1975c0b16e3492
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e7e1a97eb5a2d96f3bdda77fdcffbad89ce225196f64c164aeec730dd3ba202d51f9695fafe63cf2a9e3b23ad9304ffa79ec585edb827b4d7e2e0c1d8471f710
|
|
7
|
+
data.tar.gz: 1dced9f5fa30d32846530057abbec4c420197fc43a97228b25e95d20f8325c4c0ff3064afe54f59edc5ac41aa0fc28a0e2a60803463c8f4df9f8ef24855eec8b
|
data/lib/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
5.3.
|
|
1
|
+
5.3.4
|
data/lib/VERSION_NOTES
CHANGED
|
@@ -44,7 +44,7 @@ module Gloo
|
|
|
44
44
|
# Get a list of message names that this object receives.
|
|
45
45
|
#
|
|
46
46
|
def self.messages
|
|
47
|
-
return super + %w[up down size starts_with? ends_with? substring?
|
|
47
|
+
return super + %w[up down size starts_with? ends_with? substring? sub gsub
|
|
48
48
|
count_lines count_words count_chars
|
|
49
49
|
format_for_html encode64 decode64 escape unescape
|
|
50
50
|
gen_alphanumeric gen_uuid gen_hex gen_base64]
|
|
@@ -48,6 +48,51 @@ module Gloo
|
|
|
48
48
|
end
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
+
#
|
|
52
|
+
# Substitute the given string with another string.
|
|
53
|
+
#
|
|
54
|
+
def msg_sub
|
|
55
|
+
if @params&.token_count&.positive?
|
|
56
|
+
expr = Gloo::Expr::Expression.new( @engine, [ @params.tokens.first ] )
|
|
57
|
+
from = expr.evaluate
|
|
58
|
+
expr = Gloo::Expr::Expression.new( @engine, [ @params.tokens.last ] )
|
|
59
|
+
to = expr.evaluate
|
|
60
|
+
|
|
61
|
+
result = value.sub(from, to)
|
|
62
|
+
@engine.heap.it.set_to result
|
|
63
|
+
set_value(result)
|
|
64
|
+
return result
|
|
65
|
+
else
|
|
66
|
+
# Error
|
|
67
|
+
@engine.log.error MISSING_PARAM_MSG
|
|
68
|
+
@engine.heap.it.set_to false
|
|
69
|
+
return false
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
#
|
|
74
|
+
# Substitute the given string with another string.
|
|
75
|
+
# Find all occurrences and replace them.
|
|
76
|
+
#
|
|
77
|
+
def msg_gsub
|
|
78
|
+
if @params&.token_count&.positive?
|
|
79
|
+
expr = Gloo::Expr::Expression.new( @engine, [ @params.tokens.first ] )
|
|
80
|
+
from = expr.evaluate
|
|
81
|
+
expr = Gloo::Expr::Expression.new( @engine, [ @params.tokens.last ] )
|
|
82
|
+
to = expr.evaluate
|
|
83
|
+
|
|
84
|
+
result = value.gsub(from, to)
|
|
85
|
+
@engine.heap.it.set_to result
|
|
86
|
+
set_value(result)
|
|
87
|
+
return result
|
|
88
|
+
else
|
|
89
|
+
# Error
|
|
90
|
+
@engine.log.error MISSING_PARAM_MSG
|
|
91
|
+
@engine.heap.it.set_to false
|
|
92
|
+
return false
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
|
|
51
96
|
#
|
|
52
97
|
# Does the string contain the given string?
|
|
53
98
|
#
|
data/lib/gloo/objs/basic/text.rb
CHANGED
|
@@ -58,7 +58,7 @@ module Gloo
|
|
|
58
58
|
# Get a list of message names that this object receives.
|
|
59
59
|
#
|
|
60
60
|
def self.messages
|
|
61
|
-
return super + %w[up down size starts_with? ends_with? substring?
|
|
61
|
+
return super + %w[up down size starts_with? ends_with? substring? sub gsub
|
|
62
62
|
count_lines count_words count_chars
|
|
63
63
|
format_for_html encode64 decode64 escape unescape
|
|
64
64
|
gen_alphanumeric gen_uuid gen_hex gen_base64]
|
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.4
|
|
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-04-
|
|
11
|
+
date: 2026-04-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|