redis-stream-wrapper 0.1.4 → 0.1.5

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: b0f52deff91b4ad7115ba25ed76e011854734d7a9d8f887caede8bd99f6f5fa3
4
- data.tar.gz: a33c3d48a9a33767df08bb861a4988d50ad7caa53e9b91fb08b54d3d4358cab4
3
+ metadata.gz: bd2eebe3525308ca614a1e6aed1c1b23b2dcf2da80b39f05f6b1bf9bd8dabbbe
4
+ data.tar.gz: 38975df347acda91549ccccc614b667aab801e51ba470a72f7fd39b2c39c75f3
5
5
  SHA512:
6
- metadata.gz: e188401af67ef99a5d594d831ad4c2c3f9ab090a951f9ee669052f86790785b406b042d6ca9c9d1e50d3a0ee4dcfb336f0db25fa99b98ec2c2417242dcf588cd
7
- data.tar.gz: f36143d8845006299a938034e0e4104c7bb935d3ba7844d6cc160d1cbe5a99c4906a03e4593621e2480d24a8cc22b4277ee7296ac0ebd1daf1386f8e2f32b25b
6
+ metadata.gz: b85485aedf5cf45a71700db881a06c37deb97d058d4fa4fcea334d53330181d900dde3c5405677aa712ee3b096ba65fd9b339a986578e92360bb84fe0aee7f47
7
+ data.tar.gz: 1d9467199e9735c6e7bb78dea22296d36c1bbd2362765d50c488781190e556eb02e27c08b8aff1223ae7ff26d0682088cbdce8147cdd98bc7863b483e5a3626b
data/CODE_OF_CONDUCT.md CHANGED
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
55
55
  ## Enforcement
56
56
 
57
57
  Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at alexandre@buyco.co. All
58
+ reported by contacting the project team at dev@buyco.co. All
59
59
  complaints will be reviewed and investigated and will result in a response that
60
60
  is deemed necessary and appropriate to the circumstances. The project team is
61
61
  obligated to maintain confidentiality with regard to the reporter of an incident.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- redis-stream-wrapper (0.1.4)
4
+ redis-stream-wrapper (0.1.5)
5
5
  dry-struct
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -36,4 +36,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
36
36
 
37
37
  ## Code of Conduct
38
38
 
39
- Everyone interacting in the Redis::Stream::Wrapper project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/redis-stream-wrapper/blob/master/CODE_OF_CONDUCT.md).
39
+ Everyone interacting in the Redis::Stream::Wrapper project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/buyco/redis-stream-wrapper/blob/master/CODE_OF_CONDUCT.md).
@@ -1,4 +1,5 @@
1
1
  require 'dry-struct'
2
+ require 'redis/stream/wrapper/message'
2
3
  class Redis
3
4
  module Stream
4
5
  class Wrapper
@@ -140,13 +141,21 @@ class Redis
140
141
  messages.map do |id, payload|
141
142
  Message.new(
142
143
  stream: stream_name,
143
- payload: Hash[payload.each_slice(2).to_a],
144
+ payload: parse_payload(payload),
144
145
  id: id
145
146
  )
146
147
  end
147
148
  end.flatten.compact
148
149
  end
149
150
 
151
+ def parse_payload(payload)
152
+ if payload.is_a? Array
153
+ Hash[payload.each_slice(2).to_a]
154
+ else
155
+ payload
156
+ end
157
+ end
158
+
150
159
  # Returns a copy of the current instance, with the id set.
151
160
  #
152
161
  def copy_message(message, new_id)
@@ -7,7 +7,7 @@ class Redis
7
7
  class Message < ::Dry::Struct::Value
8
8
  # Types = ::Dry.Types(default: :nominal)
9
9
  attribute :stream, ::Types::Coercible::String
10
- attribute :id, ::Types::Coercible::String.optional.default('*')
10
+ attribute :id, ::Types::Coercible::String.optional.default('*'.freeze)
11
11
  attribute :payload, ::Types::Hash.map(::Types::Coercible::String, ::Types::Coercible::String)
12
12
  end
13
13
  end
@@ -2,5 +2,5 @@ require 'dry-struct'
2
2
 
3
3
  # Deprecated but mandatory for "old" projects
4
4
  module Types
5
- include Dry::Types.module
5
+ include Dry::Types()
6
6
  end
@@ -1,7 +1,7 @@
1
1
  class Redis
2
2
  module Stream
3
3
  class Wrapper
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5"
5
5
  end
6
6
  end
7
7
  end
@@ -96,24 +96,24 @@
96
96
  </library>
97
97
  </orderEntry>
98
98
  <orderEntry type="module-library">
99
- <library name="dry-container (vbundled(0.7.1)) [path][gem]" type="rubylib">
99
+ <library name="dry-container (vbundled(0.7.2)) [path][gem]" type="rubylib">
100
100
  <properties>
101
101
  <option name="version" value="4" />
102
102
  </properties>
103
103
  <CLASSES>
104
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/dry-container-0.7.1/lib" />
105
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/dry-container-0.7.1/spec" />
106
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/dry-container-0.7.1/rakelib" />
104
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/dry-container-0.7.2/lib" />
105
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/dry-container-0.7.2/spec" />
106
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/dry-container-0.7.2/rakelib" />
107
107
  </CLASSES>
108
108
  <JAVADOC />
109
109
  <SOURCES>
110
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/dry-container-0.7.1/lib" />
111
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/dry-container-0.7.1/spec" />
112
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/dry-container-0.7.1/rakelib" />
110
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/dry-container-0.7.2/lib" />
111
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/dry-container-0.7.2/spec" />
112
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/dry-container-0.7.2/rakelib" />
113
113
  </SOURCES>
114
114
  <excluded>
115
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/dry-container-0.7.1/spec" />
116
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/dry-container-0.7.1/rakelib" />
115
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/dry-container-0.7.2/spec" />
116
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/dry-container-0.7.2/rakelib" />
117
117
  </excluded>
118
118
  </library>
119
119
  </orderEntry>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-stream-wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre Del Vecchio
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-24 00:00:00.000000000 Z
11
+ date: 2019-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -139,7 +139,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  - !ruby/object:Gem::Version
140
140
  version: '0'
141
141
  requirements: []
142
- rubygems_version: 3.0.3
142
+ rubyforge_project:
143
+ rubygems_version: 2.7.6.2
143
144
  signing_key:
144
145
  specification_version: 4
145
146
  summary: Redis Stream Wrapper