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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96b8b9b082d0a4cbc0e83f4abcffadc71275bd669b6016c71aa67e0926b7f62a
4
- data.tar.gz: 57c3ad84fb52fa0ccac719cb574e3469a0347157feb9d2b63c1975c0b16e3492
3
+ metadata.gz: 4d92500a13610241dd288642f0a86761da713767e266469ab4e0b9c914beb0f7
4
+ data.tar.gz: e469aa328e37e403ca19b477d49e1b2641c80453fc65371c50851657bd4f960c
5
5
  SHA512:
6
- metadata.gz: e7e1a97eb5a2d96f3bdda77fdcffbad89ce225196f64c164aeec730dd3ba202d51f9695fafe63cf2a9e3b23ad9304ffa79ec585edb827b4d7e2e0c1d8471f710
7
- data.tar.gz: 1dced9f5fa30d32846530057abbec4c420197fc43a97228b25e95d20f8325c4c0ff3064afe54f59edc5ac41aa0fc28a0e2a60803463c8f4df9f8ef24855eec8b
6
+ metadata.gz: cbe487b231a297018db8bcde3e2c19bf5254e543c3716213130c95fc750623130e3e2df6caa720af22b40905f09d420501efd5cf0447073cf6e82bc6876d61f8
7
+ data.tar.gz: c47be8e050e265300274f3e69147a3ec4aa1ed70c094aec9d9edeaadc3db834844473524e83c5f08a6e150e1d16664e0e657d2bc18755cc9ddaad3ea055b7f79
data/lib/VERSION CHANGED
@@ -1 +1 @@
1
- 5.3.4
1
+ 5.3.6
data/lib/VERSION_NOTES CHANGED
@@ -1,3 +1,11 @@
1
+ 5.3.6 - 2026.05.01
2
+ - Adds default value for prompt (optional)
3
+
4
+
5
+ 5.3.5 - 2026.04.23
6
+ - Adds string trim message.
7
+
8
+
1
9
  5.3.4 - 2026.04.22
2
10
  - mkdir now creates intermediate directories
3
11
 
@@ -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
- response = Reline.readline( "#{prompt} ", true)
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
@@ -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
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-04-22 00:00:00.000000000 Z
11
+ date: 2026-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler