kicks 3.1.0 → 3.1.1

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
  SHA256:
3
- metadata.gz: b553911947a5b50df9d2576610c02c448873a359bf8641116c3bdaeb10539fd4
4
- data.tar.gz: 8fd78e33555ba42a001781c204ca22e9e875a22d96eb53374dcc1a3d0af2ac06
3
+ metadata.gz: 5ccc9ea63784a73fbeddcce04080502702a7313867998bd41ef1322654a97a88
4
+ data.tar.gz: f986416420a86a75817fa8ae44750543349b19d1cce5db162d68da9c7d261f8f
5
5
  SHA512:
6
- metadata.gz: cf96bb1a274d3ad4da6f904c6395156541b750a78d20130226e3404f00f97853a71a0327db11b96193affe54a94217b909600ffb9c9e8527c3bcb5b88e51590b
7
- data.tar.gz: 0244cdda5904875397992237239b67649c6c4ef2affb0962a040d8f06849549b816a371280ef870fb04e16db9c768b948c8b96196e75337c3303131b5c333122
6
+ metadata.gz: ff97a24291dde8fb237d6e54318de1dfdf53a40361dc4172ec117a93027ffc49082e5c041a46617c628073004367985cfc866be356e7592e6fd5913e57ac2a1c
7
+ data.tar.gz: 819e52775f26c55fede5697467cd7154db41e5ce86f7e00eddeb260e8b1f0e922688bb241b4c71e08fb0a17f98541989fa23963867fd4cbaab6d8f7f2a20339c
data/ChangeLog.md CHANGED
@@ -1,8 +1,12 @@
1
1
  # Change Log
2
2
 
3
- ## Changes Between 3.1.0 and 3.2.0 (in development)
3
+ ## Changes Between 3.1.0 and 3.1.1 (Nov 1, 2024)
4
4
 
5
- No changes yet.
5
+ ### ActiveJob Adapter Compatibility with Ruby on Rails Older Than 7.2
6
+
7
+ Contributed by @dixpac.
8
+
9
+ GitHub issue: [#19](https://github.com/ruby-amqp/kicks/pull/19)
6
10
 
7
11
 
8
12
  ## Changes Between 3.0.0 and 3.1.0 (Oct 20, 2024)
@@ -11,7 +15,7 @@ No changes yet.
11
15
 
12
16
  Kicks now ships with an ActiveJob adapter for Ruby on Rails.
13
17
 
14
- Contributed by dixpac.
18
+ Contributed by @dixpac.
15
19
 
16
20
  GitHub issue: [#12](https://github.com/ruby-amqp/kicks/pull/12)
17
21
 
data/kicks.gemspec CHANGED
@@ -31,8 +31,8 @@ Gem::Specification.new do |gem|
31
31
  gem.add_dependency 'rake', '>= 12.3', '< 14.0'
32
32
 
33
33
  # for integration environment (see .travis.yml and integration_spec)
34
- gem.add_development_dependency 'activejob', '>= 7.1'
35
- gem.add_development_dependency 'activesupport', '>= 7.1'
34
+ gem.add_development_dependency 'activejob', '>= 7.2'
35
+ gem.add_development_dependency 'activesupport', '>= 7.2'
36
36
  gem.add_development_dependency 'rabbitmq_http_api_client'
37
37
  gem.add_development_dependency 'redis'
38
38
 
@@ -1,37 +1,39 @@
1
- module ActiveJob
2
- module QueueAdapters
3
- # Explicitly remove the implementation existing in older rails'.
4
- remove_const(:SneakersAdapter) if defined?(:SneakersAdapter)
1
+ if defined?(ActiveJob) && ActiveJob.version >= "7.2"
2
+ module ActiveJob
3
+ module QueueAdapters
4
+ # Explicitly remove the implementation existing in older Rails versions'.
5
+ remove_const(:SneakersAdapter) if defined?("::#{name}::SneakersAdapter")
5
6
 
6
- # = Sneakers adapter for Active Job
7
- #
8
- # To use Sneakers set the queue_adapter config to +:sneakers+.
9
- #
10
- # Rails.application.config.active_job.queue_adapter = :sneakers
11
- class SneakersAdapter < ::ActiveJob::QueueAdapters::AbstractAdapter
12
- def initialize
13
- @monitor = Monitor.new
14
- end
7
+ # = Sneakers adapter for Active Job
8
+ #
9
+ # To use Sneakers set the queue_adapter config to +:sneakers+.
10
+ #
11
+ # Rails.application.config.active_job.queue_adapter = :sneakers
12
+ class SneakersAdapter < ::ActiveJob::QueueAdapters::AbstractAdapter
13
+ def initialize
14
+ @monitor = Monitor.new
15
+ end
15
16
 
16
- def enqueue(job)
17
- @monitor.synchronize do
18
- JobWrapper.from_queue job.queue_name
19
- JobWrapper.enqueue ActiveSupport::JSON.encode(job.serialize)
17
+ def enqueue(job)
18
+ @monitor.synchronize do
19
+ JobWrapper.from_queue job.queue_name
20
+ JobWrapper.enqueue ActiveSupport::JSON.encode(job.serialize)
21
+ end
20
22
  end
21
- end
22
23
 
23
- def enqueue_at(job, timestamp)
24
- raise NotImplementedError, 'This queueing backend does not support scheduling jobs.'
25
- end
24
+ def enqueue_at(job, timestamp)
25
+ raise NotImplementedError, 'This queueing backend does not support scheduling jobs.'
26
+ end
26
27
 
27
- class JobWrapper
28
- include Sneakers::Worker
29
- from_queue 'default'
28
+ class JobWrapper
29
+ include Sneakers::Worker
30
+ from_queue 'default'
30
31
 
31
- def work(msg)
32
- job_data = ActiveSupport::JSON.decode(msg)
33
- Base.execute job_data
34
- ack!
32
+ def work(msg)
33
+ job_data = ActiveSupport::JSON.decode(msg)
34
+ Base.execute job_data
35
+ ack!
36
+ end
35
37
  end
36
38
  end
37
39
  end
@@ -1,3 +1,3 @@
1
1
  module Sneakers
2
- VERSION = "3.1.0"
2
+ VERSION = "3.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kicks
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dotan Nahum
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-10-21 00:00:00.000000000 Z
12
+ date: 2024-11-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: serverengine
@@ -93,28 +93,28 @@ dependencies:
93
93
  requirements:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: '7.1'
96
+ version: '7.2'
97
97
  type: :development
98
98
  prerelease: false
99
99
  version_requirements: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: '7.1'
103
+ version: '7.2'
104
104
  - !ruby/object:Gem::Dependency
105
105
  name: activesupport
106
106
  requirement: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: '7.1'
110
+ version: '7.2'
111
111
  type: :development
112
112
  prerelease: false
113
113
  version_requirements: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: '7.1'
117
+ version: '7.2'
118
118
  - !ruby/object:Gem::Dependency
119
119
  name: rabbitmq_http_api_client
120
120
  requirement: !ruby/object:Gem::Requirement