kirei 0.8.3 → 0.8.4

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: 4947e7d5e49692f86c0c631f9f4110eb05f12c5dabaf0eaec50290187aa3200d
4
- data.tar.gz: 77babab3bd17e5646a2cdf0171a132267e324e73f1ffe28340e077e187ef2b92
3
+ metadata.gz: f47f9b86f6066afdd8f0a2c5f9d7a2acdd1d04381849eb9dd31a525eb60a3275
4
+ data.tar.gz: 4305b097bb5d95bae69014a8731386d7b2a535b53f7e3ae9040c7d5c8df785ec
5
5
  SHA512:
6
- metadata.gz: c3bb40d4a5101c510594910f88bcfb68522f12735c7970dcd071cb6ac9b0728545bbca8bf5e3f3b94bc680b9f3050bb55aa78589e7198049051b840bff9318c4
7
- data.tar.gz: dd36b2aa00e79c5c33946e54fc18739bcf29e0e0b9410201eac9404bc0d605e8d00df78d07e81cd326a2971f3f2ef4fdda159d5cc66aa243b669cb758003b52c
6
+ metadata.gz: f38fae54554310b201a2117e3514decd7da4940ac9d3cfb78e15de40fbc9fd54ee112c23a72c7c4ade232b9ea176687d1d894dfc40b7f108403ad5fa83cf8614
7
+ data.tar.gz: 3b6290969d6a8f6fd938c9c23b4dcd98d41e028ad5c49e84e8c418f8ffc35a4c98d3331eb1462258e23290840485c243d2e924a81e536b9ae151b04c18bdfd4f
@@ -9,7 +9,7 @@ module Kirei
9
9
 
10
10
  # the attached class is the class that extends this module
11
11
  # e.g. "User", "Airport", ..
12
- has_attached_class!
12
+ has_attached_class!(:out)
13
13
 
14
14
  include Kirei::Model::BaseClassInterface
15
15
 
@@ -52,10 +52,15 @@ module Kirei
52
52
  when Verb::POST, Verb::PUT, Verb::PATCH
53
53
  # TODO: based on content-type, parse the body differently
54
54
  # built-in support for JSON & XML
55
- body = T.cast(env.fetch("rack.input"), T.any(IO, StringIO))
56
- res = Oj.load(body.read, Kirei::OJ_OPTIONS)
57
- body.rewind # TODO: maybe don't rewind if we don't need to?
58
- T.cast(res, T::Hash[String, T.untyped])
55
+ body = env.fetch("rack.input")
56
+ if body.nil? || !body.respond_to?(:read) || (body.respond_to?(:empty?) && body.empty?)
57
+ {}
58
+ else
59
+ body = T.cast(body, T.any(IO, StringIO))
60
+ res = Oj.load(body.read, Kirei::OJ_OPTIONS)
61
+ body.rewind # TODO: maybe don't rewind if we don't need to?
62
+ T.cast(res, T::Hash[String, T.untyped])
63
+ end
59
64
  when Verb::HEAD, Verb::DELETE, Verb::OPTIONS, Verb::TRACE, Verb::CONNECT
60
65
  {}
61
66
  else
data/lib/kirei/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Kirei
5
- VERSION = "0.8.3"
5
+ VERSION = "0.8.4"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kirei
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ludwig Reinmiedl
@@ -229,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
229
229
  - !ruby/object:Gem::Version
230
230
  version: '0'
231
231
  requirements: []
232
- rubygems_version: 3.6.7
232
+ rubygems_version: 4.0.3
233
233
  specification_version: 4
234
234
  summary: Kirei is a typed Ruby micro/REST-framework for building scalable and performant
235
235
  microservices.