cotton-tail 0.6.1 → 0.8.0

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: 9e28c658ff57af1125016e3d0f724c394e0f1fccd7d7a0469cd134e3c9d27c25
4
- data.tar.gz: 2f3ab5875ea30192dc19db744e4bd2475bc2a2f097aed1e7e7bac95ff5be3b43
3
+ metadata.gz: 6a1f8fb4fc5ac2144c02ee4083860ca0860c21a239a32adc946f0d437ea394e4
4
+ data.tar.gz: 3b9d84ae8362a8f750a833077de1d6ad790029c9d66984fd8c9ef6397264c83e
5
5
  SHA512:
6
- metadata.gz: 3f69be6c25098a9887163647752484e867f70a6ee215fa3288e6424f84379436e7f2d6b2c8eedf40580f41dc46a49378c623a70c19456fd2921b413bf64e9d04
7
- data.tar.gz: cb1a4b9742e75461a208731894b009ab99cac03912890f158130d0c7820410f62979c71139c5e3a3441d8dd1d2e2147384ab0076323b43d725ac8c4b4948e0e9
6
+ metadata.gz: 95676e70821e9d51227ae1c0bf8b54a8ffd007ab9e68edf1951744af38200fb7cb9a62758675dd3a5535c806b81dcceef2806f0707d7f116ccc3396ed85605b3
7
+ data.tar.gz: 3af050689c858d654f8778e63594d4c910acd83105c9506d5ce4a2811bd5a1a81f1c64376acbb683993c88fb825f7f4f8cd27e67db1ef4cbf3a7b2140372b82e
checksums.yaml.gz.sig CHANGED
@@ -1,3 +1,2 @@
1
- ?�k:'ϩ�F[BN`�g@U���fҡ�ħ�DB�=L�\� ���e�C}G�Ƶ�[R�D5�YZ�9.����݂�L�`k耪��^$D:�n5P e���� aE����AuX����|_]��E��T��"����IGc��|'g���,�traT[���:��]
2
- ��J�y��of��
3
- 9.R��]$�E�
1
+ rOIJ*4W���q�w�Bm��
2
+ 6�g���\ Ѕ��#���N,&�T��~J��U�>��Ĕ�4w���@M=��L�98�'W),'���Cns�@��F�%�`X�!�R�j"H(�?���J��� }X=�0T*�hp!��(���7U:�βhl��H����cL�R�����6���H�!��5$P� �b��� �I�����g��gj�2�V�0<�����E�X�'��t\ -i�T�i8
data/.circleci/config.yml CHANGED
@@ -2,8 +2,8 @@ version: 2
2
2
  jobs:
3
3
  build:
4
4
  docker:
5
- - image: circleci/ruby:2.5.1-node-browsers
6
- - image: rabbitmq:3.7-management
5
+ - image: cimg/ruby:3.3-node
6
+ - image: rabbitmq:3.7-management
7
7
 
8
8
  working_directory: ~/repo
9
9
 
@@ -22,8 +22,8 @@ jobs:
22
22
 
23
23
  - restore_cache:
24
24
  keys:
25
- - v1-dependencies-{{ checksum "Gemfile.lock" }}
26
- - v1-dependencies-
25
+ - v1-dependencies-{{ checksum "Gemfile.lock" }}
26
+ - v1-dependencies-
27
27
 
28
28
  - run:
29
29
  name: install dependencies
@@ -44,7 +44,7 @@ jobs:
44
44
  name: unit tests
45
45
  command: |
46
46
  mkdir /tmp/test-results
47
- TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
47
+ TEST_FILES="$(circleci tests glob "spec/unit/**/*_spec.rb" | circleci tests split --split-by=timings)"
48
48
 
49
49
  bundle exec rspec --format progress \
50
50
  --format RspecJunitFormatter \
@@ -55,7 +55,7 @@ jobs:
55
55
  - run:
56
56
  name: integration tests
57
57
  command: |
58
- TEST_FILES="$(circleci tests glob "integration/**/*_spec.rb" | circleci tests split --split-by=timings)"
58
+ TEST_FILES="$(circleci tests glob "spec/integration/**/*_spec.rb" | circleci tests split --split-by=timings)"
59
59
 
60
60
  bundle exec rspec --format progress \
61
61
  --format RspecJunitFormatter \
@@ -68,4 +68,4 @@ jobs:
68
68
  path: /tmp/test-results
69
69
  - store_artifacts:
70
70
  path: /tmp/test-results
71
- destination: test-results
71
+ destination: test-results
data/.rspec CHANGED
@@ -1,5 +1,4 @@
1
1
  --format documentation
2
2
  --color
3
3
  --require spec_helper
4
- --require integration_helper
5
- -I integration
4
+ --require integration/integration_helper
data/.rubocop.yml CHANGED
@@ -1,11 +1,16 @@
1
- Metrics/LineLength:
1
+ AllCops:
2
+ NewCops: enable
3
+ TargetRubyVersion: 3.0.0
4
+
5
+ plugins:
6
+ - rubocop-rake
7
+ - rubocop-rspec
8
+
9
+ Layout/LineLength:
2
10
  Max: 120
3
11
  Exclude:
4
12
  - 'lib/tasks/**/*'
5
13
 
6
- Metrics/MethodLength:
7
- Max: 20
8
-
9
14
  Metrics/BlockLength:
10
15
  Exclude:
11
16
  - 'spec/**/*'
@@ -13,12 +18,53 @@ Metrics/BlockLength:
13
18
  - '*.gemspec'
14
19
  - 'examples/app.rb'
15
20
 
16
- Style/Documentation:
21
+ Metrics/MethodLength:
22
+ Max: 20
23
+
24
+ Metrics/ModuleLength:
17
25
  Exclude:
18
26
  - 'spec/**/*'
19
27
  - 'integration/**/*'
20
28
 
21
- Metrics/ModuleLength:
29
+ Style/Documentation:
22
30
  Exclude:
23
31
  - 'spec/**/*'
24
32
  - 'integration/**/*'
33
+
34
+ Style/OptionalBooleanParameter:
35
+ Enabled: false
36
+
37
+ Style/SelectByRegexp:
38
+ Exclude:
39
+ - lib/cotton_tail/middleware/router.rb
40
+
41
+ Gemspec/DevelopmentDependencies:
42
+ Enabled: true
43
+ EnforcedStyle: gemspec
44
+
45
+ RSpec/ExampleLength:
46
+ Max: 10
47
+ Exclude:
48
+ - 'spec/integration/cotton_tail/app_spec.rb'
49
+ - 'spec/integration/dsl_integration_spec.rb'
50
+
51
+ RSpec/MultipleExpectations:
52
+ Enabled: false
53
+
54
+ RSpec/VerifiedDoubles:
55
+ Exclude:
56
+ - 'spec/integration/cotton_tail/app_spec.rb'
57
+
58
+ RSpec/MultipleMemoizedHelpers:
59
+ Enabled: false
60
+
61
+ RSpec/ContextWording:
62
+ Prefixes:
63
+ - 'given'
64
+ - 'when'
65
+ - 'with'
66
+ - 'without'
67
+ - 'and'
68
+
69
+ RSpec/NestedGroups:
70
+ Max: 4
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ cotton
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5.1@cotton
1
+ 3.3.1
data/Dockerfile CHANGED
@@ -1,7 +1,7 @@
1
1
  FROM ruby:alpine
2
2
 
3
3
  # Use most recent versions of available packages
4
- RUN sed -i -e 's/v[[:digit:]]\.[[:digit:]]/edge/g' /etc/apk/repositories
4
+ RUN sed -i -e 's/v[0-9]\+\.[0-9]\+/edge/g' /etc/apk/repositories
5
5
 
6
6
  RUN apk update && apk add git yarn build-base
7
7
 
@@ -13,7 +13,7 @@ COPY Gemfile* ./
13
13
  COPY cotton-tail.gemspec ./
14
14
  COPY ./lib/cotton_tail/version.rb ./lib/cotton_tail/
15
15
 
16
- RUN bundle install
16
+ RUN bundle install --without development
17
17
 
18
18
  # copy the contents to working directory
19
19
  COPY . /usr/src/cotton_tail
data/Gemfile.lock CHANGED
@@ -1,86 +1,127 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cotton-tail (0.6.1)
5
- bunny (~> 2.12)
6
- ibsciss-middleware (~> 0.4.2)
4
+ cotton-tail (0.8.0)
5
+ bunny (~> 2.24)
6
+ ibsciss-middleware (~> 0.4.3)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- amq-protocol (2.3.0)
12
- ast (2.4.0)
13
- benchmark-perf (0.4.0)
14
- benchmark-trend (0.2.0)
15
- bunny (2.13.0)
16
- amq-protocol (~> 2.3, >= 2.3.0)
17
- diff-lcs (1.3)
18
- faraday (0.13.1)
19
- multipart-post (>= 1.2, < 3)
20
- faraday_middleware (0.12.2)
21
- faraday (>= 0.7.4, < 1.0)
22
- hashie (3.6.0)
23
- ibsciss-middleware (0.4.2)
24
- jaro_winkler (1.5.1)
25
- multi_json (1.13.1)
26
- multipart-post (2.0.0)
27
- parallel (1.12.1)
28
- parser (2.5.3.0)
29
- ast (~> 2.4.0)
30
- powerpack (0.1.2)
31
- rabbitmq_http_api_client (1.11.0)
32
- faraday (~> 0.13.0)
33
- faraday_middleware (~> 0.12.0)
34
- hashie (~> 3.5)
35
- multi_json (~> 1.12)
36
- rainbow (3.0.0)
37
- rake (12.3.2)
38
- rspec (3.8.0)
39
- rspec-core (~> 3.8.0)
40
- rspec-expectations (~> 3.8.0)
41
- rspec-mocks (~> 3.8.0)
42
- rspec-benchmark (0.4.0)
43
- benchmark-perf (~> 0.4.0)
44
- benchmark-trend (~> 0.2.0)
45
- rspec (>= 3.0.0, < 4.0.0)
46
- rspec-core (3.8.0)
47
- rspec-support (~> 3.8.0)
48
- rspec-expectations (3.8.2)
11
+ addressable (2.8.7)
12
+ public_suffix (>= 2.0.2, < 7.0)
13
+ amq-protocol (2.3.4)
14
+ ast (2.4.3)
15
+ benchmark-malloc (0.2.0)
16
+ benchmark-perf (0.6.0)
17
+ benchmark-trend (0.4.0)
18
+ bunny (2.24.0)
19
+ amq-protocol (~> 2.3)
20
+ sorted_set (~> 1, >= 1.0.2)
21
+ diff-lcs (1.6.2)
22
+ faraday (2.13.1)
23
+ faraday-net_http (>= 2.0, < 3.5)
24
+ json
25
+ logger
26
+ faraday-follow_redirects (0.3.0)
27
+ faraday (>= 1, < 3)
28
+ faraday-net_http (3.4.0)
29
+ net-http (>= 0.5.0)
30
+ hashie (4.1.0)
31
+ ibsciss-middleware (0.4.3)
32
+ json (2.12.2)
33
+ language_server-protocol (3.17.0.5)
34
+ lint_roller (1.1.0)
35
+ logger (1.7.0)
36
+ multi_json (1.15.0)
37
+ net-http (0.6.0)
38
+ uri
39
+ parallel (1.27.0)
40
+ parser (3.3.8.0)
41
+ ast (~> 2.4.1)
42
+ racc
43
+ prism (1.4.0)
44
+ public_suffix (6.0.2)
45
+ rabbitmq_http_api_client (3.0.0)
46
+ addressable (~> 2.7)
47
+ faraday (~> 2.9)
48
+ faraday-follow_redirects (~> 0.3)
49
+ hashie (~> 4.1)
50
+ multi_json (~> 1.15)
51
+ racc (1.8.1)
52
+ rainbow (3.1.1)
53
+ rake (13.3.0)
54
+ rbtree (0.4.6)
55
+ regexp_parser (2.10.0)
56
+ rspec (3.13.1)
57
+ rspec-core (~> 3.13.0)
58
+ rspec-expectations (~> 3.13.0)
59
+ rspec-mocks (~> 3.13.0)
60
+ rspec-benchmark (0.6.0)
61
+ benchmark-malloc (~> 0.2)
62
+ benchmark-perf (~> 0.6)
63
+ benchmark-trend (~> 0.4)
64
+ rspec (>= 3.0)
65
+ rspec-core (3.13.4)
66
+ rspec-support (~> 3.13.0)
67
+ rspec-expectations (3.13.5)
49
68
  diff-lcs (>= 1.2.0, < 2.0)
50
- rspec-support (~> 3.8.0)
51
- rspec-its (1.2.0)
52
- rspec-core (>= 3.0.0)
53
- rspec-expectations (>= 3.0.0)
54
- rspec-mocks (3.8.0)
69
+ rspec-support (~> 3.13.0)
70
+ rspec-its (2.0.0)
71
+ rspec-core (>= 3.13.0)
72
+ rspec-expectations (>= 3.13.0)
73
+ rspec-mocks (3.13.5)
55
74
  diff-lcs (>= 1.2.0, < 2.0)
56
- rspec-support (~> 3.8.0)
57
- rspec-support (3.8.0)
58
- rspec_junit_formatter (0.4.1)
75
+ rspec-support (~> 3.13.0)
76
+ rspec-support (3.13.4)
77
+ rspec_junit_formatter (0.6.0)
59
78
  rspec-core (>= 2, < 4, != 2.12.0)
60
- rubocop (0.62.0)
61
- jaro_winkler (~> 1.5.1)
79
+ rubocop (1.76.1)
80
+ json (~> 2.3)
81
+ language_server-protocol (~> 3.17.0.2)
82
+ lint_roller (~> 1.1.0)
62
83
  parallel (~> 1.10)
63
- parser (>= 2.5, != 2.5.1.1)
64
- powerpack (~> 0.1)
84
+ parser (>= 3.3.0.2)
65
85
  rainbow (>= 2.2.2, < 4.0)
86
+ regexp_parser (>= 2.9.3, < 3.0)
87
+ rubocop-ast (>= 1.45.0, < 2.0)
66
88
  ruby-progressbar (~> 1.7)
67
- unicode-display_width (~> 1.4.0)
68
- ruby-progressbar (1.10.0)
69
- unicode-display_width (1.4.1)
89
+ unicode-display_width (>= 2.4.0, < 4.0)
90
+ rubocop-ast (1.45.1)
91
+ parser (>= 3.3.7.2)
92
+ prism (~> 1.4)
93
+ rubocop-rake (0.7.1)
94
+ lint_roller (~> 1.1)
95
+ rubocop (>= 1.72.1)
96
+ rubocop-rspec (3.6.0)
97
+ lint_roller (~> 1.1)
98
+ rubocop (~> 1.72, >= 1.72.1)
99
+ ruby-progressbar (1.13.0)
100
+ set (1.1.2)
101
+ sorted_set (1.0.3)
102
+ rbtree
103
+ set (~> 1.0)
104
+ unicode-display_width (3.1.4)
105
+ unicode-emoji (~> 4.0, >= 4.0.4)
106
+ unicode-emoji (4.0.4)
107
+ uri (1.0.3)
70
108
 
71
109
  PLATFORMS
110
+ arm64-darwin-23
72
111
  ruby
73
112
 
74
113
  DEPENDENCIES
75
- bundler (~> 1.16)
114
+ bundler (~> 2.5)
76
115
  cotton-tail!
77
- rabbitmq_http_api_client (~> 1.9)
78
- rake (~> 12.0)
79
- rspec (~> 3.0)
80
- rspec-benchmark (~> 0.4)
81
- rspec-its (~> 1.2)
116
+ rabbitmq_http_api_client (~> 3.0)
117
+ rake (~> 13.3)
118
+ rspec (~> 3.13)
119
+ rspec-benchmark (~> 0.6)
120
+ rspec-its (~> 2.0)
82
121
  rspec_junit_formatter
83
- rubocop (~> 0.60)
122
+ rubocop (~> 1.76)
123
+ rubocop-rake (~> 0.7.1)
124
+ rubocop-rspec (~> 3.6)
84
125
 
85
126
  BUNDLED WITH
86
- 1.17.1
127
+ 2.5.9
@@ -1,21 +1,27 @@
1
1
  -----BEGIN CERTIFICATE-----
2
- MIIDgDCCAmigAwIBAgIBATANBgkqhkiG9w0BAQUFADBDMRUwEwYDVQQDDAxicmVu
2
+ MIIEgDCCAuigAwIBAgIBATANBgkqhkiG9w0BAQsFADBDMRUwEwYDVQQDDAxicmVu
3
3
  bmFubXVzaWMxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkW
4
- A2NvbTAeFw0xODA3MDYwMDA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g9P0SrY6X6jt2k8c4G9fAx
20
+ YAbg09B/KPZ9FGX9+F05FexiBM1tipxZ2NnrwMIMTsxqeapuGBlgb14u2ZqwLunj
21
+ 3Kd9pGEmf7JoX6sqjZl9KAjIRIWnBjS2Df53Nejb/46vs4A0W9wduwT11Za1QCOj
22
+ XNR5XrU2FBwBpeE4DG3UbbDyBvQee1w7PvTqKAMq2yPTpG+AlURAT7WBqtoVyMqr
23
+ oJ05zcgvox0d9Q2W85Ilv9NNunxbOVbpoh8UhkTWReS7roTBa/MF1ubt8P6OHSVx
24
+ 3ju8CQvfdn7UsxyuVNxNdsrf9aoWTnvCCaRzwA50evk+GwJ7iIkOrkhyVgYMO9oC
25
+ EOU9A8gtMc051I0oe757O9RAJSx+2FFXGBB11YAAMVSFyftESWOELjSfo9i/sfwa
26
+ 3ww/OA==
21
27
  -----END CERTIFICATE-----
data/cotton-tail.gemspec CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
16
16
  your services'
17
17
 
18
18
  spec.license = 'MIT'
19
-
19
+ spec.required_ruby_version = '>= 3.0.0'
20
20
  spec.cert_chain = ['certs/jamesbrennan.pem']
21
21
  spec.signing_key = File.expand_path('~/.ssh/gem-private_key.pem') if $PROGRAM_NAME.end_with? 'gem'
22
22
 
@@ -28,15 +28,18 @@ Gem::Specification.new do |spec|
28
28
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
29
  spec.require_paths = ['lib']
30
30
 
31
- spec.add_dependency 'bunny', '~> 2.12'
32
- spec.add_dependency 'ibsciss-middleware', '~> 0.4.2'
31
+ spec.add_dependency 'bunny', '~> 2.24'
32
+ spec.add_dependency 'ibsciss-middleware', '~> 0.4.3'
33
33
 
34
- spec.add_development_dependency 'bundler', '~> 1.16'
35
- spec.add_development_dependency 'rabbitmq_http_api_client', '~> 1.9'
36
- spec.add_development_dependency 'rake', '~> 12.0'
37
- spec.add_development_dependency 'rspec', '~> 3.0'
38
- spec.add_development_dependency 'rspec-benchmark', '~> 0.4'
39
- spec.add_development_dependency 'rspec-its', '~> 1.2'
34
+ spec.add_development_dependency 'bundler', '~> 2.5'
35
+ spec.add_development_dependency 'rabbitmq_http_api_client', '~> 3.0'
36
+ spec.add_development_dependency 'rake', '~> 13.3'
37
+ spec.add_development_dependency 'rspec', '~> 3.13'
38
+ spec.add_development_dependency 'rspec-benchmark', '~> 0.6'
39
+ spec.add_development_dependency 'rspec-its', '~> 2.0'
40
40
  spec.add_development_dependency 'rspec_junit_formatter'
41
- spec.add_development_dependency 'rubocop', '~> 0.60'
41
+ spec.add_development_dependency 'rubocop', '~> 1.76'
42
+ spec.add_development_dependency 'rubocop-rake', '~> 0.7.1'
43
+ spec.add_development_dependency 'rubocop-rspec', '~> 3.6'
44
+ spec.metadata['rubygems_mfa_required'] = 'true'
42
45
  end
@@ -19,11 +19,6 @@ module CottonTail
19
19
  routes.queues
20
20
  end
21
21
 
22
- # Get a single message queue
23
- def queue(name)
24
- queues[name]
25
- end
26
-
27
22
  # Start the app, process all pending messages, and then shutdown
28
23
  def run
29
24
  supervisors.map(&:run).each(&:join)
@@ -43,7 +38,7 @@ module CottonTail
43
38
  private
44
39
 
45
40
  def supervisors
46
- @supervisors ||= queues.map do |_name, queue|
41
+ @supervisors ||= queues.map do |queue|
47
42
  Queue::Supervisor.new(queue, app: self)
48
43
  end
49
44
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'middleware'
4
+ require 'amq/settings'
4
5
 
5
6
  module CottonTail
6
7
  # Configuration options
@@ -17,9 +18,8 @@ module CottonTail
17
18
  # to Bunny.new. Any valid params for Bunny.new are accepted.
18
19
  #
19
20
  # @see http://rubybunny.info/articles/connecting.html
20
- def connection_args=(*args, **kwargs)
21
- url, = args
22
- @connection_args = url ? Bunny::Session.parse_uri(url) : kwargs
21
+ def connection_args=(params)
22
+ @connection_args = AMQ::Settings.configure(params)
23
23
  end
24
24
 
25
25
  # Modify or retrieve the application middleware stack.
@@ -10,7 +10,7 @@ module CottonTail
10
10
  def initialize(queue_strategy:, connection:)
11
11
  @queue_strategy = queue_strategy
12
12
  @connection = connection
13
- @queues = {}
13
+ @queues = []
14
14
  end
15
15
 
16
16
  def draw(&block)
@@ -18,9 +18,9 @@ module CottonTail
18
18
  end
19
19
 
20
20
  # Define a new queue
21
- def queue(name, **opts, &block)
21
+ def queue(name = '', **opts, &block)
22
22
  @queue_strategy.call(name: name, connection: @connection, **opts).tap do |queue_instance|
23
- @queues[name] = queue_instance
23
+ @queues << queue_instance
24
24
  queue_dsl = Queue.new(name, queue_instance, self)
25
25
  queue_dsl.instance_eval(&block) if block_given?
26
26
  end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'delegate'
3
4
  require 'forwardable'
4
5
  require 'bunny'
5
6
 
@@ -8,18 +9,15 @@ module CottonTail
8
9
  # A wrapper around a ::Bunny::Queue that makes it interchangeable with a
9
10
  # standard Ruby Queue
10
11
  class Bunny < SimpleDelegator
11
- extend Forwardable
12
-
13
12
  def self.call(**opts)
14
13
  new(**opts)
15
14
  end
16
15
 
17
16
  def initialize(name:, connection:, manual_ack: false, **opts)
18
- super ::Queue.new
17
+ super(::Queue.new)
19
18
 
20
- @name = name
21
- @source_opts = opts
22
19
  @connection = connection
20
+ @source = build_source(name, opts)
23
21
 
24
22
  watch_source manual_ack
25
23
  end
@@ -40,14 +38,20 @@ module CottonTail
40
38
 
41
39
  private
42
40
 
43
- attr_reader :connection
41
+ attr_reader :connection, :source
42
+
43
+ def nil_opts(opts)
44
+ { exclusive: true }.merge(opts)
45
+ end
44
46
 
45
47
  def watch_source(manual_ack)
46
48
  source.subscribe(manual_ack: manual_ack) { |*args| self << args }
47
49
  end
48
50
 
49
- def source
50
- @source ||= channel.queue(@name, **@source_opts)
51
+ def build_source(name, opts)
52
+ return channel.queue('', **nil_opts(opts)) if name.nil?
53
+
54
+ channel.queue(name, **opts)
51
55
  end
52
56
 
53
57
  def channel
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'fiber'
4
-
5
3
  module CottonTail
6
4
  module Queue
7
5
  # Queue Reader
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'fiber'
4
-
5
3
  module CottonTail
6
4
  module Queue
7
5
  # A supervisor for a single queue
@@ -1,11 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'delegate'
4
+
3
5
  module CottonTail
4
6
  # Route pattern matcher
5
7
  class Route < SimpleDelegator
6
8
  def initialize(pattern)
7
9
  @pattern = pattern
8
- super build_regex
10
+ super(build_regex)
9
11
  end
10
12
 
11
13
  def extract_params(routing_key)
@@ -1,11 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'delegate'
4
+
3
5
  module CottonTail
4
6
  # RouteSegment implements the pattern matching for route segments
5
7
  class RouteSegment < SimpleDelegator
6
8
  def initialize(value)
7
9
  @value = value
8
- super Regexp.new definition(value)
10
+ @transformed = definition(value)
11
+ super(Regexp.new "^#{@transformed}$")
9
12
  end
10
13
 
11
14
  def star?
@@ -24,6 +27,18 @@ module CottonTail
24
27
  @value
25
28
  end
26
29
 
30
+ def match?(other)
31
+ return false unless other
32
+ return false if other.to_s.empty?
33
+ return super if other.is_a?(String)
34
+
35
+ false
36
+ end
37
+
38
+ def to_s
39
+ @transformed.to_s
40
+ end
41
+
27
42
  private
28
43
 
29
44
  TRANSFORM = ->(val, func) { func.call(val) }
@@ -61,10 +76,12 @@ module CottonTail
61
76
  ]
62
77
  end
63
78
 
64
- STAR = /\*/.freeze
65
- HASH = /#/.freeze
66
- NAMED = /:(\w+)/.freeze
67
- NAMED_STAR = /#{STAR}#{NAMED}/.freeze
68
- NAMED_HASH = /#{HASH}#{NAMED}/.freeze
79
+ STAR = /\*/
80
+ HASH = /#/
81
+ NAMED = /:(\w+)/
82
+ NAMED_STAR = /#{STAR}#{NAMED}/
83
+ NAMED_HASH = /#{HASH}#{NAMED}/
84
+
85
+ private_constant :TRANSFORM, :STAR, :HASH, :NAMED, :NAMED_STAR, :NAMED_HASH
69
86
  end
70
87
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CottonTail
4
- VERSION = '0.6.1'
4
+ VERSION = '0.8.0'
5
5
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,36 +1,42 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cotton-tail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Brennan
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIDgDCCAmigAwIBAgIBATANBgkqhkiG9w0BAQUFADBDMRUwEwYDVQQDDAxicmVu
13
+ MIIEgDCCAuigAwIBAgIBATANBgkqhkiG9w0BAQsFADBDMRUwEwYDVQQDDAxicmVu
14
14
  bmFubXVzaWMxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkW
15
- A2NvbTAeFw0xODA3MDYwMDA2MzRaFw0xOTA3MDYwMDA2MzRaMEMxFTATBgNVBAMM
15
+ A2NvbTAeFw0yNTA2MTUwOTA4MTFaFw0yNjA2MTUwOTA4MTFaMEMxFTATBgNVBAMM
16
16
  DGJyZW5uYW5tdXNpYzEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPy
17
- LGQBGRYDY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyxykNKqp
18
- jD5gnQd2YHuRDNsLN5limGMDjSb38lMZAfJJugoWbSSeQM3+iVl26YWE5JeJpqDu
19
- Rr/GOQ54bsev4IxCfPl8yIkhAao0i96+k1EeEb/i3pgZOfjXgGSTM71baCZzbqBH
20
- A5ivcb0wqoHWyqrxNtc4XhSs5RtvtNl3IEe/b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o9i/sfwa
37
+ 3ww/OA==
32
38
  -----END CERTIFICATE-----
33
- date: 2019-01-16 00:00:00.000000000 Z
39
+ date: 2025-06-15 00:00:00.000000000 Z
34
40
  dependencies:
35
41
  - !ruby/object:Gem::Dependency
36
42
  name: bunny
@@ -38,112 +44,112 @@ dependencies:
38
44
  requirements:
39
45
  - - "~>"
40
46
  - !ruby/object:Gem::Version
41
- version: '2.12'
47
+ version: '2.24'
42
48
  type: :runtime
43
49
  prerelease: false
44
50
  version_requirements: !ruby/object:Gem::Requirement
45
51
  requirements:
46
52
  - - "~>"
47
53
  - !ruby/object:Gem::Version
48
- version: '2.12'
54
+ version: '2.24'
49
55
  - !ruby/object:Gem::Dependency
50
56
  name: ibsciss-middleware
51
57
  requirement: !ruby/object:Gem::Requirement
52
58
  requirements:
53
59
  - - "~>"
54
60
  - !ruby/object:Gem::Version
55
- version: 0.4.2
61
+ version: 0.4.3
56
62
  type: :runtime
57
63
  prerelease: false
58
64
  version_requirements: !ruby/object:Gem::Requirement
59
65
  requirements:
60
66
  - - "~>"
61
67
  - !ruby/object:Gem::Version
62
- version: 0.4.2
68
+ version: 0.4.3
63
69
  - !ruby/object:Gem::Dependency
64
70
  name: bundler
65
71
  requirement: !ruby/object:Gem::Requirement
66
72
  requirements:
67
73
  - - "~>"
68
74
  - !ruby/object:Gem::Version
69
- version: '1.16'
75
+ version: '2.5'
70
76
  type: :development
71
77
  prerelease: false
72
78
  version_requirements: !ruby/object:Gem::Requirement
73
79
  requirements:
74
80
  - - "~>"
75
81
  - !ruby/object:Gem::Version
76
- version: '1.16'
82
+ version: '2.5'
77
83
  - !ruby/object:Gem::Dependency
78
84
  name: rabbitmq_http_api_client
79
85
  requirement: !ruby/object:Gem::Requirement
80
86
  requirements:
81
87
  - - "~>"
82
88
  - !ruby/object:Gem::Version
83
- version: '1.9'
89
+ version: '3.0'
84
90
  type: :development
85
91
  prerelease: false
86
92
  version_requirements: !ruby/object:Gem::Requirement
87
93
  requirements:
88
94
  - - "~>"
89
95
  - !ruby/object:Gem::Version
90
- version: '1.9'
96
+ version: '3.0'
91
97
  - !ruby/object:Gem::Dependency
92
98
  name: rake
93
99
  requirement: !ruby/object:Gem::Requirement
94
100
  requirements:
95
101
  - - "~>"
96
102
  - !ruby/object:Gem::Version
97
- version: '12.0'
103
+ version: '13.3'
98
104
  type: :development
99
105
  prerelease: false
100
106
  version_requirements: !ruby/object:Gem::Requirement
101
107
  requirements:
102
108
  - - "~>"
103
109
  - !ruby/object:Gem::Version
104
- version: '12.0'
110
+ version: '13.3'
105
111
  - !ruby/object:Gem::Dependency
106
112
  name: rspec
107
113
  requirement: !ruby/object:Gem::Requirement
108
114
  requirements:
109
115
  - - "~>"
110
116
  - !ruby/object:Gem::Version
111
- version: '3.0'
117
+ version: '3.13'
112
118
  type: :development
113
119
  prerelease: false
114
120
  version_requirements: !ruby/object:Gem::Requirement
115
121
  requirements:
116
122
  - - "~>"
117
123
  - !ruby/object:Gem::Version
118
- version: '3.0'
124
+ version: '3.13'
119
125
  - !ruby/object:Gem::Dependency
120
126
  name: rspec-benchmark
121
127
  requirement: !ruby/object:Gem::Requirement
122
128
  requirements:
123
129
  - - "~>"
124
130
  - !ruby/object:Gem::Version
125
- version: '0.4'
131
+ version: '0.6'
126
132
  type: :development
127
133
  prerelease: false
128
134
  version_requirements: !ruby/object:Gem::Requirement
129
135
  requirements:
130
136
  - - "~>"
131
137
  - !ruby/object:Gem::Version
132
- version: '0.4'
138
+ version: '0.6'
133
139
  - !ruby/object:Gem::Dependency
134
140
  name: rspec-its
135
141
  requirement: !ruby/object:Gem::Requirement
136
142
  requirements:
137
143
  - - "~>"
138
144
  - !ruby/object:Gem::Version
139
- version: '1.2'
145
+ version: '2.0'
140
146
  type: :development
141
147
  prerelease: false
142
148
  version_requirements: !ruby/object:Gem::Requirement
143
149
  requirements:
144
150
  - - "~>"
145
151
  - !ruby/object:Gem::Version
146
- version: '1.2'
152
+ version: '2.0'
147
153
  - !ruby/object:Gem::Dependency
148
154
  name: rspec_junit_formatter
149
155
  requirement: !ruby/object:Gem::Requirement
@@ -164,14 +170,42 @@ dependencies:
164
170
  requirements:
165
171
  - - "~>"
166
172
  - !ruby/object:Gem::Version
167
- version: '0.60'
173
+ version: '1.76'
168
174
  type: :development
169
175
  prerelease: false
170
176
  version_requirements: !ruby/object:Gem::Requirement
171
177
  requirements:
172
178
  - - "~>"
173
179
  - !ruby/object:Gem::Version
174
- version: '0.60'
180
+ version: '1.76'
181
+ - !ruby/object:Gem::Dependency
182
+ name: rubocop-rake
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: 0.7.1
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: 0.7.1
195
+ - !ruby/object:Gem::Dependency
196
+ name: rubocop-rspec
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: '3.6'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: '3.6'
175
209
  description: |-
176
210
  Simply and easily add AMQP messaging capabilities to
177
211
  your services
@@ -185,6 +219,7 @@ files:
185
219
  - ".gitignore"
186
220
  - ".rspec"
187
221
  - ".rubocop.yml"
222
+ - ".ruby-gemset"
188
223
  - ".ruby-version"
189
224
  - Dockerfile
190
225
  - Gemfile
@@ -228,8 +263,9 @@ files:
228
263
  homepage: https://github.com/jamesBrennan/cotton-tail
229
264
  licenses:
230
265
  - MIT
231
- metadata: {}
232
- post_install_message:
266
+ metadata:
267
+ rubygems_mfa_required: 'true'
268
+ post_install_message:
233
269
  rdoc_options: []
234
270
  require_paths:
235
271
  - lib
@@ -237,16 +273,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
237
273
  requirements:
238
274
  - - ">="
239
275
  - !ruby/object:Gem::Version
240
- version: '0'
276
+ version: 3.0.0
241
277
  required_rubygems_version: !ruby/object:Gem::Requirement
242
278
  requirements:
243
279
  - - ">="
244
280
  - !ruby/object:Gem::Version
245
281
  version: '0'
246
282
  requirements: []
247
- rubyforge_project:
248
- rubygems_version: 2.7.6
249
- signing_key:
283
+ rubygems_version: 3.5.9
284
+ signing_key:
250
285
  specification_version: 4
251
286
  summary: A simple multi-threaded amqp server
252
287
  test_files: []
metadata.gz.sig CHANGED
Binary file