kafka_notifier 0.0.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1870e97b0d6597b618c47c6be538070633646d32
4
- data.tar.gz: ee4d32b368950a7da676e92235f058f29a0f2f60
3
+ metadata.gz: f2009a583f6cea72367ca0a3fee7e0228d747945
4
+ data.tar.gz: d11ae75226ded0fa4697c241a3970a33eb5784ad
5
5
  SHA512:
6
- metadata.gz: 279994eb8e7b5e3a020b79a3ff1156abce07bf238d0a1868389943e0762361815e89079d9b97503b989468146eaa477dc4f98bbd343be23954ae06b4bb9dffe9
7
- data.tar.gz: 4fc37c32ede490d53d7021b439429eff0497722b2b960ec6e56cc2df121cdc08cca8d58e38dfb4044ec4fce1310c15a2030aa0bf4d5e40f8256ab6e1e4a64117
6
+ metadata.gz: b5a1394ada74c46b924b291d5b06b57f02a1a603b1aea8a90e82a67b866f694ee834880bb2d6a122aaac3d2d2fab4e2ab704baeae6ac797f17637c0d51ea5d3a
7
+ data.tar.gz: b01902b7bd54b1c4a8cf2a63d5b837743805966a609b04764017c7e82f3ed8e922ac84c2a35233bd9fbc6b059ad55ef9226deb46a6d3e4beaa1b47ef7a19bfe7
@@ -16,18 +16,24 @@
16
16
  module Redborder
17
17
  module KafkaNotifier
18
18
  module Model
19
+ def kafka_notifier_force_update!
20
+ acts_as_kafka_notifier_send_message type: :update
21
+ end
22
+
19
23
  private
20
24
 
21
- def acts_as_kafka_notifier_exportable_attributes
22
- attributes.except('created_at', 'updated_at').select do |_, v|
25
+ def acts_as_kafka_notifier_filter_nulls(attrs = {})
26
+ attrs.select do |_, v|
23
27
  !v.nil? || !acts_as_kafka_notifier_options[:ignore_nil_attributes]
24
28
  end
25
29
  end
26
30
 
27
31
  def acts_as_kafka_notifier_build_message(opts)
28
32
  merge_function = acts_as_kafka_notifier_options[:merge]
29
- message = opts.merge data: acts_as_kafka_notifier_exportable_attributes
33
+ attrs = attributes.except('created_at', 'updated_at')
34
+ message = opts.merge data: attrs
30
35
  message[:data].merge! send(merge_function) unless merge_function.nil?
36
+ message[:data] = acts_as_kafka_notifier_filter_nulls message[:data]
31
37
  message
32
38
  end
33
39
 
@@ -14,5 +14,5 @@
14
14
  #######################################################################
15
15
 
16
16
  module KafkaNotifier
17
- VERSION = '0.0.2' unless defined?(::KafkaNotifier::VERSION)
17
+ VERSION = '1.0.0' unless defined?(::KafkaNotifier::VERSION)
18
18
  end
metadata CHANGED
@@ -1,71 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kafka_notifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Rodriguez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-14 00:00:00.000000000 Z
11
+ date: 2015-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '4.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '4.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '4.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '4.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: poseidon
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: 0.0.5
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: 0.0.5
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '3.1'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '3.1'
69
69
  description: Sends a message to kafka whenever an active record instance is created,
70
70
  updated and/or removed.
71
71
  email: crodriguez@redborder.net