forest_admin_rails 1.10.0 → 1.11.0

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: 3fe9563ade322d14a48e87226113517bcc59390c10c25c2f13be7f67603462e1
4
- data.tar.gz: 54be1c5e21604ef1d88028c2cb3a3a3e5a4356ed90ddb10001d1e7094a689fde
3
+ metadata.gz: 873d01d9795f77f1a69a903f44029537617497ca353651f1202210c5d0d7620a
4
+ data.tar.gz: 6ebd50868bd3ed263dfcb658ec1c7815af1617b555a4272640b7c81fc9c874ec
5
5
  SHA512:
6
- metadata.gz: 81c19dd8ad3643aac6395a6ea3b314af8525ef6e9113bf8b24fb30b97c98e11a0e98c8f37fdae42220c257b14f7e0ed530070007c157409f8289f34db00c79c3
7
- data.tar.gz: ffaf48302e962f885801b4ed53253dfbf2f923e6106fbc59145c5245148b45d0ee17806ce2a7fdca93a401e79a1852576d9e4aecfeac376cde6e06a60195b929
6
+ metadata.gz: 5eda8996a93b9e2216330dd4f6791b919f7518865a463d246f50f50838771db3a3e03905c77e734fcbc59beab7ffb55bd00cd8d1ab3352384bab78bb1a31f095
7
+ data.tar.gz: fb12cdced621a5af63577803f0bb9d2402dfe76faae9b6d55ae5a425dac827364196e0070ced5aef27ebea39e2f18c2316d87c8f07640384f917e3d5990ab03f
@@ -22,6 +22,9 @@ module ForestAdminRails
22
22
 
23
23
  def forest_response(data = {})
24
24
  if data[:content].is_a?(Hash)
25
+ # Handle streaming responses (NEW)
26
+ return handle_streaming_response(data) if data.dig(:content, :type) == 'Stream'
27
+
25
28
  if data.dig(:content, :type) == 'File'
26
29
  return send_data data[:content][:stream], filename: data[:content][:name], type: data[:content][:mime_type],
27
30
  disposition: 'attachment'
@@ -39,6 +42,24 @@ module ForestAdminRails
39
42
  end
40
43
  end
41
44
 
45
+ private
46
+
47
+ # Handle streaming response (enumerator-based)
48
+ def handle_streaming_response(data)
49
+ enumerator = data[:content][:enumerator]
50
+ headers = data[:content][:headers] || {}
51
+
52
+ # Merge headers
53
+ response.headers.merge!(headers)
54
+
55
+ # Set response status
56
+ response.status = data[:status] || 200
57
+
58
+ # Stream the enumerator
59
+ # Rails will automatically use chunked transfer encoding
60
+ self.response_body = enumerator
61
+ end
62
+
42
63
  def exception_handler(exception)
43
64
  http_status = get_error_status(exception)
44
65
 
@@ -1,3 +1,3 @@
1
1
  module ForestAdminRails
2
- VERSION = "1.10.0"
2
+ VERSION = "1.11.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_admin_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthieu