karafka-core 2.0.8 → 2.0.10

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
  SHA256:
3
- metadata.gz: 89262ad9172da20cb645406674d90025637d7f4aea8e73379d2d39d475ed9eaf
4
- data.tar.gz: f10d0f1748fc69859c9b1661c490304d23e8506f550eff2bc7446045d9fd2ff1
3
+ metadata.gz: fe29c2f11c04331a98b17f3828b1c3f06b98a262f52acccbdc16d7425db75c8a
4
+ data.tar.gz: c82f5aa772769ac4fb36729f17739d6ddc1adb01c2985739e91ebdc6590bbaa0
5
5
  SHA512:
6
- metadata.gz: 3042fe634fccbcbb9e9331c0fab4b6637d8077c7cbd3695aa2802aac8b2d230be21eb1093bf4803886402a0bec292bd40078a74f115a85e532470378aaf3fd31
7
- data.tar.gz: 46d394f39d1cdecb581e92f6786ee6780b7aa3ca80815337f7638441e0b3e6ce3bb477e09a0c89bc285d77acc1803a2b0393d8b63e68c75f14be694bf1c53c11
6
+ metadata.gz: 19b4410f4e65330729f8a11bf1af00b9820519f302eb93371ad48d9fe89a8b4e157f310e94d8cfa88fc0891902c52109e8bfd04200d6240e98246e925f1ad199
7
+ data.tar.gz: 8b0a2c93a04982e1fc593c793937af46812a3fb1e56dbda5ebb27b8c412685e73dbf03d55993ab68b6546002894281a40cff0830800e76f240c256dee982424b
checksums.yaml.gz.sig CHANGED
@@ -1,3 +1,3 @@
1
- �U� 4��aJ�@� H�
2
- Z�P&�]��ow�<s8}^�k'l�'���Wi�;�X��É[�G��0_��㕽�#�
3
- �����v������S ��K�@߲�R���5aR���׶.�Om����"~?�kh1������x̂�,P�.����L��-U6l �~pђ���Mɇ*4������DLe�NNp1�n����Z���st1�D��R2,wأ����� v�:!M�Ә�#��F/���bn������lRPrAc#n/��<Z��_O��v�0�:�RvJ�����YG���;4H�&�0,ɶR����]�xAP�����ah."c�3l�ޑ�SUI0�j��
1
+ :
2
+ �/��e]��ّ��/f����oģ=T3\�?�������y������/K��U����Y>|���wbSt�`�Psk�K�(�̵� �%�:)n�gP�t%ߦ(&��A�R�@pM;R.q�R� �4R�a�٣��9�>��v x]�·O��˄��eü�4?���"�;�y"��ض�OD��M����AI�DV��rCu��$m������}vH��$��9��~��2a�6*'��3�^K~8X���P9�,��ɛ+.��?�[���"�Ҁ:��+���d��C!
3
+ ��p���mCO��^��M�4�gS]1w�|�p ������AF��:��h*�{89/�ٯ�?M�/�%׬XOL
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Karafka core changelog
2
2
 
3
+ ## 2.0.10 (2023-02-01)
4
+ - Move `RspecLocator` to core.
5
+
6
+ ## 2.0.9 (2023-01-11)
7
+ - Use `karafka-rdkafka` instead of `rdkafka`. This change is needed to ensure that all consecutive releases are stable and compatible.
8
+ - Relax Ruby requirement to `2.6`. It does not mean we officially support it but it may work. Go to [Versions Lifecycle and EOL](https://karafka.io/docs/Versions-Lifecycle-and-EOL/) for more details.
9
+
3
10
  ## 2.0.8 (2023-01-07)
4
11
  - Add `Karafka::Core::Helpers::Time` utility for time reporting.
5
12
 
data/Gemfile.lock CHANGED
@@ -1,20 +1,20 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka-core (2.0.8)
4
+ karafka-core (2.0.10)
5
5
  concurrent-ruby (>= 1.1)
6
- rdkafka (>= 0.12)
6
+ karafka-rdkafka (>= 0.12)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (7.0.4)
11
+ activesupport (7.0.4.2)
12
12
  concurrent-ruby (~> 1.0, >= 1.0.2)
13
13
  i18n (>= 1.6, < 2)
14
14
  minitest (>= 5.1)
15
15
  tzinfo (~> 2.0)
16
16
  byebug (11.1.3)
17
- concurrent-ruby (1.1.10)
17
+ concurrent-ruby (1.2.0)
18
18
  diff-lcs (1.5.0)
19
19
  docile (1.4.0)
20
20
  factory_bot (6.2.1)
@@ -22,23 +22,23 @@ GEM
22
22
  ffi (1.15.5)
23
23
  i18n (1.12.0)
24
24
  concurrent-ruby (~> 1.0)
25
- mini_portile2 (2.8.1)
26
- minitest (5.17.0)
27
- rake (13.0.6)
28
- rdkafka (0.12.0)
25
+ karafka-rdkafka (0.12.0)
29
26
  ffi (~> 1.15)
30
27
  mini_portile2 (~> 2.6)
31
28
  rake (> 12)
29
+ mini_portile2 (2.8.1)
30
+ minitest (5.17.0)
31
+ rake (13.0.6)
32
32
  rspec (3.12.0)
33
33
  rspec-core (~> 3.12.0)
34
34
  rspec-expectations (~> 3.12.0)
35
35
  rspec-mocks (~> 3.12.0)
36
36
  rspec-core (3.12.0)
37
37
  rspec-support (~> 3.12.0)
38
- rspec-expectations (3.12.1)
38
+ rspec-expectations (3.12.2)
39
39
  diff-lcs (>= 1.2.0, < 2.0)
40
40
  rspec-support (~> 3.12.0)
41
- rspec-mocks (3.12.1)
41
+ rspec-mocks (3.12.3)
42
42
  diff-lcs (>= 1.2.0, < 2.0)
43
43
  rspec-support (~> 3.12.0)
44
44
  rspec-support (3.12.0)
@@ -48,7 +48,7 @@ GEM
48
48
  simplecov_json_formatter (~> 0.1)
49
49
  simplecov-html (0.12.3)
50
50
  simplecov_json_formatter (0.1.4)
51
- tzinfo (2.0.5)
51
+ tzinfo (2.0.6)
52
52
  concurrent-ruby (~> 1.0)
53
53
 
54
54
  PLATFORMS
@@ -63,4 +63,4 @@ DEPENDENCIES
63
63
  simplecov
64
64
 
65
65
  BUNDLED WITH
66
- 2.4.2
66
+ 2.4.5
data/karafka-core.gemspec CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.licenses = %w[MIT]
18
18
 
19
19
  spec.add_dependency 'concurrent-ruby', '>= 1.1'
20
- spec.add_dependency 'rdkafka', '>= 0.12'
20
+ spec.add_dependency 'karafka-rdkafka', '>= 0.12'
21
21
 
22
22
  spec.required_ruby_version = '>= 2.6.0'
23
23
 
@@ -63,9 +63,23 @@ module Karafka
63
63
  config.configure(&block)
64
64
  end
65
65
 
66
- # Pipes the settings setup to the config root node
67
- def setting(...)
68
- config.setting(...)
66
+ # Two versions are needed to pass arguments in the correct way
67
+ if RUBY_VERSION >= '2.7'
68
+ class_eval <<~CODE, __FILE__, __LINE__
69
+ # Pipes the settings setup to the config root node
70
+ def setting(...)
71
+ config.setting(...)
72
+ end
73
+ CODE
74
+ else
75
+ class_eval <<~CODE, __FILE__, __LINE__
76
+ # Pipes the settings setup to the config root node
77
+ # @param args [Object] anything provided to settings
78
+ # @param block [Proc] block for settings
79
+ def setting(*args, &block)
80
+ config.setting(*args, &block)
81
+ end
82
+ CODE
69
83
  end
70
84
  end
71
85
  end
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'fileutils'
4
+
5
+ module Karafka
6
+ module Core
7
+ module Helpers
8
+ # RSpec extension for the `RSpec.describe` subject class auto-discovery
9
+ # It automatically detects the class name that should be described in the given spec
10
+ # based on the spec file path.
11
+ # @example Just include it, extend with instantiation and use `RSpec#describe_current`
12
+ # instead of `RSpec#describe`
13
+ # RSpec.extend SupportEngine::RSpecLocator.new(__FILE__)
14
+ class RSpecLocator < Module
15
+ # @param spec_helper_file_path [String] path to the spec_helper.rb file
16
+ # @param inflections [Hash<String, String>] optional inflections map
17
+ def initialize(spec_helper_file_path, inflections = {})
18
+ super()
19
+ @inflections = inflections
20
+ @specs_root_dir = ::File.dirname(spec_helper_file_path)
21
+ end
22
+
23
+ # Builds needed API
24
+ # @param rspec [Module] RSpec main module
25
+ def extended(rspec)
26
+ super
27
+
28
+ this = self
29
+
30
+ # Allows "auto subject" definitions for the `#describe` method, as it will figure
31
+ # out the proper class that we want to describe
32
+ # @param block [Proc] block with specs
33
+ rspec.define_singleton_method :describe_current do |&block|
34
+ describe(this.inherited, &block)
35
+ end
36
+ end
37
+
38
+ # @return [Class] class name for the RSpec `#describe` method
39
+ def inherited
40
+ caller(2..2)
41
+ .first
42
+ .split(':')
43
+ .first
44
+ .gsub(@specs_root_dir, '')
45
+ .gsub('_spec.rb', '')
46
+ .split('/')
47
+ .delete_if(&:empty?)
48
+ .itself[1..]
49
+ .join('/')
50
+ .camelize
51
+ .then { |string| transform_inflections(string) }
52
+ .constantize
53
+ end
54
+
55
+ private
56
+
57
+ # @param string [String] string we want to cast
58
+ # @return [String] string after inflections
59
+ def transform_inflections(string)
60
+ string = string.dup
61
+
62
+ @inflections.each { |from, to| string.gsub!(from, to) }
63
+
64
+ string
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -4,6 +4,6 @@ module Karafka
4
4
  module Core
5
5
  # Current Karafka::Core version
6
6
  # We follow the versioning schema of given Karafka version
7
- VERSION = '2.0.8'
7
+ VERSION = '2.0.10'
8
8
  end
9
9
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: karafka-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.8
4
+ version: 2.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld
@@ -35,7 +35,7 @@ cert_chain:
35
35
  Qf04B9ceLUaC4fPVEz10FyobjaFoY4i32xRto3XnrzeAgfEe4swLq8bQsR3w/EF3
36
36
  MGU0FeSV2Yj7Xc2x/7BzLK8xQn5l7Yy75iPF+KP3vVmDHnNl
37
37
  -----END CERTIFICATE-----
38
- date: 2023-01-07 00:00:00.000000000 Z
38
+ date: 2023-02-01 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: concurrent-ruby
@@ -52,7 +52,7 @@ dependencies:
52
52
  - !ruby/object:Gem::Version
53
53
  version: '1.1'
54
54
  - !ruby/object:Gem::Dependency
55
- name: rdkafka
55
+ name: karafka-rdkafka
56
56
  requirement: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - ">="
@@ -101,6 +101,7 @@ files:
101
101
  - lib/karafka/core/contractable/contract.rb
102
102
  - lib/karafka/core/contractable/result.rb
103
103
  - lib/karafka/core/contractable/rule.rb
104
+ - lib/karafka/core/helpers/rspec_locator.rb
104
105
  - lib/karafka/core/helpers/time.rb
105
106
  - lib/karafka/core/instrumentation.rb
106
107
  - lib/karafka/core/instrumentation/callbacks_manager.rb
metadata.gz.sig CHANGED
Binary file