zoo_stream 1.0.0 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5d5084bcfadb74a25b5785fc889a3605b7d0a4e3
4
- data.tar.gz: 2587fbe749549481ce91f58c15c83b6a68eca3ad
3
+ metadata.gz: 0674a63b02c413fbd9fcf609865dd16c178e643d
4
+ data.tar.gz: 025b359061bfdebc7081c2b1aeb6218cfc1e606e
5
5
  SHA512:
6
- metadata.gz: d3307473a4cb936f74a8197a2756c1dd13621617129124c4aa832ec70636b4f4285cfe523ec3cfb2d70db8d7205d65457d49a7b7eeeb00f0ee8d81e70494996a
7
- data.tar.gz: 3419bd72756056f44ff6fe96b50814f415d16495634ab059e01f21a4002558dc01fbf1a9def7ec4b9de298e81a54ed6643a79dbc57c5079a80c38e8756517b4e
6
+ metadata.gz: e48405639604ad543440f860f49284246179f33d9d5cc6d21cfadd77b5a51a9571210b03c113b3cd667104b0e3da752432489c4a743d8748fa79d32522909be8
7
+ data.tar.gz: f87205f8096ebd49e71470f334a1ffb46570e5ee9e62957cd1ca4bad3e9d6e747f928154130195ef9cc939cc4ad066d3b383fb9117d7ed8a90600c4f623ba5fc
data/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # 1.0.1
2
+
3
+ * Made compatible down to Ruby 2.0.0
4
+
5
+ # 1.0.0
6
+
7
+ * Initial release
@@ -9,7 +9,9 @@ module ZooStream
9
9
  @client = client
10
10
  end
11
11
 
12
- def publish(event, shard_by:)
12
+ def publish(event, shard_by: nil)
13
+ raise ArgumentError, "Must specify shard_by" unless shard_by
14
+
13
15
  client.put_record(
14
16
  stream_name: stream_name,
15
17
  partition_key: shard_by,
@@ -1,3 +1,3 @@
1
1
  module ZooStream
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
data/lib/zoo_stream.rb CHANGED
@@ -9,7 +9,10 @@ module ZooStream
9
9
  # @param data [Hash] the event data
10
10
  # @param linked [Hash] related models to the data
11
11
  # @param shard_by [String] if present, reader order will be guaranteed within this shard. If left blank, the entire stream will always be a single shard.
12
- def self.publish(event:, data:, linked: {}, shard_by: nil)
12
+ def self.publish(event: nil, data: nil, linked: {}, shard_by: nil)
13
+ raise ArgumentError, "Must specify event" unless event
14
+ raise ArgumentError, "Must specify data" unless data
15
+
13
16
  return unless publisher
14
17
  event = Event.new(source, event, data, linked)
15
18
  publisher.publish(event, shard_by: (shard_by || event.type).to_s)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zoo_stream
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marten Veldthuis
@@ -77,6 +77,7 @@ files:
77
77
  - ".gitignore"
78
78
  - ".rspec"
79
79
  - ".travis.yml"
80
+ - CHANGELOG.md
80
81
  - CODE_OF_CONDUCT.md
81
82
  - Gemfile
82
83
  - LICENSE.txt