gloo 3.4.1 → 3.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/VERSION +1 -1
- data/lib/VERSION_NOTES +8 -0
- data/lib/gloo/app/args.rb +2 -2
- data/lib/gloo/app/engine.rb +21 -2
- data/lib/gloo/convert/converter.rb +1 -2
- data/lib/gloo/core/dictionary.rb +1 -1
- data/lib/gloo/core/event_manager.rb +19 -0
- data/lib/gloo/core/factory.rb +2 -2
- data/lib/gloo/core/gloo_system.rb +1 -1
- data/lib/gloo/core/obj.rb +47 -5
- data/lib/gloo/core/parser.rb +1 -1
- data/lib/gloo/core/pn.rb +1 -1
- data/lib/gloo/exec/dispatch.rb +17 -0
- data/lib/gloo/exec/runner.rb +1 -1
- data/lib/gloo/objs/data/mysql.rb +2 -2
- data/lib/gloo/objs/data/pg.rb +1 -1
- data/lib/gloo/objs/data/query.rb +2 -2
- data/lib/gloo/objs/data/query_result.rb +6 -1
- data/lib/gloo/objs/data/sqlite.rb +1 -1
- data/lib/gloo/objs/data/table.rb +2 -2
- data/lib/gloo/objs/ror/eval.rb +1 -1
- data/lib/gloo/objs/security/password.rb +5 -8
- data/lib/gloo/objs/web_svr/element.rb +1 -1
- data/lib/gloo/objs/web_svr/page.rb +1 -1
- data/lib/gloo/objs/web_svr/svr.rb +8 -3
- data/lib/gloo/persist/file_loader.rb +1 -1
- data/lib/gloo/persist/file_storage.rb +1 -1
- data/lib/gloo/verbs/check.rb +54 -0
- data/lib/gloo/verbs/redirect.rb +1 -0
- data/lib/gloo/verbs/tell.rb +11 -36
- data/lib/gloo/web_svr/handler.rb +3 -1
- data/lib/gloo/web_svr/request.rb +2 -2
- 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: b527dd8c4837506689358a05681e7e81ba5804aeb617815db80e014a6f0f381b
|
4
|
+
data.tar.gz: 9d0d089ff54f1c669ee3b1009411e8a0310ed01792b008946f3fee8feff89313
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0632bc38a33051cbe970e0f29e01fac34d29ad9988df31773518c5cdc4d501a9462ff9a3c17fd54fa5db8b5c5326fa890eb8a1d395d7dedef057b5e41da16fc
|
7
|
+
data.tar.gz: 6370739e3e635f6659ed5f28c62fd7d858cd8cb7b02e2115c29119434b8459e5cdb78dc9d1f3a547424425e41242d000216b9f89899734aa7d1e9206b4282662
|
data/lib/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.5.0
|
data/lib/VERSION_NOTES
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
3.5.0 - 2024.10.18
|
2
|
+
- check obj for message alternate to tell
|
3
|
+
- new base object messages
|
4
|
+
- fixes issue with single row returned from query
|
5
|
+
- adds on_error event
|
6
|
+
- use aliases in pwd obj
|
7
|
+
|
8
|
+
|
1
9
|
3.4.1 - 2024.09.23
|
2
10
|
- Removes old, unused sound objects
|
3
11
|
- Adds support for lib folder in gloo rather than in the project folder
|
data/lib/gloo/app/args.rb
CHANGED
@@ -51,12 +51,12 @@ module Gloo
|
|
51
51
|
return true unless app?
|
52
52
|
|
53
53
|
if @app_path.nil?
|
54
|
-
@engine.
|
54
|
+
@engine.err "App Path required to run in App mode."
|
55
55
|
return false
|
56
56
|
end
|
57
57
|
|
58
58
|
unless File.directory? @app_path
|
59
|
-
@engine.
|
59
|
+
@engine.err "'#{@app_path}' is not a valid directory."
|
60
60
|
return false
|
61
61
|
end
|
62
62
|
|
data/lib/gloo/app/engine.rb
CHANGED
@@ -201,7 +201,7 @@ module Gloo
|
|
201
201
|
begin
|
202
202
|
@parser.run @last_cmd
|
203
203
|
rescue => e
|
204
|
-
|
204
|
+
log_exception e
|
205
205
|
end
|
206
206
|
end
|
207
207
|
|
@@ -282,11 +282,30 @@ module Gloo
|
|
282
282
|
# Report an error.
|
283
283
|
# Write it to the log and set the heap error value.
|
284
284
|
#
|
285
|
-
def err( msg )
|
285
|
+
def err( msg, backtrace=nil )
|
286
286
|
@log.error msg
|
287
287
|
@heap.error.set_to msg
|
288
|
+
|
289
|
+
@event_manager.on_error( msg, backtrace)
|
288
290
|
end
|
289
291
|
|
292
|
+
#
|
293
|
+
# Log an exception.
|
294
|
+
# This function does not log the full backtrace, but
|
295
|
+
# does write part of it to the log.
|
296
|
+
#
|
297
|
+
def log_exception ex
|
298
|
+
# Get the stack trace, and if needed truncate to fit.
|
299
|
+
msg_lines = ex.backtrace
|
300
|
+
if msg_lines.count > 27
|
301
|
+
msg_lines = msg_lines[0..13] + [ '... truncated ...' ] + msg_lines[-13..-1]
|
302
|
+
end
|
303
|
+
backtrace = msg_lines.join( "\n" )
|
304
|
+
@log.error backtrace
|
305
|
+
|
306
|
+
err( ex.message, backtrace)
|
307
|
+
end
|
308
|
+
|
290
309
|
end
|
291
310
|
end
|
292
311
|
end
|
data/lib/gloo/core/dictionary.rb
CHANGED
@@ -72,6 +72,25 @@ module Gloo
|
|
72
72
|
arr.each { |o| Gloo::Exec::Dispatch.message( @engine, 'run', o ) }
|
73
73
|
end
|
74
74
|
|
75
|
+
#
|
76
|
+
# Run the on_error scripts in any open objects.
|
77
|
+
# For each on_error script found, look for the error_data container
|
78
|
+
# and set the error message and backtrace.
|
79
|
+
#
|
80
|
+
def on_error msg, backtrace
|
81
|
+
@engine.log.debug 'on_error event'
|
82
|
+
arr = Gloo::Core::ObjFinder.by_name( @engine, 'on_error' )
|
83
|
+
arr.each do |o|
|
84
|
+
data = o.parent.find_child 'error_data'
|
85
|
+
if data
|
86
|
+
data.find_child( 'message' ).set_value msg
|
87
|
+
data.find_child( 'backtrace' ).set_value backtrace
|
88
|
+
end
|
89
|
+
|
90
|
+
Gloo::Exec::Dispatch.message( @engine, 'run', o )
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
75
94
|
end
|
76
95
|
end
|
77
96
|
end
|
data/lib/gloo/core/factory.rb
CHANGED
@@ -164,7 +164,7 @@ module Gloo
|
|
164
164
|
#
|
165
165
|
def create_new( name, value, type, parent )
|
166
166
|
unless parent
|
167
|
-
@engine.
|
167
|
+
@engine.err "Could not create object. Bad path: #{name}"
|
168
168
|
return nil
|
169
169
|
end
|
170
170
|
|
@@ -202,7 +202,7 @@ module Gloo
|
|
202
202
|
end
|
203
203
|
|
204
204
|
unless t.can_create?
|
205
|
-
@engine.
|
205
|
+
@engine.err "'#{type_name}' cannot be created."
|
206
206
|
return nil
|
207
207
|
end
|
208
208
|
|
data/lib/gloo/core/obj.rb
CHANGED
@@ -216,6 +216,30 @@ module Gloo
|
|
216
216
|
return nil
|
217
217
|
end
|
218
218
|
|
219
|
+
#
|
220
|
+
# Find a child, resolve any alias references.
|
221
|
+
# This returns the object, not the value.
|
222
|
+
#
|
223
|
+
def find_child_resolve_alias( name )
|
224
|
+
o = find_child name
|
225
|
+
return nil unless o
|
226
|
+
|
227
|
+
o = Gloo::Objs::Alias.resolve_alias( @engine, o )
|
228
|
+
return o
|
229
|
+
end
|
230
|
+
|
231
|
+
#
|
232
|
+
# Find a child, resolve any alias references,
|
233
|
+
# and return the object's value.
|
234
|
+
#
|
235
|
+
def find_child_value( name )
|
236
|
+
o = find_child name
|
237
|
+
return nil unless o
|
238
|
+
|
239
|
+
o = Gloo::Objs::Alias.resolve_alias( @engine, o )
|
240
|
+
return o&.value
|
241
|
+
end
|
242
|
+
|
219
243
|
#
|
220
244
|
# Get the index of the child with the given name.
|
221
245
|
#
|
@@ -264,7 +288,7 @@ module Gloo
|
|
264
288
|
# Get a list of message names that this object receives.
|
265
289
|
#
|
266
290
|
def self.messages
|
267
|
-
return %w[reload unload]
|
291
|
+
return %w[reload unload blank? contains?]
|
268
292
|
end
|
269
293
|
|
270
294
|
#
|
@@ -282,7 +306,7 @@ module Gloo
|
|
282
306
|
@params = params
|
283
307
|
return self.dispatch msg if self.can_receive_message? msg
|
284
308
|
|
285
|
-
@engine.
|
309
|
+
@engine.err "Object #{self.name} cannot receive message #{msg}"
|
286
310
|
return false
|
287
311
|
end
|
288
312
|
|
@@ -295,7 +319,7 @@ module Gloo
|
|
295
319
|
self.public_send( o )
|
296
320
|
return true
|
297
321
|
else
|
298
|
-
@engine.
|
322
|
+
@engine.err "Message #{msg} not implemented"
|
299
323
|
return false
|
300
324
|
end
|
301
325
|
end
|
@@ -305,7 +329,7 @@ module Gloo
|
|
305
329
|
#
|
306
330
|
def msg_unload
|
307
331
|
if self.root?
|
308
|
-
@engine.
|
332
|
+
@engine.err 'Cannot unload the root object.'
|
309
333
|
return
|
310
334
|
end
|
311
335
|
|
@@ -318,13 +342,31 @@ module Gloo
|
|
318
342
|
#
|
319
343
|
def msg_reload
|
320
344
|
if self.root?
|
321
|
-
@engine.
|
345
|
+
@engine.err 'Cannot reload the root object.'
|
322
346
|
return
|
323
347
|
end
|
324
348
|
|
325
349
|
@engine.persist_man.reload self
|
326
350
|
end
|
327
351
|
|
352
|
+
#
|
353
|
+
# Check to see if the value is blank.
|
354
|
+
#
|
355
|
+
def msg_blank?
|
356
|
+
val_blank = value.blank?
|
357
|
+
@engine.heap.it.set_to val_blank
|
358
|
+
return val_blank
|
359
|
+
end
|
360
|
+
|
361
|
+
#
|
362
|
+
# Check to see if there are children.
|
363
|
+
#
|
364
|
+
def msg_contains?
|
365
|
+
has_children = child_count.positive?
|
366
|
+
@engine.heap.it.set_to has_children
|
367
|
+
return has_children
|
368
|
+
end
|
369
|
+
|
328
370
|
|
329
371
|
# ---------------------------------------------------------------------
|
330
372
|
# Render
|
data/lib/gloo/core/parser.rb
CHANGED
data/lib/gloo/core/pn.rb
CHANGED
data/lib/gloo/exec/dispatch.rb
CHANGED
@@ -12,6 +12,23 @@ module Gloo
|
|
12
12
|
module Exec
|
13
13
|
class Dispatch
|
14
14
|
|
15
|
+
OBJ_NOT_FOUND_ERR = 'Object was not found: '.freeze
|
16
|
+
|
17
|
+
#
|
18
|
+
# Send a message to an object of a given name (and path).
|
19
|
+
# Once the object is found, the message is dispatched.
|
20
|
+
#
|
21
|
+
def self.send_message( engine, msg, to_obj_pn, params = nil )
|
22
|
+
pn = Gloo::Core::Pn.new( engine, to_obj_pn )
|
23
|
+
target_obj = pn.resolve
|
24
|
+
|
25
|
+
unless target_obj
|
26
|
+
engine.err "#{OBJ_NOT_FOUND_ERR} #{to_obj_pn}"
|
27
|
+
return
|
28
|
+
end
|
29
|
+
Gloo::Exec::Dispatch.message( engine, msg, target_obj, params )
|
30
|
+
end
|
31
|
+
|
15
32
|
#
|
16
33
|
# Dispatch the given message to the given object.
|
17
34
|
#
|
data/lib/gloo/exec/runner.rb
CHANGED
data/lib/gloo/objs/data/mysql.rb
CHANGED
@@ -160,7 +160,7 @@ module Gloo
|
|
160
160
|
|
161
161
|
heads = rs.fields if rs
|
162
162
|
rescue => e
|
163
|
-
@engine.
|
163
|
+
@engine.log_exception e
|
164
164
|
end
|
165
165
|
|
166
166
|
return [ heads, data ]
|
@@ -242,7 +242,7 @@ module Gloo
|
|
242
242
|
}
|
243
243
|
Mysql2::Client.new( h )
|
244
244
|
rescue => e
|
245
|
-
@engine.
|
245
|
+
@engine.log_exception e
|
246
246
|
@engine.heap.it.set_to false
|
247
247
|
return false
|
248
248
|
end
|
data/lib/gloo/objs/data/pg.rb
CHANGED
data/lib/gloo/objs/data/query.rb
CHANGED
@@ -81,7 +81,7 @@ module Gloo
|
|
81
81
|
result = db.query( sql_value, param_array )
|
82
82
|
process_result( result, db )
|
83
83
|
rescue => e
|
84
|
-
@engine.
|
84
|
+
@engine.log_exception e
|
85
85
|
return
|
86
86
|
end
|
87
87
|
end
|
@@ -105,7 +105,7 @@ module Gloo
|
|
105
105
|
app.add_db_time elapsed if app
|
106
106
|
return result
|
107
107
|
rescue => e
|
108
|
-
@engine.
|
108
|
+
@engine.log_exception e
|
109
109
|
return
|
110
110
|
end
|
111
111
|
end
|
@@ -33,8 +33,13 @@ module Gloo
|
|
33
33
|
|
34
34
|
#
|
35
35
|
# Does the data contain a single row?
|
36
|
+
# OR, if the result is empty, return false.
|
36
37
|
#
|
37
38
|
def single_row_result?
|
39
|
+
if @result_can && ( @result_can.child_count == 0 )
|
40
|
+
return false
|
41
|
+
end
|
42
|
+
|
38
43
|
return @data.count == 1
|
39
44
|
end
|
40
45
|
|
@@ -108,7 +113,7 @@ module Gloo
|
|
108
113
|
def update_single_row
|
109
114
|
row = @data[0]
|
110
115
|
@heads.each_with_index do |h, i|
|
111
|
-
child = @result_can.find_child h
|
116
|
+
child = @result_can.find_child h
|
112
117
|
child.set_value row[i] if child
|
113
118
|
end
|
114
119
|
end
|
data/lib/gloo/objs/data/table.rb
CHANGED
@@ -67,7 +67,7 @@ module Gloo
|
|
67
67
|
result = o.run_query
|
68
68
|
return result
|
69
69
|
rescue => e
|
70
|
-
@engine.
|
70
|
+
@engine.log_exception e
|
71
71
|
return nil
|
72
72
|
end
|
73
73
|
else
|
@@ -196,7 +196,7 @@ module Gloo
|
|
196
196
|
helper = Gloo::WebSvr::TableRenderer.new( @engine )
|
197
197
|
return helper.data_to_table params
|
198
198
|
rescue => e
|
199
|
-
@engine.
|
199
|
+
@engine.log_exception e
|
200
200
|
return nil
|
201
201
|
end
|
202
202
|
end
|
data/lib/gloo/objs/ror/eval.rb
CHANGED
@@ -39,8 +39,7 @@ module Gloo
|
|
39
39
|
# Returns nil if there is none.
|
40
40
|
#
|
41
41
|
def salt
|
42
|
-
|
43
|
-
return o&.value
|
42
|
+
return find_child_value SALT
|
44
43
|
end
|
45
44
|
|
46
45
|
#
|
@@ -48,15 +47,14 @@ module Gloo
|
|
48
47
|
# Returns nil if there is none.
|
49
48
|
#
|
50
49
|
def password
|
51
|
-
|
52
|
-
return o&.value
|
50
|
+
return find_child_value PASSWORD
|
53
51
|
end
|
54
52
|
|
55
53
|
#
|
56
54
|
# Update the password value.
|
57
55
|
#
|
58
56
|
def update_password( new_pwd )
|
59
|
-
o =
|
57
|
+
o = find_child_resolve_alias PASSWORD
|
60
58
|
return unless o
|
61
59
|
|
62
60
|
o.set_value new_pwd
|
@@ -74,15 +72,14 @@ module Gloo
|
|
74
72
|
# Returns nil if there is none.
|
75
73
|
#
|
76
74
|
def hash
|
77
|
-
|
78
|
-
return o&.value
|
75
|
+
return find_child_value HASH
|
79
76
|
end
|
80
77
|
|
81
78
|
#
|
82
79
|
# Update the hashed password value.
|
83
80
|
#
|
84
81
|
def update_hash( new_hash )
|
85
|
-
o =
|
82
|
+
o = find_child_resolve_alias HASH
|
86
83
|
return unless o
|
87
84
|
|
88
85
|
o.set_value new_hash
|
@@ -50,6 +50,7 @@ module Gloo
|
|
50
50
|
CODE = 'code'.freeze
|
51
51
|
ELAPSED = 'elapsed'.freeze
|
52
52
|
DB = 'db'.freeze
|
53
|
+
PAGE = 'page'.freeze
|
53
54
|
|
54
55
|
# Container with pages in the web app.
|
55
56
|
PAGES = 'pages'.freeze
|
@@ -426,7 +427,7 @@ module Gloo
|
|
426
427
|
@engine.stop_running_app
|
427
428
|
# The running app will call the stop function (below)
|
428
429
|
else
|
429
|
-
@engine.
|
430
|
+
@engine.err SERVER_NOT_RUNNING
|
430
431
|
end
|
431
432
|
end
|
432
433
|
|
@@ -437,7 +438,7 @@ module Gloo
|
|
437
438
|
if @router
|
438
439
|
@router.show_routes
|
439
440
|
else
|
440
|
-
@engine.
|
441
|
+
@engine.err SERVER_NOT_RUNNING
|
441
442
|
end
|
442
443
|
end
|
443
444
|
|
@@ -558,7 +559,7 @@ module Gloo
|
|
558
559
|
# This is done after the page is rendered and before
|
559
560
|
# the on_response event is fired.
|
560
561
|
#
|
561
|
-
def set_response_data( request, response )
|
562
|
+
def set_response_data( request, response, page_obj=nil )
|
562
563
|
data = find_child RESPONSE_DATA
|
563
564
|
return unless data
|
564
565
|
data = Gloo::Objs::Alias.resolve_alias( @engine, data )
|
@@ -567,6 +568,10 @@ module Gloo
|
|
567
568
|
data.find_child( DB )&.set_value( request.db )
|
568
569
|
data.find_child( TYPE )&.set_value( response.type )
|
569
570
|
data.find_child( CODE )&.set_value( response.code )
|
571
|
+
|
572
|
+
if page_obj
|
573
|
+
data.find_child( PAGE )&.set_value( page_obj.pn )
|
574
|
+
end
|
570
575
|
end
|
571
576
|
|
572
577
|
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# Author:: Eric Crane (mailto:eric.crane@mac.com)
|
2
|
+
# Copyright:: Copyright (c) 2024 Eric Crane. All rights reserved.
|
3
|
+
#
|
4
|
+
# Alternate version of the Tell verb.
|
5
|
+
# Reads better to check object conditions.
|
6
|
+
#
|
7
|
+
|
8
|
+
module Gloo
|
9
|
+
module Verbs
|
10
|
+
class Check < Gloo::Core::Verb
|
11
|
+
|
12
|
+
KEYWORD = 'check'.freeze
|
13
|
+
KEYWORD_SHORT = '<-'.freeze
|
14
|
+
FOR = 'for'.freeze
|
15
|
+
UNKNOWN_MSG_ERR = 'Missing message!'.freeze
|
16
|
+
|
17
|
+
#
|
18
|
+
# Run the verb.
|
19
|
+
#
|
20
|
+
def run
|
21
|
+
msg = @tokens.after_token( FOR )
|
22
|
+
|
23
|
+
unless msg
|
24
|
+
@engine.err( UNKNOWN_MSG_ERR )
|
25
|
+
return
|
26
|
+
end
|
27
|
+
|
28
|
+
Gloo::Exec::Dispatch.send_message(
|
29
|
+
@engine, msg, @tokens.second, @params )
|
30
|
+
end
|
31
|
+
|
32
|
+
#
|
33
|
+
# Get the Verb's keyword.
|
34
|
+
#
|
35
|
+
def self.keyword
|
36
|
+
return KEYWORD
|
37
|
+
end
|
38
|
+
|
39
|
+
#
|
40
|
+
# Get the Verb's keyword shortcut.
|
41
|
+
#
|
42
|
+
def self.keyword_shortcut
|
43
|
+
return KEYWORD_SHORT
|
44
|
+
end
|
45
|
+
|
46
|
+
# ---------------------------------------------------------------------
|
47
|
+
# Private functions
|
48
|
+
# ---------------------------------------------------------------------
|
49
|
+
|
50
|
+
private
|
51
|
+
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
data/lib/gloo/verbs/redirect.rb
CHANGED
data/lib/gloo/verbs/tell.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
# Author:: Eric Crane (mailto:eric.crane@mac.com)
|
2
2
|
# Copyright:: Copyright (c) 2019 Eric Crane. All rights reserved.
|
3
3
|
#
|
4
|
-
#
|
4
|
+
# Send a message to an object.
|
5
|
+
# Tell the object to do some known action.
|
6
|
+
# Also see the Check verb.
|
5
7
|
#
|
6
8
|
|
7
9
|
module Gloo
|
@@ -11,18 +13,21 @@ module Gloo
|
|
11
13
|
KEYWORD = 'tell'.freeze
|
12
14
|
KEYWORD_SHORT = '->'.freeze
|
13
15
|
TO = 'to'.freeze
|
14
|
-
OBJ_NOT_FOUND_ERR = 'Object was not found: '.freeze
|
15
16
|
UNKNOWN_MSG_ERR = 'Missing message!'.freeze
|
16
17
|
|
17
18
|
#
|
18
19
|
# Run the verb.
|
19
20
|
#
|
20
21
|
def run
|
21
|
-
|
22
|
-
return unless @msg
|
22
|
+
msg = @tokens.after_token( TO )
|
23
23
|
|
24
|
-
|
25
|
-
|
24
|
+
unless msg
|
25
|
+
@engine.err( UNKNOWN_MSG_ERR )
|
26
|
+
return
|
27
|
+
end
|
28
|
+
|
29
|
+
Gloo::Exec::Dispatch.send_message(
|
30
|
+
@engine, msg, @tokens.second, @params )
|
26
31
|
end
|
27
32
|
|
28
33
|
#
|
@@ -45,36 +50,6 @@ module Gloo
|
|
45
50
|
|
46
51
|
private
|
47
52
|
|
48
|
-
#
|
49
|
-
# Lookup the message to send.
|
50
|
-
#
|
51
|
-
def setup_msg
|
52
|
-
@msg = @tokens.after_token( TO )
|
53
|
-
|
54
|
-
@engine.err( UNKNOWN_MSG_ERR ) unless @msg
|
55
|
-
end
|
56
|
-
|
57
|
-
#
|
58
|
-
# Setup the target of the message.
|
59
|
-
#
|
60
|
-
def setup_target
|
61
|
-
@obj_name = @tokens.second
|
62
|
-
pn = Gloo::Core::Pn.new( @engine, @obj_name )
|
63
|
-
@target_obj = pn.resolve
|
64
|
-
end
|
65
|
-
|
66
|
-
#
|
67
|
-
# Dispatch the message to the target object.
|
68
|
-
#
|
69
|
-
def dispatch_msg
|
70
|
-
if @target_obj
|
71
|
-
Gloo::Exec::Dispatch.message(
|
72
|
-
@engine, @msg, @target_obj, @params )
|
73
|
-
else
|
74
|
-
@engine.err "#{OBJ_NOT_FOUND_ERR} #{@obj_name}"
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
53
|
end
|
79
54
|
end
|
80
55
|
end
|
data/lib/gloo/web_svr/handler.rb
CHANGED
@@ -35,6 +35,7 @@ module Gloo
|
|
35
35
|
#
|
36
36
|
def handle request
|
37
37
|
@request = request
|
38
|
+
page_obj = nil
|
38
39
|
|
39
40
|
page, id = @server_obj.router.page_for_route( @request.path, @request.method )
|
40
41
|
@engine.log.debug "Found Page: #{page&.name}" if page
|
@@ -44,12 +45,13 @@ module Gloo
|
|
44
45
|
result = handle_file page
|
45
46
|
else
|
46
47
|
result = handle_page page
|
48
|
+
page_obj = page
|
47
49
|
end
|
48
50
|
else
|
49
51
|
result = server_error_result
|
50
52
|
end
|
51
53
|
|
52
|
-
return result
|
54
|
+
return result, page_obj
|
53
55
|
end
|
54
56
|
|
55
57
|
#
|
data/lib/gloo/web_svr/request.rb
CHANGED
@@ -60,11 +60,11 @@ module Gloo
|
|
60
60
|
@handler.server_obj.set_request_data self
|
61
61
|
@handler.server_obj.run_on_request
|
62
62
|
|
63
|
-
result = @handler.handle self
|
63
|
+
result, page_obj = @handler.handle self
|
64
64
|
finish_timer
|
65
65
|
|
66
66
|
# Run the on_response script if there is one.
|
67
|
-
@handler.server_obj.set_response_data self, result
|
67
|
+
@handler.server_obj.set_response_data( self, result, page_obj )
|
68
68
|
@handler.server_obj.run_on_response
|
69
69
|
|
70
70
|
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: 3.
|
4
|
+
version: 3.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Crane
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -483,6 +483,7 @@ files:
|
|
483
483
|
- lib/gloo/verbs/alert.rb
|
484
484
|
- lib/gloo/verbs/beep.rb
|
485
485
|
- lib/gloo/verbs/break.rb
|
486
|
+
- lib/gloo/verbs/check.rb
|
486
487
|
- lib/gloo/verbs/cls.rb
|
487
488
|
- lib/gloo/verbs/context.rb
|
488
489
|
- lib/gloo/verbs/create.rb
|