gloo 5.3.5 → 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: 55d950b89bc9046f1e31c4c055b28387673e5b13277b0a93fe548f0de926c3ed
4
- data.tar.gz: 04bffb0434018dd8cd17cdf322c0f60022870bff76a19c69a3f7fa84a5e9b329
3
+ metadata.gz: 4d92500a13610241dd288642f0a86761da713767e266469ab4e0b9c914beb0f7
4
+ data.tar.gz: e469aa328e37e403ca19b477d49e1b2641c80453fc65371c50851657bd4f960c
5
5
  SHA512:
6
- metadata.gz: 999dd0172c6b87975f44fceb3be32935116c07fb8a281c94b2d3784f511d907051278aa3e8515ba46b6c53cb9edec0b2bbdec7c2017f582f878d773fdac8fead
7
- data.tar.gz: cac87e1060490495e702b9abf92610fe7f1da9a4194aca8be866e102f5e4ee344bf7ccd333811b50f61010bde6c619738bcdb7f5502eb19e59afb61e88ae6297
6
+ metadata.gz: cbe487b231a297018db8bcde3e2c19bf5254e543c3716213130c95fc750623130e3e2df6caa720af22b40905f09d420501efd5cf0447073cf6e82bc6876d61f8
7
+ data.tar.gz: c47be8e050e265300274f3e69147a3ec4aa1ed70c094aec9d9edeaadc3db834844473524e83c5f08a6e150e1d16664e0e657d2bc18755cc9ddaad3ea055b7f79
data/lib/VERSION CHANGED
@@ -1 +1 @@
1
- 5.3.5
1
+ 5.3.6
data/lib/VERSION_NOTES CHANGED
@@ -1,3 +1,7 @@
1
+ 5.3.6 - 2026.05.01
2
+ - Adds default value for prompt (optional)
3
+
4
+
1
5
  5.3.5 - 2026.04.23
2
6
  - Adds string trim message.
3
7
 
@@ -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
@@ -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.5
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-23 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