waterdrop 0.3.2.3 → 0.3.2.4

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: 2239b15837b73734eb25eece381156ee30de0829
4
- data.tar.gz: a5bd3c2d2d17b53ed907b91bb2cf2ea71a5a390f
3
+ metadata.gz: b8146a30bc7d849c7e9bd8d5ab6a3e65697467a4
4
+ data.tar.gz: b6b606e0194c98093293fd42fb891d821a2937a7
5
5
  SHA512:
6
- metadata.gz: d3ee394cb790de25cdfa9a4705ed34f9d1d07610f251504674eaf40a446f7919acf4c878d1a3b13a6ca448227781bcdb1044f2add959bc7d913cb09ad180cc06
7
- data.tar.gz: c32e727f2ef67fa515fe67fde2f023d2ded5edef0a4e59532fcb5552c8a27a0d10dec4dc5eef14a159e162954fbde5e7b6d87161a5b645bd7ccd38b53e4b6b9e
6
+ metadata.gz: 5e49033efc2f820a6c61591f475f9ff2c9782b8867a10b95ff31d4a375f0979913aa96315ac93ade25befbad558309ebc95c1015de98b21933c19b7b745a8c7c
7
+ data.tar.gz: 54a112efc2652be8e0315b183f7fb3e7c16322d3cd67ef145d3f49c6ba172baf9cffdd374b2651bfe07c9500b150cb5d78d6c6ae4da73e31368121dd58d8faa6
data/.rspec CHANGED
@@ -1 +1,4 @@
1
+ --color
2
+ --format documentation
1
3
  --require spec_helper
4
+ --tty
data/.travis.yml CHANGED
@@ -1,6 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.3
4
3
  - 2.3.0
5
4
  - 2.3.1
6
5
  - 2.3.2
data/CHANGELOG.md CHANGED
@@ -7,6 +7,8 @@
7
7
  - Gem dump x2
8
8
  - Dry configurable config (#20)
9
9
  - added .rspec for default spec helper require
10
+ - Added SSL capabilities
11
+ - Coditsu instead of PG dev tools for quality control
10
12
 
11
13
  ## 0.3.1
12
14
  - Dev tools update
data/Gemfile CHANGED
@@ -1,7 +1,4 @@
1
- source 'https://rubygems.org'
1
+ # frozen_string_literal: true
2
2
 
3
+ source 'https://rubygems.org'
3
4
  gemspec
4
-
5
- group :development, :test do
6
- gem 'polishgeeks-dev-tools'
7
- end
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- waterdrop (0.3.2.3)
4
+ waterdrop (0.3.2.4)
5
5
  bundler
6
6
  connection_pool
7
7
  dry-configurable (~> 0.6)
@@ -12,158 +12,41 @@ PATH
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- activesupport (5.0.1)
16
- concurrent-ruby (~> 1.0, >= 1.0.2)
17
- i18n (~> 0.7)
18
- minitest (~> 5.1)
19
- tzinfo (~> 1.1)
20
- addressable (2.4.0)
21
- ast (2.3.0)
22
- axiom-types (0.1.1)
23
- descendants_tracker (~> 0.0.4)
24
- ice_nine (~> 0.11.0)
25
- thread_safe (~> 0.3, >= 0.3.1)
26
- brakeman (3.3.3)
27
- bundler-audit (0.5.0)
28
- bundler (~> 1.2)
29
- thor (~> 0.18)
30
- codeclimate-engine-rb (0.3.1)
31
- virtus (~> 1.0)
32
- coderay (1.1.1)
33
- coercible (1.0.0)
34
- descendants_tracker (~> 0.0.1)
35
- colorize (0.8.1)
36
- concurrent-ruby (1.0.4)
15
+ concurrent-ruby (1.0.5)
37
16
  connection_pool (2.2.1)
38
- descendants_tracker (0.0.4)
39
- thread_safe (~> 0.3, >= 0.3.1)
40
- diff-lcs (1.2.5)
17
+ diff-lcs (1.3)
41
18
  docile (1.1.5)
42
- dry-configurable (0.6.2)
19
+ dry-configurable (0.7.0)
43
20
  concurrent-ruby (~> 1.0)
44
- equalizer (0.0.11)
45
- erubis (2.7.0)
46
- faker (1.6.6)
47
- i18n (~> 0.5)
48
- flay (2.8.0)
49
- erubis (~> 2.7.0)
50
- path_expander (~> 1.0)
51
- ruby_parser (~> 3.0)
52
- sexp_processor (~> 4.0)
53
- flog (4.4.0)
54
- path_expander (~> 1.0)
55
- ruby_parser (~> 3.1, > 3.1.0)
56
- sexp_processor (~> 4.4)
57
- haml (4.0.7)
58
- tilt
59
- haml_lint (0.18.1)
60
- haml (~> 4.0)
61
- rake (>= 10, < 12)
62
- rubocop (>= 0.36.0)
63
- sysexits (~> 1.1)
64
- i18n (0.7.0)
65
- ice_nine (0.11.2)
66
- json (2.0.2)
67
- launchy (2.4.3)
68
- addressable (~> 2.3)
69
- method_source (0.8.2)
70
- minitest (5.10.1)
71
- null-logger (0.1.3)
72
- parser (2.3.1.2)
73
- ast (~> 2.2)
74
- path_expander (1.0.0)
75
- polishgeeks-dev-tools (1.3.2)
76
- brakeman
77
- bundler-audit
78
- faker
79
- haml_lint
80
- pry
81
- rspec
82
- rubocop
83
- rubocop-rspec
84
- rubycritic
85
- shoulda
86
- simplecov
87
- timecop
88
- yard
89
- powerpack (0.1.1)
90
- pry (0.10.4)
91
- coderay (~> 1.1.0)
92
- method_source (~> 0.8.1)
93
- slop (~> 3.4)
94
- rainbow (2.1.0)
95
- rake (11.3.0)
96
- reek (4.1.0)
97
- codeclimate-engine-rb (~> 0.3.1)
98
- parser (~> 2.3.1, >= 2.3.1.2)
99
- rainbow (~> 2.0)
100
- rspec (3.5.0)
101
- rspec-core (~> 3.5.0)
102
- rspec-expectations (~> 3.5.0)
103
- rspec-mocks (~> 3.5.0)
104
- rspec-core (3.5.1)
105
- rspec-support (~> 3.5.0)
106
- rspec-expectations (3.5.0)
21
+ json (2.1.0)
22
+ null-logger (0.1.4)
23
+ rake (12.0.0)
24
+ rspec (3.6.0)
25
+ rspec-core (~> 3.6.0)
26
+ rspec-expectations (~> 3.6.0)
27
+ rspec-mocks (~> 3.6.0)
28
+ rspec-core (3.6.0)
29
+ rspec-support (~> 3.6.0)
30
+ rspec-expectations (3.6.0)
107
31
  diff-lcs (>= 1.2.0, < 2.0)
108
- rspec-support (~> 3.5.0)
109
- rspec-mocks (3.5.0)
32
+ rspec-support (~> 3.6.0)
33
+ rspec-mocks (3.6.0)
110
34
  diff-lcs (>= 1.2.0, < 2.0)
111
- rspec-support (~> 3.5.0)
112
- rspec-support (3.5.0)
113
- rubocop (0.42.0)
114
- parser (>= 2.3.1.1, < 3.0)
115
- powerpack (~> 0.1)
116
- rainbow (>= 1.99.1, < 3.0)
117
- ruby-progressbar (~> 1.7)
118
- unicode-display_width (~> 1.0, >= 1.0.1)
119
- rubocop-rspec (1.5.1)
120
- rubocop (>= 0.41.2)
121
- ruby-kafka (0.3.16)
122
- ruby-progressbar (1.8.1)
123
- ruby_parser (3.8.2)
124
- sexp_processor (~> 4.1)
125
- rubycritic (2.9.2)
126
- colorize
127
- flay (= 2.8.0)
128
- flog (= 4.4.0)
129
- launchy (= 2.4.3)
130
- parser (= 2.3.1.2)
131
- reek (= 4.1.0)
132
- ruby_parser (~> 3.8)
133
- virtus (~> 1.0)
134
- sexp_processor (4.7.0)
135
- shoulda (3.5.0)
136
- shoulda-context (~> 1.0, >= 1.0.1)
137
- shoulda-matchers (>= 1.4.1, < 3.0)
138
- shoulda-context (1.2.1)
139
- shoulda-matchers (2.8.0)
140
- activesupport (>= 3.0.0)
141
- simplecov (0.12.0)
35
+ rspec-support (~> 3.6.0)
36
+ rspec-support (3.6.0)
37
+ ruby-kafka (0.3.17)
38
+ simplecov (0.14.1)
142
39
  docile (~> 1.1.0)
143
40
  json (>= 1.8, < 3)
144
41
  simplecov-html (~> 0.10.0)
145
- simplecov-html (0.10.0)
146
- slop (3.6.0)
147
- sysexits (1.2.0)
148
- thor (0.19.1)
149
- thread_safe (0.3.5)
150
- tilt (2.0.5)
151
- timecop (0.8.1)
152
- tzinfo (1.2.2)
153
- thread_safe (~> 0.1)
154
- unicode-display_width (1.1.0)
155
- virtus (1.0.5)
156
- axiom-types (~> 0.1)
157
- coercible (~> 1.0)
158
- descendants_tracker (~> 0.0, >= 0.0.3)
159
- equalizer (~> 0.0, >= 0.0.9)
160
- yard (0.9.5)
42
+ simplecov-html (0.10.1)
161
43
 
162
44
  PLATFORMS
163
45
  ruby
164
46
 
165
47
  DEPENDENCIES
166
- polishgeeks-dev-tools
48
+ rspec (~> 3.6.0)
49
+ simplecov (~> 0.14.1)
167
50
  waterdrop!
168
51
 
169
52
  BUNDLED WITH
data/README.md CHANGED
@@ -29,13 +29,16 @@ bundle install
29
29
 
30
30
  WaterDrop has following configuration options:
31
31
 
32
- | Option | Value type | Description |
33
- |-------------------------|---------------|----------------------------------|
34
- | send_messages | Boolean | Should we send messages to Kafka |
35
- | kafka.hosts | Array<String> | Kafka servers hosts with ports |
36
- | connection_pool_size | Integer | Kafka connection pool size |
37
- | connection_pool_timeout | Integer | Kafka connection pool timeout |
38
- | raise_on_failure | Boolean | Should we raise an exception when we cannot send message to Kafka - if false will silently ignore failures (will just ignore them) |
32
+ | Option | Required | Value type | Description |
33
+ |---------------------------|------------|---------------|----------------------------------|
34
+ | send_messages | true | Boolean | Should we send messages to Kafka |
35
+ | kafka.hosts | true | Array<String> | Kafka servers hosts with ports |
36
+ | connection_pool_size | true | Integer | Kafka connection pool size |
37
+ | connection_pool_timeout | true | Integer | Kafka connection pool timeout |
38
+ | raise_on_failure | true | Boolean | Should we raise an exception when we cannot send message to Kafka - if false will silently ignore failures (will just ignore them) |
39
+ | kafka.ssl.ca_cert | false | String | SSL CA certificate |
40
+ | kafka.ssl.client_cert | false | String | SSL client certificate |
41
+ | kafka.ssl.client_cert_key | false | String | SSL client certificate password |
39
42
 
40
43
  To apply this configuration, you need to use a *setup* method:
41
44
 
@@ -99,7 +102,11 @@ Make your feature addition or bug fix.
99
102
  Add tests for it. This is important so I don't break it in a future version unintentionally.
100
103
  Commit, do not mess with Rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull). Send me a pull request. Bonus points for topic branches.
101
104
 
102
- Each pull request must pass our quality requirements. To check if everything is as it should be, we use [PolishGeeks Dev Tools](https://github.com/polishgeeks/polishgeeks-dev-tools) that combine multiple linters and code analyzers. Please run:
105
+ [![coditsu](https://coditsu.io/assets/quality_bar.svg)](https://coditsu.io)
106
+
107
+ Each pull request must pass our quality requirements. To check if everything is as it should be, we use [Coditsu](https://coditsu.io) that combinse multiple linters and code analyzers. Unfortunately, for now it is invite-only based, so just ping us and we will give you access to the quality results.
108
+
109
+ Please run:
103
110
 
104
111
  ```bash
105
112
  bundle exec rake
data/Rakefile CHANGED
@@ -1,17 +1,7 @@
1
+ # frozen_string_literal: true
1
2
  require 'bundler'
2
3
  require 'rake'
3
- require 'polishgeeks-dev-tools'
4
+ require 'rspec/core/rake_task'
4
5
 
5
- PolishGeeks::DevTools.setup do |config|
6
- config.brakeman = false
7
- config.haml_lint = false
8
- end
9
-
10
- desc 'Self check using polishgeeks-dev-tools'
11
- task :check do
12
- PolishGeeks::DevTools::Runner.new.execute(
13
- PolishGeeks::DevTools::Logger.new
14
- )
15
- end
16
-
17
- task default: :check
6
+ RSpec::Core::RakeTask.new(:spec)
7
+ task default: :spec
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module WaterDrop
2
4
  # Configurator for setting up all options required by WaterDrop
3
5
  class Config
@@ -17,6 +19,15 @@ module WaterDrop
17
19
  setting :kafka do
18
20
  # @option hosts [Array<String>] Array that contains Kafka hosts with ports
19
21
  setting :hosts
22
+ # SSL authentication related settings
23
+ setting :ssl do
24
+ # option ca_cert [String] SSL CA certificate
25
+ setting :ca_cert, nil
26
+ # option client_cert [String] SSL client certificate
27
+ setting :client_cert, nil
28
+ # option client_cert_key [String] SSL client certificate password
29
+ setting :client_cert_key, nil
30
+ end
20
31
  end
21
32
 
22
33
  class << self
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module WaterDrop
2
4
  # Message class which encapsulate single Kafka message logic and its delivery
3
5
  class Message
@@ -6,7 +8,7 @@ module WaterDrop
6
8
  # @param topic [String, Symbol] a topic to which we want to send a message
7
9
  # @param message [Object] any object that can be serialized to a JSON string or
8
10
  # that can be casted to a string
9
- # @param options [Hash] (optional) additonal options to pass to the Kafka producer
11
+ # @param options [Hash] (optional) additional options to pass to the Kafka producer
10
12
  # @return [WaterDrop::Message] WaterDrop message instance
11
13
  # @example Creating a new message
12
14
  # WaterDrop::Message.new(topic, message)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module WaterDrop
2
4
  # Raw Kafka producers connection pool for WaterDrop messages delivery
3
5
  module Pool
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module WaterDrop
2
4
  # Proxy object for a producer (sender) objects that are inside pool
3
5
  # We use it to provide additional timeout monitoring layer
4
6
  # There used to be an issue with Poseidon (previous engine for this lib)
5
7
  # usage of sockets that are old and not used - that's why we just
6
8
  # reinitialize connection if the connection layer is not being used for too long
7
- # We keep this logic to avoid problems just in case. If those problems won't occure
9
+ # We keep this logic to avoid problems just in case. If those problems won't occur
8
10
  # with Ruby-Kafka, we will drop it
9
11
  class ProducerProxy
10
12
  # How long should be object considered alive if nothing is being
@@ -54,7 +56,12 @@ module WaterDrop
54
56
  # @return [Kafka::Producer] producer instance to which we can forward method requests
55
57
  def producer
56
58
  reload! if dead?
57
- @producer ||= Kafka.new(seed_brokers: ::WaterDrop.config.kafka.hosts).producer
59
+ @producer ||= Kafka.new(
60
+ seed_brokers: ::WaterDrop.config.kafka.hosts,
61
+ ssl_ca_cert: ::WaterDrop.config.kafka.ssl.ca_cert,
62
+ ssl_client_cert: ::WaterDrop.config.kafka.ssl.client_cert,
63
+ ssl_client_cert_key: ::WaterDrop.config.kafka.ssl.client_cert_key
64
+ ).producer
58
65
  end
59
66
 
60
67
  # @return [Boolean] true if we cannot use producer anymore because it was not used for a
@@ -65,7 +72,7 @@ module WaterDrop
65
72
 
66
73
  # Resets a producer so a new one will be created once requested
67
74
  def reload!
68
- @producer.shutdown if @producer
75
+ @producer&.shutdown
69
76
  @producer = nil
70
77
  end
71
78
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  # WaterDrop library
3
4
  module WaterDrop
4
5
  # Current WaterDrop version
5
- VERSION = '0.3.2.3'
6
+ VERSION = '0.3.2.4'
6
7
  end
data/lib/water_drop.rb CHANGED
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # External components
2
- %w(
4
+ %w[
3
5
  rake
4
6
  rubygems
5
7
  bundler
@@ -11,18 +13,18 @@
11
13
  connection_pool
12
14
  null_logger
13
15
  dry-configurable
14
- ).each { |lib| require lib }
16
+ ].each { |lib| require lib }
15
17
 
16
18
  # Internal components
17
19
  base_path = File.dirname(__FILE__) + '/water_drop'
18
20
 
19
- %w(
21
+ %w[
20
22
  version
21
23
  producer_proxy
22
24
  pool
23
25
  config
24
26
  message
25
- ).each { |lib| require "#{base_path}/#{lib}" }
27
+ ].each { |lib| require "#{base_path}/#{lib}" }
26
28
 
27
29
  # WaterDrop library
28
30
  module WaterDrop
data/lib/waterdrop.rb CHANGED
@@ -1,2 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # This file is used as a compatibility step
2
4
  require 'water_drop'
data/waterdrop.gemspec CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  lib = File.expand_path('../lib', __FILE__)
2
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
5
 
@@ -8,9 +10,9 @@ Gem::Specification.new do |spec|
8
10
  spec.version = ::WaterDrop::VERSION
9
11
  spec.platform = Gem::Platform::RUBY
10
12
  spec.authors = ['Maciej Mensfeld', 'Pavlo Vavruk']
11
- spec.email = %w( maciej@mensfeld.pl pavlo.vavruk@gmail.com )
13
+ spec.email = %w[maciej@mensfeld.pl pavlo.vavruk@gmail.com]
12
14
  spec.homepage = 'https://github.com/karafka/waterdrop'
13
- spec.summary = %q{ Kafka messaging made easy! }
15
+ spec.summary = ' Kafka messaging made easy! '
14
16
  spec.description = spec.summary
15
17
  spec.license = 'MIT'
16
18
 
@@ -20,9 +22,12 @@ Gem::Specification.new do |spec|
20
22
  spec.add_dependency 'connection_pool', '>= 0'
21
23
  spec.add_dependency 'null-logger'
22
24
  spec.add_dependency 'dry-configurable', '~> 0.6'
25
+
26
+ spec.add_development_dependency 'rspec', '~> 3.6.0'
27
+ spec.add_development_dependency 'simplecov', '~> 0.14.1'
23
28
  spec.required_ruby_version = '>= 2.2.0'
24
29
 
25
30
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec)/}) }
26
31
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
27
- spec.require_paths = %w( lib )
32
+ spec.require_paths = %w[lib]
28
33
  end
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.2.3
4
+ version: 0.3.2.4
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: 2017-03-30 00:00:00.000000000 Z
12
+ date: 2017-05-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -95,6 +95,34 @@ dependencies:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0.6'
98
+ - !ruby/object:Gem::Dependency
99
+ name: rspec
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - "~>"
103
+ - !ruby/object:Gem::Version
104
+ version: 3.6.0
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - "~>"
110
+ - !ruby/object:Gem::Version
111
+ version: 3.6.0
112
+ - !ruby/object:Gem::Dependency
113
+ name: simplecov
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - "~>"
117
+ - !ruby/object:Gem::Version
118
+ version: 0.14.1
119
+ type: :development
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - "~>"
124
+ - !ruby/object:Gem::Version
125
+ version: 0.14.1
98
126
  description: Kafka messaging made easy!
99
127
  email:
100
128
  - maciej@mensfeld.pl