cloud_events 0.3.0 → 0.3.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 +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/cloud_events/event/v0.rb +1 -1
- data/lib/cloud_events/http_binding.rb +17 -8
- data/lib/cloud_events/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7449de71a0d20b1c7fa726bbb850080c977299ebb92c3c52ecc04c3acaa65a0c
|
4
|
+
data.tar.gz: 60c0bfa47f39b3c4a10d12122c57d2ee2b26e75f4a82bc0622033275a5866946
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba15c5d5fd8fd432b39a861297c57f04c659f0329783ad8a02f30c60f839836438df4371937d4d063f14bef326e45741140690be854dc2f8865c3defbb948074
|
7
|
+
data.tar.gz: 05cca16a9b8436a8cf7e7a23189d6873fbc322dbd177cd5d71886081a2a116d75ccb2215bc8c112a013976d769691ab0be96ab41b2d16e4acb57948c9aa7b8fc
|
data/CHANGELOG.md
CHANGED
@@ -89,11 +89,11 @@ module CloudEvents
|
|
89
89
|
if input && content_type&.media_type == "application"
|
90
90
|
case content_type.subtype_base
|
91
91
|
when "cloudevents"
|
92
|
-
|
93
|
-
return decode_structured_content
|
92
|
+
content = read_with_charset input, content_type.charset
|
93
|
+
return decode_structured_content content, content_type.subtype_format, **format_args
|
94
94
|
when "cloudevents-batch"
|
95
|
-
|
96
|
-
return decode_batched_content
|
95
|
+
content = read_with_charset input, content_type.charset
|
96
|
+
return decode_batched_content content, content_type.subtype_format, **format_args
|
97
97
|
end
|
98
98
|
end
|
99
99
|
decode_binary_content env, content_type
|
@@ -152,10 +152,7 @@ module CloudEvents
|
|
152
152
|
return nil if spec_version.nil?
|
153
153
|
raise SpecVersionError, "Unrecognized specversion: #{spec_version}" unless spec_version == "1.0"
|
154
154
|
input = env["rack.input"]
|
155
|
-
data = if input
|
156
|
-
input.set_encoding content_type.charset if content_type&.charset
|
157
|
-
input.read
|
158
|
-
end
|
155
|
+
data = read_with_charset input, content_type&.charset if input
|
159
156
|
attributes = { "spec_version" => spec_version, "data" => data }
|
160
157
|
attributes["data_content_type"] = content_type if content_type
|
161
158
|
omit_names = ["specversion", "spec_version", "data", "datacontenttype", "data_content_type"]
|
@@ -289,6 +286,18 @@ module CloudEvents
|
|
289
286
|
|
290
287
|
private
|
291
288
|
|
289
|
+
def read_with_charset io, charset
|
290
|
+
str = io.read
|
291
|
+
if charset
|
292
|
+
begin
|
293
|
+
str.force_encoding charset
|
294
|
+
rescue ::ArgumentError
|
295
|
+
# Do nothing for now if the charset is unrecognized
|
296
|
+
end
|
297
|
+
end
|
298
|
+
str
|
299
|
+
end
|
300
|
+
|
292
301
|
def string_content_type str
|
293
302
|
if str.encoding == ::Encoding.ASCII_8BIT
|
294
303
|
"application/octet-stream"
|
data/lib/cloud_events/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloud_events
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Azuma
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: The official Ruby implementation of the CloudEvents Specification. Provides
|
14
14
|
data types for events, and HTTP/JSON bindings for marshalling and unmarshalling
|
@@ -38,10 +38,10 @@ homepage: https://github.com/cloudevents/sdk-ruby
|
|
38
38
|
licenses:
|
39
39
|
- Apache-2.0
|
40
40
|
metadata:
|
41
|
-
changelog_uri: https://cloudevents.github.io/sdk-ruby/v0.3.
|
41
|
+
changelog_uri: https://cloudevents.github.io/sdk-ruby/v0.3.1/file.CHANGELOG.html
|
42
42
|
source_code_uri: https://github.com/cloudevents/sdk-ruby
|
43
43
|
bug_tracker_uri: https://github.com/cloudevents/sdk-ruby/issues
|
44
|
-
documentation_uri: https://cloudevents.github.io/sdk-ruby/v0.3.
|
44
|
+
documentation_uri: https://cloudevents.github.io/sdk-ruby/v0.3.1
|
45
45
|
post_install_message:
|
46
46
|
rdoc_options: []
|
47
47
|
require_paths:
|
@@ -57,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
57
57
|
- !ruby/object:Gem::Version
|
58
58
|
version: '0'
|
59
59
|
requirements: []
|
60
|
-
rubygems_version: 3.1.
|
60
|
+
rubygems_version: 3.1.6
|
61
61
|
signing_key:
|
62
62
|
specification_version: 4
|
63
63
|
summary: Ruby SDK for CloudEvents
|