cloud_events 0.8.0 → 0.8.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 +4 -0
- data/README.md +24 -16
- data/RELEASING.md +0 -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: 5e5bb2b1e01aef9e34dca014ee2be62da7b2abaea1337c3db3f51c4dc9b6b790
|
|
4
|
+
data.tar.gz: 1c439ec71a81da471e67ebcc9de437b34be067c18a293790f0f9a098b3f0862b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 69a9b60f9d6d2a10ca5b22bbe171eba142d1864e90eed97bc8db8318d54070a64f916093ba92674eb08076e113f421584249bf114a6293f61c864ec48576e97a
|
|
7
|
+
data.tar.gz: ff8ac3a95310bbd915ee96efdb767575b4f094ae01a4b2e136a2e52e407b2c1c62d31e8dc4216c12ccb1267dec279a596eaeba7e16927d7a0768758e356817e7
|
data/CHANGELOG.md
CHANGED
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
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.1
|
|
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.1/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.1
|
|
49
49
|
rdoc_options: []
|
|
50
50
|
require_paths:
|
|
51
51
|
- lib
|