cloud_events 0.8.0 → 0.8.2
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 +8 -0
- data/README.md +24 -16
- data/RELEASING.md +0 -1
- data/lib/cloud_events/content_type.rb +1 -1
- data/lib/cloud_events/event/opaque.rb +1 -1
- data/lib/cloud_events/format.rb +1 -1
- data/lib/cloud_events/text_format.rb +1 -1
- data/lib/cloud_events/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: aac5d146b0b5adbac5c05de9af2e135046f0178baea94dea90005b22934c5b49
|
|
4
|
+
data.tar.gz: efce8edc6fcc07014e0183c87d955ea16ff5a44a5fac197e45a30f730981c939
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 03c3c93e3ca7e49a67a8366c29f502466848a6e28f418c1ab9621f3dcc3dc050556148bab50e27109337f7bba70dc5c7ddb17e08729e79bbedd599b19f0be11c
|
|
7
|
+
data.tar.gz: d0fa89577d80fd1be5ab8d48689371a033da8b19439c24b1750b5ddc0c4d115e642bc19cc2b04f34ccca82b519f186e41f52e94a885c05a50a2387873ae1d4fb
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
### v0.8.2 / 2025-11-30
|
|
4
|
+
|
|
5
|
+
* DOCS: Fixed a few typos in documentation and error messages
|
|
6
|
+
|
|
7
|
+
### v0.8.1 / 2025-11-10
|
|
8
|
+
|
|
9
|
+
* DOCS: Some minor updates and corrections to the README and examples
|
|
10
|
+
|
|
3
11
|
### v0.8.0 / 2025-11-04
|
|
4
12
|
|
|
5
13
|
* BREAKING CHANGE: Raise AttributeError if an illegal attribute name is used
|
data/README.md
CHANGED
|
@@ -13,11 +13,11 @@ Features:
|
|
|
13
13
|
JSON Batch Format.
|
|
14
14
|
* Support for sending and receiving CloudEvents via HTTP Bindings.
|
|
15
15
|
* Supports the [CloudEvent 0.3](https://github.com/cloudevents/spec/tree/v0.3)
|
|
16
|
-
and [CloudEvents 1.0](https://github.com/cloudevents/spec/tree/v1.0.
|
|
16
|
+
and [CloudEvents 1.0](https://github.com/cloudevents/spec/tree/v1.0.2)
|
|
17
17
|
specifications.
|
|
18
18
|
* Extensible to additional formats and protocol bindings, and future
|
|
19
19
|
specification versions.
|
|
20
|
-
* Compatible with Ruby 2.
|
|
20
|
+
* Compatible with Ruby 2.7 or later, or JRuby 9.2.x or later. No runtime gem
|
|
21
21
|
dependencies.
|
|
22
22
|
|
|
23
23
|
## Quickstart
|
|
@@ -35,8 +35,10 @@ A simple [Sinatra](https://sinatrarb.com) app that receives CloudEvents:
|
|
|
35
35
|
```ruby
|
|
36
36
|
# examples/server/Gemfile
|
|
37
37
|
source "https://rubygems.org"
|
|
38
|
-
gem "cloud_events", "~> 0.
|
|
39
|
-
gem "sinatra", "~>
|
|
38
|
+
gem "cloud_events", "~> 0.8"
|
|
39
|
+
gem "sinatra", "~> 4.0"
|
|
40
|
+
gem "rackup"
|
|
41
|
+
gem "puma"
|
|
40
42
|
```
|
|
41
43
|
|
|
42
44
|
```ruby
|
|
@@ -46,9 +48,9 @@ require "cloud_events"
|
|
|
46
48
|
|
|
47
49
|
cloud_events_http = CloudEvents::HttpBinding.default
|
|
48
50
|
|
|
49
|
-
post
|
|
50
|
-
event = cloud_events_http.decode_event
|
|
51
|
-
logger.info
|
|
51
|
+
post("/") do
|
|
52
|
+
event = cloud_events_http.decode_event(request.env)
|
|
53
|
+
logger.info("Received CloudEvent: #{event.to_h}")
|
|
52
54
|
end
|
|
53
55
|
```
|
|
54
56
|
|
|
@@ -59,7 +61,7 @@ A simple Ruby script that sends a CloudEvent:
|
|
|
59
61
|
```ruby
|
|
60
62
|
# examples/client/Gemfile
|
|
61
63
|
source "https://rubygems.org"
|
|
62
|
-
gem "cloud_events", "~> 0.
|
|
64
|
+
gem "cloud_events", "~> 0.8"
|
|
63
65
|
```
|
|
64
66
|
|
|
65
67
|
```ruby
|
|
@@ -69,17 +71,18 @@ require "net/http"
|
|
|
69
71
|
require "uri"
|
|
70
72
|
|
|
71
73
|
data = { message: "Hello, CloudEvents!" }
|
|
72
|
-
event = CloudEvents::Event.create
|
|
74
|
+
event = CloudEvents::Event.create(
|
|
73
75
|
spec_version: "1.0",
|
|
74
76
|
id: "1234-1234-1234",
|
|
75
77
|
source: "/mycontext",
|
|
76
78
|
type: "com.example.someevent",
|
|
77
79
|
data_content_type: "application/json",
|
|
78
80
|
data: data
|
|
81
|
+
)
|
|
79
82
|
|
|
80
83
|
cloud_events_http = CloudEvents::HttpBinding.default
|
|
81
|
-
headers, body = cloud_events_http.encode_event
|
|
82
|
-
Net::HTTP.post
|
|
84
|
+
headers, body = cloud_events_http.encode_event(event)
|
|
85
|
+
Net::HTTP.post(URI("http://localhost:4567"), body, headers)
|
|
83
86
|
```
|
|
84
87
|
|
|
85
88
|
### Putting it together
|
|
@@ -108,7 +111,8 @@ Hit `CTRL+C` to stop the server.
|
|
|
108
111
|
|
|
109
112
|
## Contributing
|
|
110
113
|
|
|
111
|
-
Bug reports and pull requests are welcome on GitHub at
|
|
114
|
+
Bug reports and pull requests are welcome on GitHub at
|
|
115
|
+
https://github.com/cloudevents/sdk-ruby.
|
|
112
116
|
|
|
113
117
|
### Development
|
|
114
118
|
|
|
@@ -145,11 +149,15 @@ toys test --help
|
|
|
145
149
|
|
|
146
150
|
### Code style
|
|
147
151
|
|
|
148
|
-
Ruby code
|
|
149
|
-
|
|
150
|
-
based on "Seattle Style" Ruby.
|
|
152
|
+
Ruby code style is enforced by Rubocop rules. We've left the configuration
|
|
153
|
+
largely on the Rubocop defaults, with a few exceptions, notably:
|
|
151
154
|
|
|
152
|
-
|
|
155
|
+
* We prefer double-quoted strings rather than single-quoted strings.
|
|
156
|
+
* We prefer trailing commas in multi-line array and hash literals.
|
|
157
|
+
* Line length limit is 120
|
|
158
|
+
* We've loosened a few additional checks that we felt were not helpful.
|
|
159
|
+
|
|
160
|
+
You can run rubocop directly using the
|
|
153
161
|
`rubocop` binary:
|
|
154
162
|
|
|
155
163
|
```sh
|
data/RELEASING.md
CHANGED
|
@@ -131,7 +131,7 @@ module CloudEvents
|
|
|
131
131
|
@subtype_base, @subtype_format = @subtype.split("+", 2)
|
|
132
132
|
until str.empty?
|
|
133
133
|
str = consume_special(str, ";")
|
|
134
|
-
name, str = consume_token(str, downcase: true, error_message: "
|
|
134
|
+
name, str = consume_token(str, downcase: true, error_message: "Failed to parse attribute name")
|
|
135
135
|
str = consume_special(str, "=", error_message: "Failed to find value for attribute #{name}")
|
|
136
136
|
val, str = consume_token_or_quoted(str, error_message: "Failed to parse value for attribute #{name}")
|
|
137
137
|
@params << [name, val]
|
|
@@ -8,7 +8,7 @@ module CloudEvents
|
|
|
8
8
|
# single event or a batch of events.
|
|
9
9
|
#
|
|
10
10
|
# The event data is retained in a form that can be reserialized (in a
|
|
11
|
-
# structured
|
|
11
|
+
# structured content mode in the same format) but cannot otherwise be
|
|
12
12
|
# inspected.
|
|
13
13
|
#
|
|
14
14
|
# This object is immutable, and Ractor-shareable on Ruby 3.
|
data/lib/cloud_events/format.rb
CHANGED
|
@@ -30,7 +30,7 @@ module CloudEvents
|
|
|
30
30
|
#
|
|
31
31
|
# Both the keyword arguments recognized and the returned hash members may
|
|
32
32
|
# vary from formatter to formatter; similarly, the keyword arguments provided
|
|
33
|
-
# and the
|
|
33
|
+
# and the returned hash members recognized may also vary for different
|
|
34
34
|
# callers. This interface will define a set of common argument and result key
|
|
35
35
|
# names, but both callers and formatters must gracefully handle the case of
|
|
36
36
|
# missing or extra information. For example, if a formatter expects a certain
|
|
@@ -37,7 +37,7 @@ module CloudEvents
|
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
##
|
|
40
|
-
# Trivially an event data object using text format.
|
|
40
|
+
# Trivially encode an event data object using text format.
|
|
41
41
|
# See {CloudEvents::Format#encode_data} for a general description.
|
|
42
42
|
#
|
|
43
43
|
# Expects `:data` and `:content_type` arguments, and will decline the
|
data/lib/cloud_events/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cloud_events
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daniel Azuma
|
|
@@ -42,10 +42,10 @@ homepage: https://github.com/cloudevents/sdk-ruby
|
|
|
42
42
|
licenses:
|
|
43
43
|
- Apache-2.0
|
|
44
44
|
metadata:
|
|
45
|
-
changelog_uri: https://cloudevents.github.io/sdk-ruby/v0.8.
|
|
45
|
+
changelog_uri: https://cloudevents.github.io/sdk-ruby/v0.8.2/file.CHANGELOG.html
|
|
46
46
|
source_code_uri: https://github.com/cloudevents/sdk-ruby
|
|
47
47
|
bug_tracker_uri: https://github.com/cloudevents/sdk-ruby/issues
|
|
48
|
-
documentation_uri: https://cloudevents.github.io/sdk-ruby/v0.8.
|
|
48
|
+
documentation_uri: https://cloudevents.github.io/sdk-ruby/v0.8.2
|
|
49
49
|
rdoc_options: []
|
|
50
50
|
require_paths:
|
|
51
51
|
- lib
|