gloo 4.5.0 → 4.6.1

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: c0cb1d5428d6f7d2de892b588de73cef44bded6418fd69929d966e25c14a32d9
4
- data.tar.gz: bff713e6cc80fab161f0d0070ecfd04c8a1481faa5086d399982e1bfe91bfb03
3
+ metadata.gz: 83c998e950da4cdd0f74ce85512de237f9fd73bc9187fe55b49c6bb554e13bc1
4
+ data.tar.gz: 07e00df49aea7385673b27c5cb31cc6e5d4f926cebabe7f14d754a04e3eae949
5
5
  SHA512:
6
- metadata.gz: b20fdac6c4dee94e91075e2e72caefc2e448ddeb6198a2e7470b3af8edb0069211ca9d5f425d1cf2fc1149a9c84778b7008d6148528fd2a91c28e4cb6ced48d6
7
- data.tar.gz: ca7be6a02372200e9773279b769aaa46aef2df6a8e577cc5446fc7e2af48571fd5a721f68f6c27eeffe37d0c057635544de181502feea9b371400c35e60e7d4c
6
+ metadata.gz: a0ed6794423d73bb4adaf913662cf28dd9095ea07b1885feb422384cd394acbafbd362da0b60d4384a04f44ca49b1a1c4a3a9d4f84f9caa8fb48b5bbf74e0380
7
+ data.tar.gz: 6cd54ec494fff41b92e9fb8788ae0e6c76b412ae2eba2a0ae8fe466ecfc45936743bf3d08d37e2a9cf02bf8d4905cc3ba8d60dd7d11d2fec7bbe8ac520c7861b
data/lib/VERSION CHANGED
@@ -1 +1 @@
1
- 4.5.0
1
+ 4.6.1
data/lib/VERSION_NOTES CHANGED
@@ -1,3 +1,11 @@
1
+ 4.6.1 - 2025.09.25
2
+ - Adds container support to object to JSON conversion.
3
+
4
+
5
+ 4.6.0 - 2025.08.24
6
+ - Adds option to render inline file data (rather than a file on disk)
7
+
8
+
1
9
  4.5.0 - 2025.08.05
2
10
  - Adds option to use assets in the user lib.
3
11
 
@@ -145,9 +145,6 @@ module Gloo
145
145
  # Convert the object to JSON.
146
146
  #
147
147
  def self.convert_obj_to_json( obj )
148
-
149
- # TODO: put container objects in an array
150
-
151
148
  h = obj ? convert_obj_to_hash( obj ) : {}
152
149
  json = JSON.parse( h.to_json )
153
150
  json = JSON.pretty_generate( json )
@@ -162,10 +159,10 @@ module Gloo
162
159
 
163
160
  if obj.child_count > 0
164
161
  obj.children.each do |child|
165
- h = h.merge( convert_obj_to_hash( child ) )
162
+ h[ child.name ] = convert_obj_to_hash( child )
166
163
  end
167
164
  else
168
- h[ obj.name ] = obj.value
165
+ return obj.value
169
166
  end
170
167
 
171
168
  return h
@@ -42,6 +42,7 @@ module Gloo
42
42
  FILE_TYPE = 'file_type'.freeze
43
43
  FILE_PATH = 'file_path'.freeze
44
44
  FILE_NAME = 'file_name'.freeze
45
+ FILE_DATA = 'file_data'.freeze
45
46
  DOWNLOAD_FILE = 'download_file'.freeze
46
47
 
47
48
  #
@@ -506,6 +507,17 @@ module Gloo
506
507
  return o&.value
507
508
  end
508
509
 
510
+ #
511
+ # Get the File content
512
+ #
513
+ def file_data
514
+ o = find_child FILE_DATA
515
+ return nil unless o
516
+
517
+ o = Gloo::Objs::Alias.resolve_alias( @engine, o )
518
+ return o&.value
519
+ end
520
+
509
521
  #
510
522
  # Get the name of the file.
511
523
  #
@@ -530,7 +542,12 @@ module Gloo
530
542
  #
531
543
  def render_file params
532
544
  type = file_type
533
- data = File.binread file_path
545
+ inline_content = file_data
546
+ if inline_content.nil?
547
+ data = File.binread( file_path )
548
+ else
549
+ data = inline_content
550
+ end
534
551
  code = Gloo::WebSvr::ResponseCode::SUCCESS
535
552
  fname = file_name
536
553
  download = download_file
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: 4.5.0
4
+ version: 4.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Crane
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-08-05 00:00:00.000000000 Z
11
+ date: 2025-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler