waterdrop 0.3.0 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +1 -1
- data/CHANGELOG.md +12 -0
- data/Gemfile.lock +60 -86
- data/Rakefile +1 -2
- data/lib/water_drop.rb +47 -0
- data/lib/water_drop/message.rb +4 -2
- data/lib/water_drop/producer_proxy.rb +3 -1
- data/lib/water_drop/version.rb +1 -1
- data/lib/waterdrop.rb +2 -47
- data/waterdrop.gemspec +1 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab65b6b8e98a843a2c27d89bd739cfc3b3d1bce4
|
4
|
+
data.tar.gz: e724e7d3cfb190542fd94143ae02535e143181d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5f23ebad58c98bc249e538a90f1fc053ff2539a54d27caaff42101b682435152b49ce6948c66755d41f472b83da72f2f71dbb6c508e0fdc42d43bc5cc2d8d80
|
7
|
+
data.tar.gz: cf4e30a81f495d65a422989163028db62e65e4f3fc28a5a319d8abc2daf89b0c403eadfa1f3f3f50473397326a0f407bcabbaded4a8fe0f42dc698f96a86e5a6
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.3.
|
1
|
+
2.3.1
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# WaterDrop changelog
|
2
2
|
|
3
|
+
## 0.3.2
|
4
|
+
- Removed support for Ruby 2.1.*
|
5
|
+
- Ruby 2.3.1 as default
|
6
|
+
- Gem dump
|
7
|
+
|
8
|
+
## 0.3.1
|
9
|
+
- Dev tools update
|
10
|
+
- Gem update
|
11
|
+
- Specs updates
|
12
|
+
- File namming convention fix from waterdrop to water_drop + compatibility file
|
13
|
+
- Additional params (partition, etc) that can be passed into producer
|
14
|
+
|
3
15
|
## 0.3.0
|
4
16
|
- Driver change from Poseidon (not maintained) to Ruby-Kafka
|
5
17
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
waterdrop (0.3.
|
4
|
+
waterdrop (0.3.2)
|
5
5
|
bundler
|
6
6
|
connection_pool
|
7
7
|
null-logger
|
@@ -11,39 +11,28 @@ PATH
|
|
11
11
|
GEM
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
|
-
|
15
|
-
|
16
|
-
builder (~> 3.1)
|
17
|
-
activesupport (4.2.6)
|
14
|
+
activesupport (5.0.0)
|
15
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
18
16
|
i18n (~> 0.7)
|
19
|
-
json (~> 1.7, >= 1.7.7)
|
20
17
|
minitest (~> 5.1)
|
21
|
-
thread_safe (~> 0.3, >= 0.3.4)
|
22
18
|
tzinfo (~> 1.1)
|
23
19
|
addressable (2.4.0)
|
24
|
-
ast (2.
|
20
|
+
ast (2.3.0)
|
25
21
|
axiom-types (0.1.1)
|
26
22
|
descendants_tracker (~> 0.0.4)
|
27
23
|
ice_nine (~> 0.11.0)
|
28
24
|
thread_safe (~> 0.3, >= 0.3.1)
|
29
|
-
brakeman (3.
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
ruby2ruby (~> 2.3.0)
|
34
|
-
ruby_parser (~> 3.8.1)
|
35
|
-
safe_yaml (>= 1.0)
|
36
|
-
sass (~> 3.0)
|
37
|
-
slim (>= 1.3.6, < 4.0)
|
38
|
-
terminal-table (~> 1.4)
|
39
|
-
bson (4.0.4)
|
40
|
-
builder (3.2.2)
|
25
|
+
brakeman (3.3.3)
|
26
|
+
bundler-audit (0.5.0)
|
27
|
+
bundler (~> 1.2)
|
28
|
+
thor (~> 0.18)
|
41
29
|
codeclimate-engine-rb (0.3.1)
|
42
30
|
virtus (~> 1.0)
|
43
31
|
coderay (1.1.1)
|
44
32
|
coercible (1.0.0)
|
45
33
|
descendants_tracker (~> 0.0.1)
|
46
|
-
colorize (0.
|
34
|
+
colorize (0.8.1)
|
35
|
+
concurrent-ruby (1.0.2)
|
47
36
|
connection_pool (2.2.0)
|
48
37
|
descendants_tracker (0.0.4)
|
49
38
|
thread_safe (~> 0.3, >= 0.3.1)
|
@@ -51,105 +40,94 @@ GEM
|
|
51
40
|
docile (1.1.5)
|
52
41
|
equalizer (0.0.11)
|
53
42
|
erubis (2.7.0)
|
54
|
-
faker (1.6.
|
43
|
+
faker (1.6.6)
|
55
44
|
i18n (~> 0.5)
|
56
|
-
flay (2.
|
45
|
+
flay (2.8.0)
|
57
46
|
erubis (~> 2.7.0)
|
47
|
+
path_expander (~> 1.0)
|
58
48
|
ruby_parser (~> 3.0)
|
59
49
|
sexp_processor (~> 4.0)
|
60
|
-
flog (4.
|
50
|
+
flog (4.4.0)
|
51
|
+
path_expander (~> 1.0)
|
61
52
|
ruby_parser (~> 3.1, > 3.1.0)
|
62
53
|
sexp_processor (~> 4.4)
|
63
54
|
haml (4.0.7)
|
64
55
|
tilt
|
65
|
-
|
56
|
+
haml_lint (0.18.1)
|
66
57
|
haml (~> 4.0)
|
67
|
-
|
58
|
+
rake (>= 10, < 12)
|
59
|
+
rubocop (>= 0.36.0)
|
68
60
|
sysexits (~> 1.1)
|
69
|
-
highline (1.7.8)
|
70
61
|
i18n (0.7.0)
|
71
62
|
ice_nine (0.11.2)
|
72
|
-
json (
|
63
|
+
json (2.0.2)
|
73
64
|
launchy (2.4.3)
|
74
65
|
addressable (~> 2.3)
|
75
66
|
method_source (0.8.2)
|
76
|
-
minitest (5.
|
77
|
-
mongo (2.2.4)
|
78
|
-
bson (~> 4.0)
|
79
|
-
mongoid (5.1.1)
|
80
|
-
activemodel (~> 4.0)
|
81
|
-
mongo (~> 2.1)
|
82
|
-
origin (~> 2.2)
|
83
|
-
tzinfo (>= 0.3.37)
|
84
|
-
mongoid-rspec (3.0.0)
|
85
|
-
mongoid (~> 5.0)
|
86
|
-
rake
|
87
|
-
rspec (~> 3.3)
|
67
|
+
minitest (5.9.0)
|
88
68
|
null-logger (0.1.1)
|
89
|
-
|
90
|
-
parser (2.3.0.6)
|
69
|
+
parser (2.3.1.2)
|
91
70
|
ast (~> 2.2)
|
92
|
-
|
71
|
+
path_expander (1.0.0)
|
72
|
+
polishgeeks-dev-tools (1.3.2)
|
93
73
|
brakeman
|
74
|
+
bundler-audit
|
94
75
|
faker
|
95
|
-
|
96
|
-
mongoid-rspec
|
76
|
+
haml_lint
|
97
77
|
pry
|
98
78
|
rspec
|
99
79
|
rubocop
|
80
|
+
rubocop-rspec
|
100
81
|
rubycritic
|
101
82
|
shoulda
|
102
83
|
simplecov
|
103
84
|
timecop
|
104
85
|
yard
|
105
86
|
powerpack (0.1.1)
|
106
|
-
pry (0.10.
|
87
|
+
pry (0.10.4)
|
107
88
|
coderay (~> 1.1.0)
|
108
89
|
method_source (~> 0.8.1)
|
109
90
|
slop (~> 3.4)
|
110
91
|
rainbow (2.1.0)
|
111
|
-
rake (11.
|
112
|
-
reek (
|
92
|
+
rake (11.2.2)
|
93
|
+
reek (4.1.0)
|
113
94
|
codeclimate-engine-rb (~> 0.3.1)
|
114
|
-
parser (~> 2.3, >= 2.3.
|
95
|
+
parser (~> 2.3.1, >= 2.3.1.2)
|
115
96
|
rainbow (~> 2.0)
|
116
|
-
rspec (3.
|
117
|
-
rspec-core (~> 3.
|
118
|
-
rspec-expectations (~> 3.
|
119
|
-
rspec-mocks (~> 3.
|
120
|
-
rspec-core (3.
|
121
|
-
rspec-support (~> 3.
|
122
|
-
rspec-expectations (3.
|
97
|
+
rspec (3.5.0)
|
98
|
+
rspec-core (~> 3.5.0)
|
99
|
+
rspec-expectations (~> 3.5.0)
|
100
|
+
rspec-mocks (~> 3.5.0)
|
101
|
+
rspec-core (3.5.1)
|
102
|
+
rspec-support (~> 3.5.0)
|
103
|
+
rspec-expectations (3.5.0)
|
123
104
|
diff-lcs (>= 1.2.0, < 2.0)
|
124
|
-
rspec-support (~> 3.
|
125
|
-
rspec-mocks (3.
|
105
|
+
rspec-support (~> 3.5.0)
|
106
|
+
rspec-mocks (3.5.0)
|
126
107
|
diff-lcs (>= 1.2.0, < 2.0)
|
127
|
-
rspec-support (~> 3.
|
128
|
-
rspec-support (3.
|
129
|
-
rubocop (0.
|
130
|
-
parser (>= 2.3.
|
108
|
+
rspec-support (~> 3.5.0)
|
109
|
+
rspec-support (3.5.0)
|
110
|
+
rubocop (0.42.0)
|
111
|
+
parser (>= 2.3.1.1, < 3.0)
|
131
112
|
powerpack (~> 0.1)
|
132
113
|
rainbow (>= 1.99.1, < 3.0)
|
133
114
|
ruby-progressbar (~> 1.7)
|
134
115
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
ruby_parser (3.8.1)
|
116
|
+
rubocop-rspec (1.5.1)
|
117
|
+
rubocop (>= 0.41.2)
|
118
|
+
ruby-kafka (0.3.12)
|
119
|
+
ruby-progressbar (1.8.1)
|
120
|
+
ruby_parser (3.8.2)
|
141
121
|
sexp_processor (~> 4.1)
|
142
|
-
rubycritic (2.
|
122
|
+
rubycritic (2.9.2)
|
143
123
|
colorize
|
144
|
-
flay (= 2.
|
145
|
-
flog (= 4.
|
124
|
+
flay (= 2.8.0)
|
125
|
+
flog (= 4.4.0)
|
146
126
|
launchy (= 2.4.3)
|
147
|
-
parser (
|
148
|
-
reek (=
|
127
|
+
parser (= 2.3.1.2)
|
128
|
+
reek (= 4.1.0)
|
149
129
|
ruby_parser (~> 3.8)
|
150
130
|
virtus (~> 1.0)
|
151
|
-
safe_yaml (1.0.4)
|
152
|
-
sass (3.4.21)
|
153
131
|
sexp_processor (4.7.0)
|
154
132
|
shoulda (3.5.0)
|
155
133
|
shoulda-context (~> 1.0, >= 1.0.1)
|
@@ -157,30 +135,26 @@ GEM
|
|
157
135
|
shoulda-context (1.2.1)
|
158
136
|
shoulda-matchers (2.8.0)
|
159
137
|
activesupport (>= 3.0.0)
|
160
|
-
simplecov (0.
|
138
|
+
simplecov (0.12.0)
|
161
139
|
docile (~> 1.1.0)
|
162
|
-
json (
|
140
|
+
json (>= 1.8, < 3)
|
163
141
|
simplecov-html (~> 0.10.0)
|
164
142
|
simplecov-html (0.10.0)
|
165
|
-
slim (3.0.6)
|
166
|
-
temple (~> 0.7.3)
|
167
|
-
tilt (>= 1.3.3, < 2.1)
|
168
143
|
slop (3.6.0)
|
169
144
|
sysexits (1.2.0)
|
170
|
-
|
171
|
-
terminal-table (1.5.2)
|
145
|
+
thor (0.19.1)
|
172
146
|
thread_safe (0.3.5)
|
173
|
-
tilt (2.0.
|
174
|
-
timecop (0.8.
|
147
|
+
tilt (2.0.5)
|
148
|
+
timecop (0.8.1)
|
175
149
|
tzinfo (1.2.2)
|
176
150
|
thread_safe (~> 0.1)
|
177
|
-
unicode-display_width (1.0
|
151
|
+
unicode-display_width (1.1.0)
|
178
152
|
virtus (1.0.5)
|
179
153
|
axiom-types (~> 0.1)
|
180
154
|
coercible (~> 1.0)
|
181
155
|
descendants_tracker (~> 0.0, >= 0.0.3)
|
182
156
|
equalizer (~> 0.0, >= 0.0.9)
|
183
|
-
yard (0.
|
157
|
+
yard (0.9.5)
|
184
158
|
|
185
159
|
PLATFORMS
|
186
160
|
ruby
|
data/Rakefile
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'bundler'
|
2
|
-
require 'bundler/gem_tasks'
|
3
2
|
require 'rake'
|
4
3
|
require 'polishgeeks-dev-tools'
|
5
4
|
|
@@ -8,7 +7,7 @@ PolishGeeks::DevTools.setup do |config|
|
|
8
7
|
config.haml_lint = false
|
9
8
|
end
|
10
9
|
|
11
|
-
desc 'Self check using
|
10
|
+
desc 'Self check using polishgeeks-dev-tools'
|
12
11
|
task :check do
|
13
12
|
PolishGeeks::DevTools::Runner.new.execute(
|
14
13
|
PolishGeeks::DevTools::Logger.new
|
data/lib/water_drop.rb
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# External components
|
2
|
+
%w(
|
3
|
+
rake
|
4
|
+
rubygems
|
5
|
+
bundler
|
6
|
+
logger
|
7
|
+
pathname
|
8
|
+
json
|
9
|
+
kafka
|
10
|
+
forwardable
|
11
|
+
connection_pool
|
12
|
+
null_logger
|
13
|
+
).each { |lib| require lib }
|
14
|
+
|
15
|
+
# Internal components
|
16
|
+
base_path = File.dirname(__FILE__) + '/water_drop'
|
17
|
+
|
18
|
+
%w(
|
19
|
+
version
|
20
|
+
producer_proxy
|
21
|
+
pool
|
22
|
+
config
|
23
|
+
message
|
24
|
+
).each { |lib| require "#{base_path}/#{lib}" }
|
25
|
+
|
26
|
+
# WaterDrop library
|
27
|
+
module WaterDrop
|
28
|
+
class << self
|
29
|
+
attr_writer :logger
|
30
|
+
|
31
|
+
# @return [Logger] logger that we want to use
|
32
|
+
def logger
|
33
|
+
@logger ||= NullLogger.new
|
34
|
+
end
|
35
|
+
|
36
|
+
# Sets up the whole configuration
|
37
|
+
# @param [Block] block configuration block
|
38
|
+
def setup(&block)
|
39
|
+
Config.setup(&block)
|
40
|
+
end
|
41
|
+
|
42
|
+
# @return [WaterDrop::Config] config instance
|
43
|
+
def config
|
44
|
+
Config.config
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/lib/water_drop/message.rb
CHANGED
@@ -1,17 +1,19 @@
|
|
1
1
|
module WaterDrop
|
2
2
|
# Message class which encapsulate single Kafka message logic and its delivery
|
3
3
|
class Message
|
4
|
-
attr_reader :topic, :message
|
4
|
+
attr_reader :topic, :message, :options
|
5
5
|
|
6
6
|
# @param topic [String, Symbol] a topic to which we want to send a message
|
7
7
|
# @param message [Object] any object that can be serialized to a JSON string or
|
8
8
|
# that can be casted to a string
|
9
|
+
# @param options [Hash] (optional) additonal options to pass to the Kafka producer
|
9
10
|
# @return [WaterDrop::Message] WaterDrop message instance
|
10
11
|
# @example Creating a new message
|
11
12
|
# WaterDrop::Message.new(topic, message)
|
12
|
-
def initialize(topic, message)
|
13
|
+
def initialize(topic, message, options = {})
|
13
14
|
@topic = topic.to_s
|
14
15
|
@message = message
|
16
|
+
@options = options
|
15
17
|
end
|
16
18
|
|
17
19
|
# Sents a current message to Kafka
|
@@ -30,7 +30,9 @@ module WaterDrop
|
|
30
30
|
# ProducerProxy.new.send_message(WaterDrop::Message.new(topic, message))
|
31
31
|
def send_message(message)
|
32
32
|
touch
|
33
|
-
producer.produce(message.message,
|
33
|
+
producer.produce(message.message, {
|
34
|
+
topic: message.topic
|
35
|
+
}.merge(message.options))
|
34
36
|
producer.deliver_messages
|
35
37
|
rescue StandardError => e
|
36
38
|
reload!
|
data/lib/water_drop/version.rb
CHANGED
data/lib/waterdrop.rb
CHANGED
@@ -1,47 +1,2 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
rake
|
4
|
-
rubygems
|
5
|
-
bundler
|
6
|
-
logger
|
7
|
-
pathname
|
8
|
-
json
|
9
|
-
kafka
|
10
|
-
forwardable
|
11
|
-
connection_pool
|
12
|
-
null_logger
|
13
|
-
).each { |lib| require lib }
|
14
|
-
|
15
|
-
# Internal components
|
16
|
-
base_path = File.dirname(__FILE__) + '/water_drop'
|
17
|
-
|
18
|
-
%w(
|
19
|
-
version
|
20
|
-
producer_proxy
|
21
|
-
pool
|
22
|
-
config
|
23
|
-
message
|
24
|
-
).each { |lib| require "#{base_path}/#{lib}" }
|
25
|
-
|
26
|
-
# WaterDrop library
|
27
|
-
module WaterDrop
|
28
|
-
class << self
|
29
|
-
attr_writer :logger
|
30
|
-
|
31
|
-
# @return [Logger] logger that we want to use
|
32
|
-
def logger
|
33
|
-
@logger ||= NullLogger.new
|
34
|
-
end
|
35
|
-
|
36
|
-
# Sets up the whole configuration
|
37
|
-
# @param [Block] block configuration block
|
38
|
-
def setup(&block)
|
39
|
-
Config.setup(&block)
|
40
|
-
end
|
41
|
-
|
42
|
-
# @return [WaterDrop::Config] config instance
|
43
|
-
def config
|
44
|
-
Config.config
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
1
|
+
# This file is used as a compatibility step
|
2
|
+
require 'water_drop'
|
data/waterdrop.gemspec
CHANGED
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.add_dependency 'ruby-kafka', '>= 0'
|
20
20
|
spec.add_dependency 'connection_pool', '>= 0'
|
21
21
|
spec.add_dependency 'null-logger'
|
22
|
+
spec.required_ruby_version = '>= 2.2.0'
|
22
23
|
|
23
24
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec)/}) }
|
24
25
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: waterdrop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maciej Mensfeld
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-07-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -99,6 +99,7 @@ files:
|
|
99
99
|
- MIT-LICENCE
|
100
100
|
- README.md
|
101
101
|
- Rakefile
|
102
|
+
- lib/water_drop.rb
|
102
103
|
- lib/water_drop/config.rb
|
103
104
|
- lib/water_drop/message.rb
|
104
105
|
- lib/water_drop/pool.rb
|
@@ -118,7 +119,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
118
119
|
requirements:
|
119
120
|
- - ">="
|
120
121
|
- !ruby/object:Gem::Version
|
121
|
-
version:
|
122
|
+
version: 2.2.0
|
122
123
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
123
124
|
requirements:
|
124
125
|
- - ">="
|
@@ -131,4 +132,3 @@ signing_key:
|
|
131
132
|
specification_version: 4
|
132
133
|
summary: Kafka messaging made easy!
|
133
134
|
test_files: []
|
134
|
-
has_rdoc:
|