fruit_juice 0.6.0 → 1.0.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: 86581eab7f345cd3f447a45c6ece73f853f2dce7c636acbab7d617d510661d13
4
- data.tar.gz: 89d615dfb090a08beafa27bae4c0867f750597e32788c277445fa46440c09b57
3
+ metadata.gz: 50acb05db88081a34b6fa89b6ba701a6822c8d4ce2bb77c7584ef018c0726196
4
+ data.tar.gz: b19e563af2dc36317e2d790f64e34f173d3d47e6a6bcc9197d0b42cb5798576c
5
5
  SHA512:
6
- metadata.gz: dc428ab465e9881a6c79e8ee545bcec9500c66c28fe6c4f4d133ad7fc76ddf0cdfa0bc941e4b23ab06405508cc43b40a13c26bf368c18ab0865ed9df7d0fb603
7
- data.tar.gz: a240498f47a5f53fbf75d6836e85c5b9e3eba1f93952b0f87dc0434ea33371f288ec8e4955be3a5cd57afab11ff66a266a6938ef5f870f8c4a36b4ca6aaf0e87
6
+ metadata.gz: d76ea233f0bdd7296190c8cd2a6a75a247f5787cbe7496742736cd9a8c4981394f0171d8fbcb6e6230b9e5a526bb37436208ce90296e8a8c35462b14133a47ba
7
+ data.tar.gz: 373659336eaeb7dba73541c94df18a0c3f145d2c68d9f4feccea0a1b2e326926b0c59185e8f3c8ead8e7deb5c2a37626ff6d8ceb33213356d1fa81b40edb7c83
data/Appraisals ADDED
@@ -0,0 +1,7 @@
1
+ appraise "redis-4" do
2
+ gem "redis", ">= 4.0.0", "< 5.0.0"
3
+ end
4
+
5
+ appraise "redis-5" do
6
+ gem "redis", ">= 5.0.0"
7
+ end
data/Gemfile CHANGED
@@ -5,6 +5,6 @@ source "https://rubygems.org"
5
5
  # Specify your gem's dependencies in fruit_juice.gemspec
6
6
  gemspec
7
7
 
8
- gem "rake", "~> 13.0"
9
- gem "byebug"
10
- gem "rspec", "~> 3.0"
8
+ group :test do
9
+ gem "rspec", "~> 3.0"
10
+ end
data/Gemfile.lock CHANGED
@@ -2,14 +2,19 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  fruit_juice (0.6.0)
5
- redis (>= 4.0.0)
5
+ json (>= 2.3.0)
6
+ redis (>= 4.2.0)
6
7
 
7
8
  GEM
8
9
  remote: https://rubygems.org/
9
10
  specs:
10
- byebug (11.1.3)
11
+ appraisal (2.5.0)
12
+ bundler
13
+ rake
14
+ thor (>= 0.14.0)
11
15
  connection_pool (2.3.0)
12
16
  diff-lcs (1.5.0)
17
+ json (2.6.3)
13
18
  rake (13.0.6)
14
19
  redis (5.0.5)
15
20
  redis-client (>= 0.9.0)
@@ -28,14 +33,16 @@ GEM
28
33
  diff-lcs (>= 1.2.0, < 2.0)
29
34
  rspec-support (~> 3.12.0)
30
35
  rspec-support (3.12.0)
36
+ thor (1.2.1)
31
37
 
32
38
  PLATFORMS
33
39
  arm64-darwin-22
40
+ x86_64-darwin-21
41
+ x86_64-linux
34
42
 
35
43
  DEPENDENCIES
36
- byebug
44
+ appraisal (~> 2.5)
37
45
  fruit_juice!
38
- rake (~> 13.0)
39
46
  rspec (~> 3.0)
40
47
 
41
48
  BUNDLED WITH
data/README.md CHANGED
@@ -5,7 +5,7 @@ FruitJuice is a job enqueuing adapter for the [mosquito background job processor
5
5
 
6
6
  ## Requirements
7
7
 
8
- Ruby 2.7+
8
+ Ruby 2.5.0+
9
9
  Mosquito 1.0.0.rc1+
10
10
  Crystal 1.0.0+
11
11
  Redis 4+
@@ -76,13 +76,12 @@ delayed_job = MyNewRubyJob.new(job_type: "MyNewJob")
76
76
  delayed_job.perform(this_will: "become a job option", "job option": "and be stored", "as": "json to parse in Mosquito")
77
77
  ```
78
78
 
79
-
80
79
  That's it! Triggering jobs from Ruby/Rails is pretty easy, but this makes it a nice pattern that's easy to follow.
81
80
 
82
81
 
83
82
  ## Development
84
83
 
85
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
84
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
86
85
 
87
86
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org). (Hint: only Seth can push to ruby gems for now)
88
87
 
@@ -0,0 +1,2 @@
1
+ ---
2
+ BUNDLE_RETRY: "1"
@@ -0,0 +1,12 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rake", "~> 13.0"
6
+ gem "redis", ">= 4.0.0", "< 5.0.0"
7
+
8
+ group :test do
9
+ gem "rspec", "~> 3.0"
10
+ end
11
+
12
+ gemspec path: "../"
@@ -0,0 +1,46 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ fruit_juice (0.6.0)
5
+ redis (>= 4.0.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ appraisal (2.5.0)
11
+ bundler
12
+ rake
13
+ thor (>= 0.14.0)
14
+ byebug (11.1.3)
15
+ diff-lcs (1.5.0)
16
+ rake (13.0.6)
17
+ redis (4.6.0)
18
+ rspec (3.12.0)
19
+ rspec-core (~> 3.12.0)
20
+ rspec-expectations (~> 3.12.0)
21
+ rspec-mocks (~> 3.12.0)
22
+ rspec-core (3.12.0)
23
+ rspec-support (~> 3.12.0)
24
+ rspec-expectations (3.12.0)
25
+ diff-lcs (>= 1.2.0, < 2.0)
26
+ rspec-support (~> 3.12.0)
27
+ rspec-mocks (3.12.1)
28
+ diff-lcs (>= 1.2.0, < 2.0)
29
+ rspec-support (~> 3.12.0)
30
+ rspec-support (3.12.0)
31
+ thor (1.2.1)
32
+
33
+ PLATFORMS
34
+ arm64-darwin-22
35
+ x86_64-darwin-21
36
+
37
+ DEPENDENCIES
38
+ appraisal (~> 2.5)
39
+ byebug
40
+ fruit_juice!
41
+ rake (~> 13.0)
42
+ redis (>= 4.0.0, < 5.0.0)
43
+ rspec (~> 3.0)
44
+
45
+ BUNDLED WITH
46
+ 2.3.26
@@ -0,0 +1,12 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rake", "~> 13.0"
6
+ gem "redis", ">= 5.0.0"
7
+
8
+ group :test do
9
+ gem "rspec", "~> 3.0"
10
+ end
11
+
12
+ gemspec path: "../"
@@ -0,0 +1,50 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ fruit_juice (0.6.0)
5
+ redis (>= 4.0.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ appraisal (2.5.0)
11
+ bundler
12
+ rake
13
+ thor (>= 0.14.0)
14
+ byebug (11.1.3)
15
+ connection_pool (2.3.0)
16
+ diff-lcs (1.5.0)
17
+ rake (13.0.6)
18
+ redis (5.0.5)
19
+ redis-client (>= 0.9.0)
20
+ redis-client (0.11.2)
21
+ connection_pool
22
+ rspec (3.12.0)
23
+ rspec-core (~> 3.12.0)
24
+ rspec-expectations (~> 3.12.0)
25
+ rspec-mocks (~> 3.12.0)
26
+ rspec-core (3.12.0)
27
+ rspec-support (~> 3.12.0)
28
+ rspec-expectations (3.12.0)
29
+ diff-lcs (>= 1.2.0, < 2.0)
30
+ rspec-support (~> 3.12.0)
31
+ rspec-mocks (3.12.1)
32
+ diff-lcs (>= 1.2.0, < 2.0)
33
+ rspec-support (~> 3.12.0)
34
+ rspec-support (3.12.0)
35
+ thor (1.2.1)
36
+
37
+ PLATFORMS
38
+ arm64-darwin-22
39
+ x86_64-darwin-21
40
+
41
+ DEPENDENCIES
42
+ appraisal (~> 2.5)
43
+ byebug
44
+ fruit_juice!
45
+ rake (~> 13.0)
46
+ redis (>= 5.0.0)
47
+ rspec (~> 3.0)
48
+
49
+ BUNDLED WITH
50
+ 2.3.26
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  require_relative "string"
3
3
  require_relative "hash"
4
+ require "json"
4
5
 
5
6
  module FruitJuice
6
7
  class DelayedJob
@@ -36,12 +37,12 @@ module FruitJuice
36
37
  "retry_count": 0,
37
38
 
38
39
  # Job specific params
39
- "job_options": @job_options
40
+ "job_options": @job_options.to_json
40
41
  }
41
42
 
42
43
  # Required to support both Redis v4.x & v5+ due to behavior changes
43
44
  job_run_meta_data.transform_values!(&:to_s) if Redis::VERSION.to_i > 4
44
-
45
+
45
46
  @redis_adapter.hset(job_run_key, job_run_meta_data)
46
47
  @redis_adapter.lpush(@waiting_queue_key, job_id)
47
48
  job_run_key
@@ -71,4 +72,4 @@ module FruitJuice
71
72
  end
72
73
  end
73
74
  end
74
- end
75
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FruitJuice
4
- VERSION = "0.6.0"
4
+ VERSION = "1.0.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fruit_juice
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Tucker
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-12-16 00:00:00.000000000 Z
11
+ date: 2023-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -16,14 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 4.0.0
19
+ version: 4.2.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: 4.0.0
26
+ version: 4.2.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: json
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 2.3.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 2.3.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: appraisal
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2.5'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.5'
27
55
  description: This handy adapter will let you enqueue delayed jobs from a Ruby/Rails
28
56
  app and have the job processed by Mosquito in Crystal. The idea behind this came
29
57
  from a Ruby/Rails app needing a better way to process massive background jobs more
@@ -34,15 +62,19 @@ executables: []
34
62
  extensions: []
35
63
  extra_rdoc_files: []
36
64
  files:
37
- - ".byebug_history"
38
65
  - ".rspec"
66
+ - Appraisals
39
67
  - CODE_OF_CONDUCT.md
40
68
  - Gemfile
41
69
  - Gemfile.lock
42
70
  - LICENSE.txt
43
71
  - README.md
44
72
  - Rakefile
45
- - fruit_juice.gemspec
73
+ - gemfiles/.bundle/config
74
+ - gemfiles/redis_4.gemfile
75
+ - gemfiles/redis_4.gemfile.lock
76
+ - gemfiles/redis_5.gemfile
77
+ - gemfiles/redis_5.gemfile.lock
46
78
  - lib/fruit_juice.rb
47
79
  - lib/fruit_juice/delayed_job.rb
48
80
  - lib/fruit_juice/hash.rb
@@ -63,14 +95,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
63
95
  requirements:
64
96
  - - ">="
65
97
  - !ruby/object:Gem::Version
66
- version: 2.7.0
98
+ version: 2.5.0
67
99
  required_rubygems_version: !ruby/object:Gem::Requirement
68
100
  requirements:
69
101
  - - ">="
70
102
  - !ruby/object:Gem::Version
71
103
  version: '0'
72
104
  requirements: []
73
- rubygems_version: 3.3.7
105
+ rubygems_version: 3.4.10
74
106
  signing_key:
75
107
  specification_version: 4
76
108
  summary: Ruby job adapter to enqueue background jobs in Mosquito for Crystal. Uniting
data/.byebug_history DELETED
@@ -1,55 +0,0 @@
1
- q!
2
- job_type.class.to_s
3
- job_type
4
- c
5
- delayed_job.job_type
6
- c
7
- job_type.class
8
- c
9
- delayed_job.public_methods
10
- delayed_job.methods
11
- delayed_job.job_type
12
- c
13
- delayed_job.instance_variables
14
- delayed_job.job_type
15
- c
16
- job_type.camelize
17
- job_type.class == String
18
- job_type
19
- job_type.camelize
20
- job_type.class
21
- c
22
- config_options[:job_type].class
23
- config_options[:job_type].camelize
24
- config_options[:job_type]
25
- "test".camelize
26
- @job_type
27
- c
28
- jobType&.camelize
29
- jobType.camelize
30
- jobType.methods.grep /camel/
31
- jobType.class
32
- jobType = config_options[:job_type]
33
- config_options[:job_type].camelize
34
- config_options[:job_type].class
35
- set_job_type(config_options[:job_type])
36
- config_options
37
- @job_type
38
- c
39
- c!
40
- c
41
- job_type
42
- config_options
43
- config_options[:job_type]
44
- @job_type
45
- c
46
- FruitJuice::DelayedJob.new
47
- c
48
- ENV["REDIS_URL"]
49
- redis_url
50
- q
51
- ENV["REDIS_URL"]
52
- ENV.delete("REDIS_URL")
53
- ENV["REDIS_URL"].delete
54
- ENV["REDIS_URL"]
55
- redis_adapter.class.to_s.downcase
data/fruit_juice.gemspec DELETED
@@ -1,32 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "lib/fruit_juice/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "fruit_juice"
7
- spec.version = FruitJuice::VERSION
8
- spec.authors = ["Seth Tucker"]
9
- spec.email = ["crimsonknightstudios@gmail.com"]
10
-
11
- spec.summary = "Ruby job adapter to enqueue background jobs in Mosquito for Crystal. Uniting Ruby/Rails & Crystal!"
12
- spec.description = "This handy adapter will let you enqueue delayed jobs from a Ruby/Rails app and have the job processed by Mosquito in Crystal. The idea behind this came from a Ruby/Rails app needing a better way to process massive background jobs more effeciently, and a desire to stay curious and explore."
13
- spec.homepage = "https://github.com/crimson-knight/fruit_juice"
14
- spec.license = "MIT"
15
- spec.required_ruby_version = ">= 2.7.0"
16
-
17
- spec.metadata["homepage_uri"] = spec.homepage
18
- spec.metadata["source_code_uri"] = "https://github.com/crimson-knight/fruit_juice"
19
-
20
- # Specify which files should be added to the gem when it is released.
21
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
- spec.files = Dir.chdir(__dir__) do
23
- `git ls-files -z`.split("\x0").reject do |f|
24
- (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
25
- end
26
- end
27
- spec.bindir = "exe"
28
- spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
29
- spec.require_paths = ["lib"]
30
-
31
- spec.add_dependency "redis", ">= 4.0.0"
32
- end