waterdrop 0.1.5 → 0.1.6

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: e75b417b4e1702a407c03a3b09b414c778d22192
4
- data.tar.gz: 960675222c4c7e002e3cbfab0803c70d007b7145
3
+ metadata.gz: 0ba074f881bf7dae566b0f1c084d328913209b1e
4
+ data.tar.gz: da63b01f8a1ceeaf044fa1009e1ee4ba8db3c4bd
5
5
  SHA512:
6
- metadata.gz: d1b90f0160aa014f312117a5d275fa3b1630b442693da25ccd807fe3f0f06e37a19ebb91f69ad0ee963370d6c08dca081de56f854f63880b3a9a8bd428cb690c
7
- data.tar.gz: c0a933015c71f03b774243a16936dab5f0820578f5e00b1923b10c44dc294bc2e9413bc16b9c92d1cdd08b5e68d83aaf34ed7109315ff7bbfaf6302ecfa04bea
6
+ metadata.gz: 7bda18594a2321c809a2ffd0463a0dfcc3ee714ed60e36cb59ca15a94e007cca319e178baf03962b31cab56ecea603af7bebac9f2968320bb309bbb843fe8ce7
7
+ data.tar.gz: 6475608c7646f70561c74209961159621ba8c252aaecf552297564b9c2798ef9ddd41160e8eb60c3f526ed6d0bcc707c66947c9b95b25680450cd1f6db99e36f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # WaterDrop changelog
2
2
 
3
+ ## 0.1.6
4
+ - Added null-logger gem
5
+
3
6
  ## 0.1.5
4
7
  - raise_on_failure flag to ignore (if false) that message was not sent
5
8
 
data/Gemfile.lock CHANGED
@@ -1,10 +1,11 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- waterdrop (0.1.5)
4
+ waterdrop (0.1.6)
5
5
  aspector
6
6
  bundler
7
7
  connection_pool
8
+ null-logger
8
9
  poseidon
9
10
  rake
10
11
 
@@ -12,10 +13,10 @@ GEM
12
13
  remote: https://rubygems.org/
13
14
  specs:
14
15
  abstract_type (0.0.7)
15
- activemodel (4.2.3)
16
- activesupport (= 4.2.3)
16
+ activemodel (4.2.4)
17
+ activesupport (= 4.2.4)
17
18
  builder (~> 3.1)
18
- activesupport (4.2.3)
19
+ activesupport (4.2.4)
19
20
  i18n (~> 0.7)
20
21
  json (~> 1.7, >= 1.7.7)
21
22
  minitest (~> 5.1)
@@ -32,17 +33,18 @@ GEM
32
33
  descendants_tracker (~> 0.0.4)
33
34
  ice_nine (~> 0.11.0)
34
35
  thread_safe (~> 0.3, >= 0.3.1)
35
- brakeman (3.0.5)
36
+ brakeman (3.1.0)
36
37
  erubis (~> 2.6)
37
38
  fastercsv (~> 1.5)
38
39
  haml (>= 3.0, < 5.0)
39
- highline (~> 1.6.20)
40
+ highline (~> 1.6)
40
41
  multi_json (~> 1.2)
41
- ruby2ruby (~> 2.1.1)
42
+ ruby2ruby (>= 2.1.1, < 2.3.0)
42
43
  ruby_parser (~> 3.7.0)
43
44
  sass (~> 3.0)
44
- terminal-table (~> 1.4)
45
- bson (3.2.1)
45
+ slim (>= 1.3.6, < 4.0)
46
+ terminal-table (~> 1.4.5)
47
+ bson (3.2.4)
46
48
  builder (3.2.2)
47
49
  coderay (1.1.0)
48
50
  coercible (1.0.0)
@@ -72,7 +74,7 @@ GEM
72
74
  haml (~> 4.0)
73
75
  rubocop (>= 0.25.0)
74
76
  sysexits (~> 1.1)
75
- highline (1.6.21)
77
+ highline (1.7.3)
76
78
  i18n (0.7.0)
77
79
  ice_nine (0.11.1)
78
80
  json (1.8.3)
@@ -94,11 +96,12 @@ GEM
94
96
  connection_pool (~> 2.0)
95
97
  optionable (~> 0.2.0)
96
98
  multi_json (1.11.2)
99
+ null-logger (0.1.0)
97
100
  optionable (0.2.0)
98
101
  origin (2.1.1)
99
102
  parser (2.2.2.6)
100
103
  ast (>= 1.1, < 3.0)
101
- polishgeeks-dev-tools (1.1.0)
104
+ polishgeeks-dev-tools (1.2.0)
102
105
  brakeman
103
106
  faker
104
107
  haml-lint
@@ -137,14 +140,14 @@ GEM
137
140
  diff-lcs (>= 1.2.0, < 2.0)
138
141
  rspec-support (~> 3.3.0)
139
142
  rspec-support (3.3.0)
140
- rubocop (0.33.0)
143
+ rubocop (0.34.0)
141
144
  astrolabe (~> 1.3)
142
145
  parser (>= 2.2.2.5, < 3.0)
143
146
  powerpack (~> 0.1)
144
147
  rainbow (>= 1.99.1, < 3.0)
145
148
  ruby-progressbar (~> 1.4)
146
149
  ruby-progressbar (1.7.5)
147
- ruby2ruby (2.1.4)
150
+ ruby2ruby (2.2.0)
148
151
  ruby_parser (~> 3.1)
149
152
  sexp_processor (~> 4.0)
150
153
  ruby_parser (3.7.1)
@@ -156,7 +159,7 @@ GEM
156
159
  reek (= 1.6.3)
157
160
  ruby2ruby (>= 2.1.1, < 3.0)
158
161
  virtus (~> 1.0)
159
- sass (3.4.17)
162
+ sass (3.4.18)
160
163
  sexp_processor (4.6.0)
161
164
  shoulda (3.5.0)
162
165
  shoulda-context (~> 1.0, >= 1.0.1)
@@ -169,9 +172,13 @@ GEM
169
172
  json (~> 1.8)
170
173
  simplecov-html (~> 0.10.0)
171
174
  simplecov-html (0.10.0)
175
+ slim (3.0.6)
176
+ temple (~> 0.7.3)
177
+ tilt (>= 1.3.3, < 2.1)
172
178
  slop (3.6.0)
173
179
  sysexits (1.2.0)
174
- terminal-table (1.5.2)
180
+ temple (0.7.6)
181
+ terminal-table (1.4.5)
175
182
  thread_safe (0.3.5)
176
183
  tilt (2.0.1)
177
184
  timecop (0.8.0)
data/README.md CHANGED
@@ -149,6 +149,25 @@ ClassName.new.run
149
149
 
150
150
  a message with the given message will be send before and after the method execution.
151
151
 
152
+ ## References
153
+
154
+ * [Karafka framework](https://github.com/karafka/karafka)
155
+ * [Waterdrop](https://github.com/karafka/waterdrop)
156
+ * [Sidekiq Glass](https://github.com/karafka/sidekiq-glass)
157
+ * [Envlogic](https://github.com/karafka/envlogic)
158
+ * [Null Logger](https://github.com/karafka/null-logger)
159
+
152
160
  ## Note on Patches/Pull Requests
153
161
 
154
- Fork the project. Make your feature addition or bug fix. Add tests for it. This is important so I don't break it in a future version unintentionally. 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.
162
+ Fork the project.
163
+ Make your feature addition or bug fix.
164
+ Add tests for it. This is important so I don't break it in a future version unintentionally.
165
+ 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.
166
+
167
+ 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:
168
+
169
+ ```bash
170
+ bundle exec rake
171
+ ```
172
+
173
+ to check if everything is in order. After that you can submit a pull request.
@@ -32,10 +32,13 @@ module WaterDrop
32
32
  Poseidon::MessageToSend.new(topic, message)
33
33
  ])
34
34
  end
35
+ ::WaterDrop.logger.info("Message #{message} was sent to topic '#{topic}'")
35
36
  rescue *CATCHED_ERRORS => e
36
37
  # Reraise if we want to raise on failure
37
38
  # Ignore if we dont want to know that something went wrong
38
- raise(e) if ::WaterDrop.config.raise_on_failure?
39
+ return unless ::WaterDrop.config.raise_on_failure?
40
+ ::WaterDrop.logger.fatal(e)
41
+ raise(e)
39
42
  end
40
43
  end
41
44
  end
@@ -1,5 +1,5 @@
1
1
  # WaterDrop library
2
2
  module WaterDrop
3
3
  # Current WaterDrop version
4
- VERSION = '0.1.5'
4
+ VERSION = '0.1.6'
5
5
  end
data/lib/waterdrop.rb CHANGED
@@ -10,6 +10,7 @@
10
10
  aspector
11
11
  forwardable
12
12
  connection_pool
13
+ null_logger
13
14
  ).each { |lib| require lib }
14
15
 
15
16
  # Internal components
@@ -19,7 +20,6 @@ base_path = File.dirname(__FILE__) + '/water_drop'
19
20
  version
20
21
  pool
21
22
  config
22
- logger
23
23
  message
24
24
  aspects/base_aspect
25
25
  aspects/formatter
@@ -35,7 +35,7 @@ module WaterDrop
35
35
 
36
36
  # @return [Logger] logger that we want to use
37
37
  def logger
38
- @logger ||= Logger.new
38
+ @logger ||= NullLogger.new
39
39
  end
40
40
 
41
41
  # Sets up the whole configuration
data/waterdrop.gemspec CHANGED
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.add_dependency 'aspector', '>= 0'
20
20
  spec.add_dependency 'poseidon', '>= 0'
21
21
  spec.add_dependency 'connection_pool', '>= 0'
22
+ spec.add_dependency 'null-logger'
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.1.5
4
+ version: 0.1.6
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: 2015-08-27 00:00:00.000000000 Z
12
+ date: 2015-09-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -81,6 +81,20 @@ dependencies:
81
81
  - - ">="
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
+ - !ruby/object:Gem::Dependency
85
+ name: null-logger
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ type: :runtime
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
84
98
  description: Kafka messages with aspects made easy!
85
99
  email:
86
100
  - maciej@mensfeld.pl
@@ -105,7 +119,6 @@ files:
105
119
  - lib/water_drop/aspects/before_aspect.rb
106
120
  - lib/water_drop/aspects/formatter.rb
107
121
  - lib/water_drop/config.rb
108
- - lib/water_drop/logger.rb
109
122
  - lib/water_drop/message.rb
110
123
  - lib/water_drop/pool.rb
111
124
  - lib/water_drop/version.rb
@@ -1,10 +0,0 @@
1
- module WaterDrop
2
- # Null logger for karafka
3
- # Is used when logger is not defined
4
- class Logger
5
- # Returns nil for any method call
6
- def method_missing(*_args, &_block)
7
- nil
8
- end
9
- end
10
- end