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 +4 -4
- data/CODE_OF_CONDUCT.md +1 -1
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/redis/stream/wrapper.rb +10 -1
- data/lib/redis/stream/wrapper/message.rb +1 -1
- data/lib/redis/stream/wrapper/types.rb +1 -1
- data/lib/redis/stream/wrapper/version.rb +1 -1
- data/redis-stream-wrapper.iml +9 -9
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd2eebe3525308ca614a1e6aed1c1b23b2dcf2da80b39f05f6b1bf9bd8dabbbe
|
4
|
+
data.tar.gz: 38975df347acda91549ccccc614b667aab801e51ba470a72f7fd39b2c39c75f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
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/
|
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).
|
data/lib/redis/stream/wrapper.rb
CHANGED
@@ -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:
|
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
|
data/redis-stream-wrapper.iml
CHANGED
@@ -96,24 +96,24 @@
|
|
96
96
|
</library>
|
97
97
|
</orderEntry>
|
98
98
|
<orderEntry type="module-library">
|
99
|
-
<library name="dry-container (vbundled(0.7.
|
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.
|
105
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/dry-container-0.7.
|
106
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/dry-container-0.7.
|
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.
|
111
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/dry-container-0.7.
|
112
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/dry-container-0.7.
|
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.
|
116
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/dry-container-0.7.
|
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
|
+
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-
|
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
|
-
|
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
|