spikard 0.5.0 → 0.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.
Files changed (135) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +674 -674
  4. data/ext/spikard_rb/Cargo.toml +17 -17
  5. data/ext/spikard_rb/extconf.rb +13 -10
  6. data/ext/spikard_rb/src/lib.rs +6 -6
  7. data/lib/spikard/app.rb +405 -405
  8. data/lib/spikard/background.rb +27 -27
  9. data/lib/spikard/config.rb +396 -396
  10. data/lib/spikard/converters.rb +13 -13
  11. data/lib/spikard/handler_wrapper.rb +113 -113
  12. data/lib/spikard/provide.rb +214 -214
  13. data/lib/spikard/response.rb +173 -173
  14. data/lib/spikard/schema.rb +243 -243
  15. data/lib/spikard/sse.rb +111 -111
  16. data/lib/spikard/streaming_response.rb +44 -44
  17. data/lib/spikard/testing.rb +256 -256
  18. data/lib/spikard/upload_file.rb +131 -131
  19. data/lib/spikard/version.rb +5 -5
  20. data/lib/spikard/websocket.rb +59 -59
  21. data/lib/spikard.rb +43 -43
  22. data/sig/spikard.rbs +366 -366
  23. data/vendor/crates/spikard-bindings-shared/Cargo.toml +63 -63
  24. data/vendor/crates/spikard-bindings-shared/examples/config_extraction.rs +132 -132
  25. data/vendor/crates/spikard-bindings-shared/src/config_extractor.rs +752 -752
  26. data/vendor/crates/spikard-bindings-shared/src/conversion_traits.rs +194 -194
  27. data/vendor/crates/spikard-bindings-shared/src/di_traits.rs +246 -246
  28. data/vendor/crates/spikard-bindings-shared/src/error_response.rs +401 -401
  29. data/vendor/crates/spikard-bindings-shared/src/handler_base.rs +238 -238
  30. data/vendor/crates/spikard-bindings-shared/src/lib.rs +24 -24
  31. data/vendor/crates/spikard-bindings-shared/src/lifecycle_base.rs +292 -292
  32. data/vendor/crates/spikard-bindings-shared/src/lifecycle_executor.rs +616 -616
  33. data/vendor/crates/spikard-bindings-shared/src/response_builder.rs +305 -305
  34. data/vendor/crates/spikard-bindings-shared/src/test_client_base.rs +248 -248
  35. data/vendor/crates/spikard-bindings-shared/src/validation_helpers.rs +351 -351
  36. data/vendor/crates/spikard-bindings-shared/tests/comprehensive_coverage.rs +454 -454
  37. data/vendor/crates/spikard-bindings-shared/tests/error_response_edge_cases.rs +383 -383
  38. data/vendor/crates/spikard-bindings-shared/tests/handler_base_integration.rs +280 -280
  39. data/vendor/crates/spikard-core/Cargo.toml +40 -40
  40. data/vendor/crates/spikard-core/src/bindings/mod.rs +3 -3
  41. data/vendor/crates/spikard-core/src/bindings/response.rs +133 -133
  42. data/vendor/crates/spikard-core/src/debug.rs +127 -127
  43. data/vendor/crates/spikard-core/src/di/container.rs +702 -702
  44. data/vendor/crates/spikard-core/src/di/dependency.rs +273 -273
  45. data/vendor/crates/spikard-core/src/di/error.rs +118 -118
  46. data/vendor/crates/spikard-core/src/di/factory.rs +534 -534
  47. data/vendor/crates/spikard-core/src/di/graph.rs +506 -506
  48. data/vendor/crates/spikard-core/src/di/mod.rs +192 -192
  49. data/vendor/crates/spikard-core/src/di/resolved.rs +405 -405
  50. data/vendor/crates/spikard-core/src/di/value.rs +281 -281
  51. data/vendor/crates/spikard-core/src/errors.rs +69 -69
  52. data/vendor/crates/spikard-core/src/http.rs +415 -415
  53. data/vendor/crates/spikard-core/src/lib.rs +29 -29
  54. data/vendor/crates/spikard-core/src/lifecycle.rs +1186 -1186
  55. data/vendor/crates/spikard-core/src/metadata.rs +389 -389
  56. data/vendor/crates/spikard-core/src/parameters.rs +2525 -2525
  57. data/vendor/crates/spikard-core/src/problem.rs +344 -344
  58. data/vendor/crates/spikard-core/src/request_data.rs +1154 -1154
  59. data/vendor/crates/spikard-core/src/router.rs +510 -510
  60. data/vendor/crates/spikard-core/src/schema_registry.rs +183 -183
  61. data/vendor/crates/spikard-core/src/type_hints.rs +304 -304
  62. data/vendor/crates/spikard-core/src/validation/error_mapper.rs +696 -688
  63. data/vendor/crates/spikard-core/src/validation/mod.rs +457 -457
  64. data/vendor/crates/spikard-http/Cargo.toml +62 -64
  65. data/vendor/crates/spikard-http/examples/sse-notifications.rs +148 -148
  66. data/vendor/crates/spikard-http/examples/websocket-chat.rs +92 -92
  67. data/vendor/crates/spikard-http/src/auth.rs +296 -296
  68. data/vendor/crates/spikard-http/src/background.rs +1860 -1860
  69. data/vendor/crates/spikard-http/src/bindings/mod.rs +3 -3
  70. data/vendor/crates/spikard-http/src/bindings/response.rs +1 -1
  71. data/vendor/crates/spikard-http/src/body_metadata.rs +8 -8
  72. data/vendor/crates/spikard-http/src/cors.rs +1005 -1005
  73. data/vendor/crates/spikard-http/src/debug.rs +128 -128
  74. data/vendor/crates/spikard-http/src/di_handler.rs +1668 -1668
  75. data/vendor/crates/spikard-http/src/handler_response.rs +901 -901
  76. data/vendor/crates/spikard-http/src/handler_trait.rs +838 -830
  77. data/vendor/crates/spikard-http/src/handler_trait_tests.rs +290 -290
  78. data/vendor/crates/spikard-http/src/lib.rs +534 -534
  79. data/vendor/crates/spikard-http/src/lifecycle/adapter.rs +230 -230
  80. data/vendor/crates/spikard-http/src/lifecycle.rs +1193 -1193
  81. data/vendor/crates/spikard-http/src/middleware/mod.rs +560 -540
  82. data/vendor/crates/spikard-http/src/middleware/multipart.rs +912 -912
  83. data/vendor/crates/spikard-http/src/middleware/urlencoded.rs +513 -513
  84. data/vendor/crates/spikard-http/src/middleware/validation.rs +768 -735
  85. data/vendor/crates/spikard-http/src/openapi/mod.rs +309 -309
  86. data/vendor/crates/spikard-http/src/openapi/parameter_extraction.rs +535 -535
  87. data/vendor/crates/spikard-http/src/openapi/schema_conversion.rs +1363 -1363
  88. data/vendor/crates/spikard-http/src/openapi/spec_generation.rs +665 -665
  89. data/vendor/crates/spikard-http/src/query_parser.rs +793 -793
  90. data/vendor/crates/spikard-http/src/response.rs +720 -720
  91. data/vendor/crates/spikard-http/src/server/handler.rs +1650 -1650
  92. data/vendor/crates/spikard-http/src/server/lifecycle_execution.rs +234 -234
  93. data/vendor/crates/spikard-http/src/server/mod.rs +1593 -1502
  94. data/vendor/crates/spikard-http/src/server/request_extraction.rs +789 -770
  95. data/vendor/crates/spikard-http/src/server/routing_factory.rs +629 -599
  96. data/vendor/crates/spikard-http/src/sse.rs +1409 -1409
  97. data/vendor/crates/spikard-http/src/testing/form.rs +52 -52
  98. data/vendor/crates/spikard-http/src/testing/multipart.rs +64 -60
  99. data/vendor/crates/spikard-http/src/testing/test_client.rs +311 -283
  100. data/vendor/crates/spikard-http/src/testing.rs +406 -377
  101. data/vendor/crates/spikard-http/src/websocket.rs +1404 -1375
  102. data/vendor/crates/spikard-http/tests/background_behavior.rs +832 -832
  103. data/vendor/crates/spikard-http/tests/common/handlers.rs +309 -309
  104. data/vendor/crates/spikard-http/tests/common/mod.rs +26 -26
  105. data/vendor/crates/spikard-http/tests/di_integration.rs +192 -192
  106. data/vendor/crates/spikard-http/tests/doc_snippets.rs +5 -5
  107. data/vendor/crates/spikard-http/tests/lifecycle_execution.rs +1093 -1093
  108. data/vendor/crates/spikard-http/tests/multipart_behavior.rs +656 -656
  109. data/vendor/crates/spikard-http/tests/server_config_builder.rs +314 -314
  110. data/vendor/crates/spikard-http/tests/sse_behavior.rs +620 -620
  111. data/vendor/crates/spikard-http/tests/websocket_behavior.rs +663 -663
  112. data/vendor/crates/spikard-rb/Cargo.toml +48 -48
  113. data/vendor/crates/spikard-rb/build.rs +199 -199
  114. data/vendor/crates/spikard-rb/src/background.rs +63 -63
  115. data/vendor/crates/spikard-rb/src/config/mod.rs +5 -5
  116. data/vendor/crates/spikard-rb/src/config/server_config.rs +285 -285
  117. data/vendor/crates/spikard-rb/src/conversion.rs +554 -554
  118. data/vendor/crates/spikard-rb/src/di/builder.rs +100 -100
  119. data/vendor/crates/spikard-rb/src/di/mod.rs +375 -375
  120. data/vendor/crates/spikard-rb/src/handler.rs +618 -618
  121. data/vendor/crates/spikard-rb/src/integration/mod.rs +3 -3
  122. data/vendor/crates/spikard-rb/src/lib.rs +1806 -1810
  123. data/vendor/crates/spikard-rb/src/lifecycle.rs +275 -275
  124. data/vendor/crates/spikard-rb/src/metadata/mod.rs +5 -5
  125. data/vendor/crates/spikard-rb/src/metadata/route_extraction.rs +442 -447
  126. data/vendor/crates/spikard-rb/src/runtime/mod.rs +5 -5
  127. data/vendor/crates/spikard-rb/src/runtime/server_runner.rs +324 -324
  128. data/vendor/crates/spikard-rb/src/server.rs +305 -308
  129. data/vendor/crates/spikard-rb/src/sse.rs +231 -231
  130. data/vendor/crates/spikard-rb/src/testing/client.rs +538 -551
  131. data/vendor/crates/spikard-rb/src/testing/mod.rs +7 -7
  132. data/vendor/crates/spikard-rb/src/testing/sse.rs +143 -143
  133. data/vendor/crates/spikard-rb/src/testing/websocket.rs +608 -635
  134. data/vendor/crates/spikard-rb/src/websocket.rs +377 -374
  135. metadata +15 -1
@@ -1,131 +1,131 @@
1
- # frozen_string_literal: true
2
-
3
- require 'stringio'
4
- require 'base64'
5
-
6
- module Spikard
7
- # File upload handling for multipart/form-data requests
8
- #
9
- # This class provides an interface for handling file uploads,
10
- # designed to be compatible with Rails patterns while optimized
11
- # for Spikard's Rust-backed request processing.
12
- #
13
- # @example
14
- # app.post('/upload') do |body|
15
- # file = body[:file] # UploadFile instance
16
- # content = file.read
17
- # {
18
- # filename: file.filename,
19
- # size: file.size,
20
- # content_type: file.content_type,
21
- # description: body[:description]
22
- # }
23
- # end
24
- class UploadFile
25
- # @return [String] Original filename from the client
26
- attr_reader :filename
27
-
28
- # @return [String] MIME type of the uploaded file
29
- attr_reader :content_type
30
-
31
- # @return [Integer] Size of the file in bytes
32
- attr_reader :size
33
-
34
- # @return [Hash<String, String>] Additional headers associated with this file field
35
- attr_reader :headers
36
-
37
- # Create a new UploadFile instance
38
- #
39
- # @param filename [String] Original filename from the client
40
- # @param content [String] File contents (may be base64 encoded)
41
- # @param content_type [String, nil] MIME type (defaults to "application/octet-stream")
42
- # @param size [Integer, nil] File size in bytes (computed from content if not provided)
43
- # @param headers [Hash<String, String>, nil] Additional headers from the multipart field
44
- # @param content_encoding [String, nil] Encoding type (e.g., "base64")
45
- def initialize(filename, content, content_type: nil, size: nil, headers: nil, content_encoding: nil)
46
- @filename = filename
47
- @content_type = content_type || 'application/octet-stream'
48
- @headers = headers || {}
49
-
50
- # Decode content if base64 encoded
51
- @content = if content_encoding == 'base64' || base64_encoded?(content)
52
- Base64.decode64(content)
53
- else
54
- content
55
- end
56
-
57
- @size = size || @content.bytesize
58
- @io = StringIO.new(@content)
59
- end
60
-
61
- # Read file contents
62
- #
63
- # @param size [Integer, nil] Number of bytes to read (nil for all remaining)
64
- # @return [String] File contents
65
- def read(size = nil)
66
- @io.read(size)
67
- end
68
-
69
- # Read file contents as text
70
- #
71
- # @param encoding [String] Character encoding (defaults to UTF-8)
72
- # @return [String] File contents as text
73
- def text(encoding: 'UTF-8')
74
- @content.force_encoding(encoding)
75
- end
76
-
77
- # Seek to a specific position in the file
78
- #
79
- # @param offset [Integer] Byte offset
80
- # @param whence [Integer] Position reference (IO::SEEK_SET, IO::SEEK_CUR, IO::SEEK_END)
81
- # @return [Integer] New position
82
- def seek(offset, whence = IO::SEEK_SET)
83
- @io.seek(offset, whence)
84
- end
85
-
86
- # Get current position in the file
87
- #
88
- # @return [Integer] Current byte offset
89
- def tell
90
- @io.tell
91
- end
92
- alias pos tell
93
-
94
- # Rewind to the beginning of the file
95
- #
96
- # @return [Integer] Always returns 0
97
- def rewind
98
- @io.rewind
99
- end
100
-
101
- # Close the file (no-op for StringIO-based implementation)
102
- #
103
- # @return [nil]
104
- def close
105
- @io.close
106
- end
107
-
108
- # Check if file is closed
109
- #
110
- # @return [Boolean]
111
- def closed?
112
- @io.closed?
113
- end
114
-
115
- # Get the raw content as a string
116
- #
117
- # @return [String] Raw file content
118
- attr_reader :content
119
-
120
- private
121
-
122
- # Check if a string appears to be base64 encoded
123
- #
124
- # @param str [String] String to check
125
- # @return [Boolean]
126
- def base64_encoded?(str)
127
- # Simple heuristic: check if string matches base64 pattern
128
- str.is_a?(String) && str.match?(%r{\A[A-Za-z0-9+/]*={0,2}\z})
129
- end
130
- end
131
- end
1
+ # frozen_string_literal: true
2
+
3
+ require 'stringio'
4
+ require 'base64'
5
+
6
+ module Spikard
7
+ # File upload handling for multipart/form-data requests
8
+ #
9
+ # This class provides an interface for handling file uploads,
10
+ # designed to be compatible with Rails patterns while optimized
11
+ # for Spikard's Rust-backed request processing.
12
+ #
13
+ # @example
14
+ # app.post('/upload') do |body|
15
+ # file = body[:file] # UploadFile instance
16
+ # content = file.read
17
+ # {
18
+ # filename: file.filename,
19
+ # size: file.size,
20
+ # content_type: file.content_type,
21
+ # description: body[:description]
22
+ # }
23
+ # end
24
+ class UploadFile
25
+ # @return [String] Original filename from the client
26
+ attr_reader :filename
27
+
28
+ # @return [String] MIME type of the uploaded file
29
+ attr_reader :content_type
30
+
31
+ # @return [Integer] Size of the file in bytes
32
+ attr_reader :size
33
+
34
+ # @return [Hash<String, String>] Additional headers associated with this file field
35
+ attr_reader :headers
36
+
37
+ # Create a new UploadFile instance
38
+ #
39
+ # @param filename [String] Original filename from the client
40
+ # @param content [String] File contents (may be base64 encoded)
41
+ # @param content_type [String, nil] MIME type (defaults to "application/octet-stream")
42
+ # @param size [Integer, nil] File size in bytes (computed from content if not provided)
43
+ # @param headers [Hash<String, String>, nil] Additional headers from the multipart field
44
+ # @param content_encoding [String, nil] Encoding type (e.g., "base64")
45
+ def initialize(filename, content, content_type: nil, size: nil, headers: nil, content_encoding: nil)
46
+ @filename = filename
47
+ @content_type = content_type || 'application/octet-stream'
48
+ @headers = headers || {}
49
+
50
+ # Decode content if base64 encoded
51
+ @content = if content_encoding == 'base64' || base64_encoded?(content)
52
+ Base64.decode64(content)
53
+ else
54
+ content
55
+ end
56
+
57
+ @size = size || @content.bytesize
58
+ @io = StringIO.new(@content)
59
+ end
60
+
61
+ # Read file contents
62
+ #
63
+ # @param size [Integer, nil] Number of bytes to read (nil for all remaining)
64
+ # @return [String] File contents
65
+ def read(size = nil)
66
+ @io.read(size)
67
+ end
68
+
69
+ # Read file contents as text
70
+ #
71
+ # @param encoding [String] Character encoding (defaults to UTF-8)
72
+ # @return [String] File contents as text
73
+ def text(encoding: 'UTF-8')
74
+ @content.force_encoding(encoding)
75
+ end
76
+
77
+ # Seek to a specific position in the file
78
+ #
79
+ # @param offset [Integer] Byte offset
80
+ # @param whence [Integer] Position reference (IO::SEEK_SET, IO::SEEK_CUR, IO::SEEK_END)
81
+ # @return [Integer] New position
82
+ def seek(offset, whence = IO::SEEK_SET)
83
+ @io.seek(offset, whence)
84
+ end
85
+
86
+ # Get current position in the file
87
+ #
88
+ # @return [Integer] Current byte offset
89
+ def tell
90
+ @io.tell
91
+ end
92
+ alias pos tell
93
+
94
+ # Rewind to the beginning of the file
95
+ #
96
+ # @return [Integer] Always returns 0
97
+ def rewind
98
+ @io.rewind
99
+ end
100
+
101
+ # Close the file (no-op for StringIO-based implementation)
102
+ #
103
+ # @return [nil]
104
+ def close
105
+ @io.close
106
+ end
107
+
108
+ # Check if file is closed
109
+ #
110
+ # @return [Boolean]
111
+ def closed?
112
+ @io.closed?
113
+ end
114
+
115
+ # Get the raw content as a string
116
+ #
117
+ # @return [String] Raw file content
118
+ attr_reader :content
119
+
120
+ private
121
+
122
+ # Check if a string appears to be base64 encoded
123
+ #
124
+ # @param str [String] String to check
125
+ # @return [Boolean]
126
+ def base64_encoded?(str)
127
+ # Simple heuristic: check if string matches base64 pattern
128
+ str.is_a?(String) && str.match?(%r{\A[A-Za-z0-9+/]*={0,2}\z})
129
+ end
130
+ end
131
+ end
@@ -1,5 +1,5 @@
1
- # frozen_string_literal: true
2
-
3
- module Spikard
4
- VERSION = '0.5.0'
5
- end
1
+ # frozen_string_literal: true
2
+
3
+ module Spikard
4
+ VERSION = '0.6.1'
5
+ end
@@ -1,59 +1,59 @@
1
- # frozen_string_literal: true
2
-
3
- module Spikard
4
- # Base class for WebSocket message handlers.
5
- #
6
- # Implement this class to handle WebSocket connections and messages.
7
- #
8
- # @example
9
- # class ChatHandler < Spikard::WebSocketHandler
10
- # def handle_message(message)
11
- # # Echo message back
12
- # message
13
- # end
14
- #
15
- # def on_connect
16
- # puts "Client connected"
17
- # end
18
- #
19
- # def on_disconnect
20
- # puts "Client disconnected"
21
- # end
22
- # end
23
- #
24
- # app = Spikard::App.new
25
- #
26
- # app.websocket('/chat') do
27
- # ChatHandler.new
28
- # end
29
- #
30
- # app.run
31
- class WebSocketHandler
32
- # Handle an incoming WebSocket message.
33
- #
34
- # @param message [Hash] Parsed JSON message from the client
35
- # @return [Hash, nil] Optional response message to send back to the client.
36
- # Return nil to not send a response.
37
- def handle_message(message)
38
- raise NotImplementedError, "#{self.class.name} must implement #handle_message"
39
- end
40
-
41
- # Called when a client connects.
42
- #
43
- # Override this method to perform initialization when a client connects.
44
- #
45
- # @return [void]
46
- def on_connect
47
- # Optional hook - default implementation does nothing
48
- end
49
-
50
- # Called when a client disconnects.
51
- #
52
- # Override this method to perform cleanup when a client disconnects.
53
- #
54
- # @return [void]
55
- def on_disconnect
56
- # Optional hook - default implementation does nothing
57
- end
58
- end
59
- end
1
+ # frozen_string_literal: true
2
+
3
+ module Spikard
4
+ # Base class for WebSocket message handlers.
5
+ #
6
+ # Implement this class to handle WebSocket connections and messages.
7
+ #
8
+ # @example
9
+ # class ChatHandler < Spikard::WebSocketHandler
10
+ # def handle_message(message)
11
+ # # Echo message back
12
+ # message
13
+ # end
14
+ #
15
+ # def on_connect
16
+ # puts "Client connected"
17
+ # end
18
+ #
19
+ # def on_disconnect
20
+ # puts "Client disconnected"
21
+ # end
22
+ # end
23
+ #
24
+ # app = Spikard::App.new
25
+ #
26
+ # app.websocket('/chat') do
27
+ # ChatHandler.new
28
+ # end
29
+ #
30
+ # app.run
31
+ class WebSocketHandler
32
+ # Handle an incoming WebSocket message.
33
+ #
34
+ # @param message [Hash] Parsed JSON message from the client
35
+ # @return [Hash, nil] Optional response message to send back to the client.
36
+ # Return nil to not send a response.
37
+ def handle_message(message)
38
+ raise NotImplementedError, "#{self.class.name} must implement #handle_message"
39
+ end
40
+
41
+ # Called when a client connects.
42
+ #
43
+ # Override this method to perform initialization when a client connects.
44
+ #
45
+ # @return [void]
46
+ def on_connect
47
+ # Optional hook - default implementation does nothing
48
+ end
49
+
50
+ # Called when a client disconnects.
51
+ #
52
+ # Override this method to perform cleanup when a client disconnects.
53
+ #
54
+ # @return [void]
55
+ def on_disconnect
56
+ # Optional hook - default implementation does nothing
57
+ end
58
+ end
59
+ end
data/lib/spikard.rb CHANGED
@@ -1,43 +1,43 @@
1
- # frozen_string_literal: true
2
-
3
- # Main Ruby namespace for the Spikard bindings.
4
- module Spikard
5
- end
6
-
7
- begin
8
- require 'json'
9
- rescue LoadError
10
- # Fallback to pure-Ruby implementation when native JSON extension is unavailable
11
- require 'json/pure'
12
- end
13
- require_relative 'spikard/version'
14
- require_relative 'spikard/config'
15
- require_relative 'spikard/response'
16
- require_relative 'spikard/streaming_response'
17
- require_relative 'spikard/background'
18
- require_relative 'spikard/schema'
19
- require_relative 'spikard/websocket'
20
- require_relative 'spikard/sse'
21
- require_relative 'spikard/upload_file'
22
- require_relative 'spikard/converters'
23
- require_relative 'spikard/provide'
24
- require_relative 'spikard/handler_wrapper'
25
- require_relative 'spikard/app'
26
- require_relative 'spikard/testing'
27
-
28
- begin
29
- require 'spikard_rb'
30
- rescue LoadError => e
31
- raise LoadError, <<~MSG, e.backtrace
32
- Failed to load the Spikard native extension (spikard_rb). Run `bundle exec rake ext:build` to compile it before executing tests.
33
- Original error: #{e.message}
34
- MSG
35
- end
36
-
37
- # Convenience aliases and methods at top level
38
- module Spikard
39
- TestClient = Testing::TestClient
40
-
41
- # Handler wrapper utilities
42
- extend HandlerWrapper
43
- end
1
+ # frozen_string_literal: true
2
+
3
+ # Main Ruby namespace for the Spikard bindings.
4
+ module Spikard
5
+ end
6
+
7
+ begin
8
+ require 'json'
9
+ rescue LoadError
10
+ # Fallback to pure-Ruby implementation when native JSON extension is unavailable
11
+ require 'json/pure'
12
+ end
13
+ require_relative 'spikard/version'
14
+ require_relative 'spikard/config'
15
+ require_relative 'spikard/response'
16
+ require_relative 'spikard/streaming_response'
17
+ require_relative 'spikard/background'
18
+ require_relative 'spikard/schema'
19
+ require_relative 'spikard/websocket'
20
+ require_relative 'spikard/sse'
21
+ require_relative 'spikard/upload_file'
22
+ require_relative 'spikard/converters'
23
+ require_relative 'spikard/provide'
24
+ require_relative 'spikard/handler_wrapper'
25
+ require_relative 'spikard/app'
26
+ require_relative 'spikard/testing'
27
+
28
+ begin
29
+ require 'spikard_rb'
30
+ rescue LoadError => e
31
+ raise LoadError, <<~MSG, e.backtrace
32
+ Failed to load the Spikard native extension (spikard_rb). Run `bundle exec rake ext:build` to compile it before executing tests.
33
+ Original error: #{e.message}
34
+ MSG
35
+ end
36
+
37
+ # Convenience aliases and methods at top level
38
+ module Spikard
39
+ TestClient = Testing::TestClient
40
+
41
+ # Handler wrapper utilities
42
+ extend HandlerWrapper
43
+ end