gloo 5.3.7 → 5.3.9
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/.DS_Store +0 -0
- data/CLAUDE.md +83 -0
- data/lib/VERSION +1 -1
- data/lib/VERSION_NOTES +8 -0
- data/lib/gloo/core/gloo_system.rb +24 -0
- data/lib/gloo/objs/system/file_handle.rb +18 -1
- data/lib/gloo/objs/web/uri.rb +14 -7
- data/test.gloo/lang/gloo_sys.test.gloo +15 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c5353f95b95c44382afa5fbd36d3f14681314dcee7a284bb60c51806f6b9be5a
|
|
4
|
+
data.tar.gz: cabbfad7080488c79b911a12d9c070885505b0926f414f821d4d3cc2222c01bd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d86a2a5c5476dab64505e1180fb43b6c24d9cb4bec414a9dc9703afb8748a85070eb33ba5db10ed2146ac1244380f8cf3fb7bc81773e892474d441615711c955
|
|
7
|
+
data.tar.gz: 8d41fd6c9ee3f5839e423721f8d23c2024f777caaddf60785209f2ad2d867360974c75697cb46fe62a45c81994fe41ff337794fe24118fe2bb5ca93cf2f22d6e
|
data/.DS_Store
CHANGED
|
Binary file
|
data/CLAUDE.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
@/Users/ecrane/dev/gloo_meta/CLAUDE.md
|
|
2
|
+
|
|
3
|
+
# Gloo — Core Interpreter
|
|
4
|
+
|
|
5
|
+
This is the main gloo language implementation, packaged as a Ruby gem.
|
|
6
|
+
|
|
7
|
+
## Project Structure
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
gloo/
|
|
11
|
+
├── lib/gloo/
|
|
12
|
+
│ ├── core/ Parser, Obj base class, Dictionary, path names (PN)
|
|
13
|
+
│ ├── exec/ Execution engine, dispatcher, runner
|
|
14
|
+
│ ├── expr/ Expression evaluator and operators
|
|
15
|
+
│ ├── objs/ Object type implementations
|
|
16
|
+
│ │ ├── basic/ string, int, bool, container, text, decimal, untyped, alias
|
|
17
|
+
│ │ ├── ctrl/ script, function (ƒ), each, repeat
|
|
18
|
+
│ │ ├── dt/ date, time, datetime
|
|
19
|
+
│ │ ├── str_utils/
|
|
20
|
+
│ │ ├── system/ ruby, file_handle, system
|
|
21
|
+
│ │ └── web/ http_get, http_post, json, uri, erb
|
|
22
|
+
│ ├── verbs/ One file per verb (28 total)
|
|
23
|
+
│ ├── persist/ File loading/saving
|
|
24
|
+
│ ├── convert/ Type conversion
|
|
25
|
+
│ └── plugin/ Plugin system
|
|
26
|
+
├── test/ Ruby unit tests (minitest)
|
|
27
|
+
└── test.gloo/ Gloo-language integration tests
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Test Suites
|
|
31
|
+
|
|
32
|
+
### Ruby unit tests — `test/`
|
|
33
|
+
Run with: `rake test`
|
|
34
|
+
|
|
35
|
+
File naming: `test/<area>/<name>_test.rb`
|
|
36
|
+
Structure mirrors `lib/gloo/` — a test file per class/verb.
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
test/
|
|
40
|
+
├── verbs/ One *_test.rb per verb
|
|
41
|
+
├── objs/basic/ One *_test.rb per object type
|
|
42
|
+
├── objs/ctrl/
|
|
43
|
+
├── objs/dt/
|
|
44
|
+
├── core/
|
|
45
|
+
├── exec/
|
|
46
|
+
├── expr/
|
|
47
|
+
└── ...
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Base classes: inherit from `GlooTest` (defined in `test/base_test.rb`).
|
|
51
|
+
|
|
52
|
+
### Gloo integration tests — `test.gloo/`
|
|
53
|
+
Written in gloo itself. Each file contains `[test]` objects with `on_test` scripts using `assert` and `refute`.
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
test.gloo/
|
|
57
|
+
├── basic.test.gloo
|
|
58
|
+
├── dt/
|
|
59
|
+
├── lang/
|
|
60
|
+
├── math/
|
|
61
|
+
├── objs/
|
|
62
|
+
├── string/
|
|
63
|
+
└── verbs/
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Test object pattern:
|
|
67
|
+
```gloo
|
|
68
|
+
tests [can] :
|
|
69
|
+
group [can] :
|
|
70
|
+
my_test [test] :
|
|
71
|
+
description [string] : What this verifies
|
|
72
|
+
on_test [script] :
|
|
73
|
+
# ... setup ...
|
|
74
|
+
eval some.value = expected
|
|
75
|
+
assert "description of passing condition"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Adding a Missing Unit Test
|
|
79
|
+
|
|
80
|
+
1. Find the relevant `test/<area>/*_test.rb` file (or create one mirroring the `lib/` path)
|
|
81
|
+
2. Inherit from `GlooTest`
|
|
82
|
+
3. Run the full suite with `rake test` to verify nothing is broken
|
|
83
|
+
4. Check `test.gloo/` to see if a corresponding gloo-level integration test is also needed
|
data/lib/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
5.3.
|
|
1
|
+
5.3.9
|
data/lib/VERSION_NOTES
CHANGED
|
@@ -111,6 +111,7 @@ module Gloo
|
|
|
111
111
|
return true
|
|
112
112
|
end
|
|
113
113
|
|
|
114
|
+
|
|
114
115
|
# ---------------------------------------------------------------------
|
|
115
116
|
# Children
|
|
116
117
|
# ---------------------------------------------------------------------
|
|
@@ -122,6 +123,7 @@ module Gloo
|
|
|
122
123
|
return false
|
|
123
124
|
end
|
|
124
125
|
|
|
126
|
+
|
|
125
127
|
# ---------------------------------------------------------------------
|
|
126
128
|
# Messages
|
|
127
129
|
# ---------------------------------------------------------------------
|
|
@@ -187,6 +189,7 @@ module Gloo
|
|
|
187
189
|
return @engine.settings.log_path
|
|
188
190
|
end
|
|
189
191
|
|
|
192
|
+
|
|
190
193
|
# ---------------------------------------------------------------------
|
|
191
194
|
# Special chars
|
|
192
195
|
# ---------------------------------------------------------------------
|
|
@@ -196,6 +199,7 @@ module Gloo
|
|
|
196
199
|
return "\n"
|
|
197
200
|
end
|
|
198
201
|
|
|
202
|
+
|
|
199
203
|
# ---------------------------------------------------------------------
|
|
200
204
|
# Screen Messages
|
|
201
205
|
# ---------------------------------------------------------------------
|
|
@@ -210,6 +214,7 @@ module Gloo
|
|
|
210
214
|
return Gloo::App::Settings.cols( @engine )
|
|
211
215
|
end
|
|
212
216
|
|
|
217
|
+
|
|
213
218
|
# ---------------------------------------------------------------------
|
|
214
219
|
# Platform Messages
|
|
215
220
|
# ---------------------------------------------------------------------
|
|
@@ -249,6 +254,24 @@ module Gloo
|
|
|
249
254
|
return OS.mac?
|
|
250
255
|
end
|
|
251
256
|
|
|
257
|
+
# Is the platform WSL on Windows?
|
|
258
|
+
def msg_platform_wsl?
|
|
259
|
+
return self.class.wsl?
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
#
|
|
263
|
+
# Is the platform WSL on Windows?
|
|
264
|
+
#
|
|
265
|
+
def self.wsl?
|
|
266
|
+
return false unless OS.linux?
|
|
267
|
+
|
|
268
|
+
ENV.key?('WSL_DISTRO_NAME') ||
|
|
269
|
+
ENV.key?('WSL_INTEROP') ||
|
|
270
|
+
File.read('/proc/sys/kernel/osrelease').downcase.include?('microsoft')
|
|
271
|
+
rescue
|
|
272
|
+
return false
|
|
273
|
+
end
|
|
274
|
+
|
|
252
275
|
#
|
|
253
276
|
# Get the command to open a file on this platform.
|
|
254
277
|
#
|
|
@@ -257,6 +280,7 @@ module Gloo
|
|
|
257
280
|
return 'xdg-open' if OS.posix?
|
|
258
281
|
|
|
259
282
|
return 'Start-Process' if OS.windows?
|
|
283
|
+
return 'explorer.exe' if self.wsl?
|
|
260
284
|
|
|
261
285
|
return nil
|
|
262
286
|
end
|
|
@@ -37,7 +37,7 @@ module Gloo
|
|
|
37
37
|
# Get a list of message names that this object receives.
|
|
38
38
|
#
|
|
39
39
|
def self.messages
|
|
40
|
-
basic = %w[read write delete get_name get_ext get_parent get_sha256]
|
|
40
|
+
basic = %w[read write append delete get_name get_ext get_parent get_sha256]
|
|
41
41
|
checks = %w[exists? is_file? is_dir? mkdir]
|
|
42
42
|
search = %w[find_match]
|
|
43
43
|
show = %w[show page open]
|
|
@@ -89,6 +89,23 @@ module Gloo
|
|
|
89
89
|
end
|
|
90
90
|
end
|
|
91
91
|
|
|
92
|
+
#
|
|
93
|
+
# Append the given data to the file as a new line.
|
|
94
|
+
# Adds a leading newline if the file does not already end with one.
|
|
95
|
+
#
|
|
96
|
+
def msg_append
|
|
97
|
+
data = ''
|
|
98
|
+
return unless value
|
|
99
|
+
|
|
100
|
+
if @params&.token_count&.positive?
|
|
101
|
+
expr = Gloo::Expr::Expression.new( @engine, @params.tokens )
|
|
102
|
+
data = expr.evaluate
|
|
103
|
+
end
|
|
104
|
+
existing = File.exist?( value ) ? File.read( value ) : ''
|
|
105
|
+
prefix = existing.empty? || existing.end_with?( "\n" ) ? '' : "\n"
|
|
106
|
+
File.open( value, 'a' ) { |f| f.puts "#{prefix}#{data}" }
|
|
107
|
+
end
|
|
108
|
+
|
|
92
109
|
#
|
|
93
110
|
# Write the given data out to the file.
|
|
94
111
|
#
|
data/lib/gloo/objs/web/uri.rb
CHANGED
|
@@ -149,15 +149,22 @@ module Gloo
|
|
|
149
149
|
#
|
|
150
150
|
# Open the given URL with platform command.
|
|
151
151
|
#
|
|
152
|
+
# NOTE that this was using "cmd = Gloo::Core::GlooSystem.open_for_platform"
|
|
153
|
+
# but refactored because on windows the command is more complex.
|
|
154
|
+
#
|
|
152
155
|
def self.open_url( url, engine=nil )
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
case
|
|
157
|
+
when OS.windows?
|
|
158
|
+
system( "powershell", "-Command", "Start-Process", url )
|
|
159
|
+
when OS.mac?
|
|
160
|
+
`open "#{url}"`
|
|
161
|
+
when OS.linux?
|
|
162
|
+
if Gloo::Core::GlooSystem.wsl?
|
|
163
|
+
`explorer.exe "#{url}"`
|
|
164
|
+
else
|
|
165
|
+
`xdg-open "#{url}"`
|
|
166
|
+
end
|
|
158
167
|
else
|
|
159
|
-
# This does not work in Linux or in WSL on Windows:
|
|
160
|
-
# exec cmd_with_param
|
|
161
168
|
engine.log.warn 'Opening URL not supported on this platform.' if engine
|
|
162
169
|
end
|
|
163
170
|
end
|
|
@@ -89,3 +89,18 @@ tests [can] :
|
|
|
89
89
|
put $.screen_cols into ^.i
|
|
90
90
|
eval ^.i > 0
|
|
91
91
|
assert "expected screen_cols to be greater than 0"
|
|
92
|
+
|
|
93
|
+
get_platform_os [test] :
|
|
94
|
+
description [string] : Get the platform OS.
|
|
95
|
+
on_test [script] :
|
|
96
|
+
eval $.platform_mac? = true
|
|
97
|
+
assert "expected platform_mac to be true"
|
|
98
|
+
|
|
99
|
+
eval $.platform_windows? = false
|
|
100
|
+
assert "expected platform_windows to be false"
|
|
101
|
+
|
|
102
|
+
eval $.platform_linux? = false
|
|
103
|
+
assert "expected platform_linux to be false"
|
|
104
|
+
|
|
105
|
+
eval $.platform_wsl? = false
|
|
106
|
+
assert "expected platform_wsl to be false"
|
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.9
|
|
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-06-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -263,6 +263,7 @@ files:
|
|
|
263
263
|
- ".ruby-gemset"
|
|
264
264
|
- ".ruby-version"
|
|
265
265
|
- ".travis.yml"
|
|
266
|
+
- CLAUDE.md
|
|
266
267
|
- CODE_OF_CONDUCT.md
|
|
267
268
|
- Gemfile
|
|
268
269
|
- LICENSE.txt
|