New Upstream Snapshot - ruby-delayed-job
Ready changes
Summary
Merged new upstream version: 4.1.11 (was: 4.1.9).
Resulting package
Built on 2022-10-28T07:20 (took 15m31s)
The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:
apt install -t fresh-snapshots ruby-delayed-job
Lintian Result
Diff
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..3e45196
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,92 @@
+name: CI
+
+on:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ ruby: ['2.7', '3.0', '3.1', jruby-head, ruby-head]
+ rails_version:
+ - '6.0.0'
+ - '6.1.0'
+ - '7.0.0'
+ - 'edge'
+ include:
+ # Rails 5.2
+ - ruby: 2.6
+ rails_version: '5.2.0'
+ - ruby: 2.7
+ rails_version: '5.2.0'
+ - ruby: jruby-9.2
+ rails_version: '5.2.0'
+
+ # Ruby 2.6
+ - ruby: 2.6
+ rails_version: '6.0.0'
+ - ruby: 2.6
+ rails_version: '6.1.0'
+
+ # jruby-9.2
+ - ruby: jruby-9.2
+ rails_version: '6.0.0'
+ - ruby: jruby-9.2
+ rails_version: '6.1.0'
+
+ # jruby-9.3
+ - ruby: jruby-9.3
+ rails_version: '7.0.0'
+ - ruby: jruby-9.3
+ rails_version: 'edge'
+
+ #
+ # The past
+ #
+ # EOL Active Record
+ - ruby: 2.2
+ rails_version: '3.2.0'
+ - ruby: 2.1
+ rails_version: '4.1.0'
+ - ruby: 2.4
+ rails_version: '4.2.0'
+ - ruby: 2.4
+ rails_version: '5.0.0'
+ - ruby: 2.5
+ rails_version: '5.1.0'
+
+ continue-on-error: ${{ matrix.rails_version == 'edge' || endsWith(matrix.ruby, 'head') }}
+
+ steps:
+ - uses: actions/checkout@v2
+ - uses: ruby/setup-ruby@v1
+ env:
+ RAILS_VERSION: ${{ matrix.rails_version }}
+ with:
+ ruby-version: ${{ matrix.ruby }}
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
+ - name: Run tests
+ env:
+ RAILS_VERSION: ${{ matrix.rails_version }}
+ run: bundle exec rspec
+ - name: Coveralls Parallel
+ uses: coverallsapp/github-action@master
+ with:
+ github-token: ${{ secrets.github_token }}
+ flag-name: run-${{ matrix.ruby }}-${{ matrix.rails_version }}
+ parallel: true
+
+ finish:
+ needs: test
+ runs-on: ubuntu-latest
+ steps:
+ - name: Coveralls Finished
+ uses: coverallsapp/github-action@master
+ with:
+ github-token: ${{ secrets.github_token }}
+ parallel-finished: true
diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml
new file mode 100644
index 0000000..7394739
--- /dev/null
+++ b/.github/workflows/rubocop.yml
@@ -0,0 +1,30 @@
+name: RuboCop
+
+on: [push, pull_request]
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up Ruby 2.7
+ uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: 2.7
+ - name: Generate lockfile for cache key
+ run: bundle lock
+ - name: Cache gems
+ uses: actions/cache@v1
+ with:
+ path: vendor/bundle
+ key: ${{ runner.os }}-rubocop-${{ hashFiles('**/Gemfile.lock') }}
+ restore-keys: |
+ ${{ runner.os }}-rubocop-
+ - name: Install gems
+ run: |
+ bundle config path vendor/bundle
+ bundle config set without 'default test'
+ bundle install --jobs 4 --retry 3
+ - name: Run RuboCop
+ run: bundle exec rubocop
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..dc21f69
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+*.gem
+*.swp
+.bundle
+.DS_Store
+.rvmrc
+/coverage
+Gemfile.lock
diff --git a/.rspec b/.rspec
new file mode 100644
index 0000000..0912718
--- /dev/null
+++ b/.rspec
@@ -0,0 +1,2 @@
+--color
+--order random
diff --git a/.rubocop.yml b/.rubocop.yml
new file mode 100644
index 0000000..3b0bd27
--- /dev/null
+++ b/.rubocop.yml
@@ -0,0 +1,146 @@
+AbcSize:
+ Enabled: false
+
+# Enforce outdenting of access modifiers (i.e. public, private, protected)
+AccessModifierIndentation:
+ EnforcedStyle: outdent
+
+Alias:
+ EnforcedStyle: prefer_alias_method
+
+AllCops:
+ Include:
+ - 'Gemfile'
+ - 'Rakefile'
+ - 'delayed_job.gemspec'
+ TargetRubyVersion: 2.1
+
+RedundantBlockCall:
+ Enabled: false
+
+BlockLength:
+ Enabled: false
+
+# Avoid more than `Max` levels of nesting.
+BlockNesting:
+ Max: 2
+
+# Indentation of when/else
+CaseIndentation:
+ EnforcedStyle: end
+ IndentOneStep: false
+
+ClassLength:
+ Max: 100
+
+# Align with the style guide.
+CollectionMethods:
+ PreferredMethods:
+ collect: 'map'
+ collect!: 'map!'
+ reduce: 'inject'
+ find: 'detect'
+ find_all: 'select'
+
+# Disable documentation checking until a class needs to be documented once
+Documentation:
+ Enabled: false
+
+# Allow dots at the end of lines
+DotPosition:
+ EnforcedStyle: trailing
+
+DoubleNegation:
+ Enabled: false
+
+# Detects any duplication as issue including our conditional requires
+DuplicatedGem:
+ Enabled: false
+
+EmptyLinesAroundAccessModifier:
+ Enabled: true
+
+# Don't require magic comment at the top of every file
+Encoding:
+ Enabled: false
+
+# Align ends correctly
+EndAlignment:
+ EnforcedStyleAlignWith: variable
+
+Style/FrozenStringLiteralComment:
+ Enabled: false
+
+# Enforce Ruby 1.8-compatible hash syntax
+HashSyntax:
+ EnforcedStyle: hash_rockets
+
+Lambda:
+ Enabled: false
+
+LineLength:
+ Enabled: false
+
+MethodLength:
+ CountComments: false
+ Max: 53
+
+MultilineOperationIndentation:
+ EnforcedStyle: indented
+
+Style/NumericPredicate:
+ Enabled: false
+
+# Avoid long parameter lists
+ParameterLists:
+ Max: 4
+ CountKeywordArgs: true
+
+PercentLiteralDelimiters:
+ PreferredDelimiters:
+ '%': ()
+ '%i': ()
+ '%q': ()
+ '%Q': ()
+ '%r': '{}'
+ '%s': ()
+ '%w': '[]'
+ '%W': '[]'
+ '%x': ()
+
+RaiseArgs:
+ EnforcedStyle: exploded
+
+RegexpLiteral:
+ Enabled: false
+
+RescueModifier:
+ Enabled: false
+
+Style/SafeNavigation:
+ Enabled: false
+
+SignalException:
+ EnforcedStyle: only_raise
+
+# No spaces inside hash literals
+SpaceInsideHashLiteralBraces:
+ EnforcedStyle: no_space
+
+Style/SymbolArray:
+ Enabled: false
+
+SymbolProc:
+ Enabled: false
+
+TrailingCommaInLiteral:
+ Enabled: false
+
+TrailingCommaInArguments:
+ Enabled: false
+
+YAMLLoad:
+ Enabled: false
+
+ZeroLengthPredicate:
+ Enabled: false
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 51e2dcf..86d8012 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,11 @@
+4.1.11 - 2022-09-28
+===================
+* Fix missing require for Rails 7.0.3+
+
+4.1.10 - 2022-01-17
+===================
+* Support for Rails 7.0. NOTE: If you are using Delayed Job independent of Rails, Active Support 7 has dropped classic dependency autoloading. You will need to add and setup zeitwerk for autoloading to continue working in ActiveSupport 7.
+
4.1.9 - 2020-12-09
==================
* Support for Rails 6.1
diff --git a/Gemfile b/Gemfile
new file mode 100644
index 0000000..c66ff6e
--- /dev/null
+++ b/Gemfile
@@ -0,0 +1,76 @@
+source 'https://rubygems.org'
+
+gem 'rake'
+
+platforms :ruby do
+ # Rails 5.1 is the first to work with sqlite 1.4
+ # Rails 6 now requires sqlite 1.4
+ if ENV['RAILS_VERSION'] && ENV['RAILS_VERSION'] < '5.1'
+ gem 'sqlite3', '< 1.4'
+ else
+ gem 'sqlite3'
+ end
+end
+
+platforms :jruby do
+ if ENV['RAILS_VERSION'] == '4.2.0'
+ gem 'activerecord-jdbcsqlite3-adapter', '< 50.0'
+ elsif ENV['RAILS_VERSION'] == '5.0.0'
+ gem 'activerecord-jdbcsqlite3-adapter', '~> 50.0'
+ elsif ENV['RAILS_VERSION'] == '5.1.0'
+ gem 'activerecord-jdbcsqlite3-adapter', '~> 51.0'
+ elsif ENV['RAILS_VERSION'] == '5.2.0'
+ gem 'activerecord-jdbcsqlite3-adapter', '~> 52.0'
+ elsif ENV['RAILS_VERSION'] == '6.0.0'
+ gem 'activerecord-jdbcsqlite3-adapter', '~> 60.0'
+ elsif ENV['RAILS_VERSION'] == '6.1.0'
+ gem 'activerecord-jdbcsqlite3-adapter', '~> 61.0'
+ else
+ gem 'activerecord-jdbcsqlite3-adapter'
+ end
+ gem 'jruby-openssl'
+ gem 'mime-types', ['~> 2.6', '< 2.99']
+
+ if ENV['RAILS_VERSION'] == 'edge'
+ gem 'railties', :github => 'rails/rails'
+ elsif ENV['RAILS_VERSION']
+ gem 'railties', "~> #{ENV['RAILS_VERSION']}"
+ else
+ gem 'railties', ['>= 3.0', '< 8.0']
+ end
+end
+
+platforms :rbx do
+ gem 'psych'
+end
+
+group :test do
+ if ENV['RAILS_VERSION'] == 'edge'
+ gem 'actionmailer', :github => 'rails/rails'
+ gem 'activerecord', :github => 'rails/rails'
+ elsif ENV['RAILS_VERSION']
+ gem 'actionmailer', "~> #{ENV['RAILS_VERSION']}"
+ gem 'activerecord', "~> #{ENV['RAILS_VERSION']}"
+ else
+ gem 'actionmailer', ['>= 3.0', '< 8.0']
+ gem 'activerecord', ['>= 3.0', '< 8.0']
+ end
+ gem 'net-smtp' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0')
+ gem 'rspec', '>= 3'
+ gem 'simplecov', :require => false
+ if /\A2.[12]/ =~ RUBY_VERSION
+ # 0.8.0 doesn't work with simplecov < 0.18.0 and older ruby can't run 0.18.0
+ gem 'simplecov-lcov', '< 0.8.0', :require => false
+ else
+ gem 'simplecov-lcov', :require => false
+ end
+ if ENV['RAILS_VERSION'].nil? || ENV['RAILS_VERSION'] >= '6.0.0'
+ gem 'zeitwerk', :require => false
+ end
+end
+
+group :rubocop do
+ gem 'rubocop', '>= 0.25', '< 0.49'
+end
+
+gemspec
diff --git a/README.md b/README.md
index 29ad107..ff7f266 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
**If you're viewing this at https://github.com/collectiveidea/delayed_job,
you're reading the documentation for the master branch.
[View documentation for the latest release
-(4.1.9).](https://github.com/collectiveidea/delayed_job/tree/v4.1.9)**
+(4.1.11).](https://github.com/collectiveidea/delayed_job/tree/v4.1.11)**
Delayed::Job
============
diff --git a/benchmarks.rb b/benchmarks.rb
new file mode 100644
index 0000000..d00a891
--- /dev/null
+++ b/benchmarks.rb
@@ -0,0 +1,13 @@
+require 'spec/helper'
+require 'logger'
+require 'benchmark'
+
+# Delayed::Worker.logger = Logger.new('/dev/null')
+
+Benchmark.bm(10) do |x|
+ Delayed::Job.delete_all
+ n = 10_000
+ n.times { 'foo'.delay.length }
+
+ x.report { Delayed::Worker.new(:quiet => true).work_off(n) }
+end
diff --git a/debian/changelog b/debian/changelog
index 0e893b3..7856926 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+ruby-delayed-job (4.1.11-1) UNRELEASED; urgency=low
+
+ * New upstream release.
+
+ -- Debian Janitor <janitor@jelmer.uk> Fri, 28 Oct 2022 07:08:52 -0000
+
ruby-delayed-job (4.1.9-1) unstable; urgency=medium
* Team upload.
diff --git a/debian/patches/simplecov b/debian/patches/simplecov
index d58c14d..15fee4c 100644
--- a/debian/patches/simplecov
+++ b/debian/patches/simplecov
@@ -5,8 +5,10 @@ Forwarded: not-needed
Last-Update: 2021-11-22
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---- a/spec/helper.rb
-+++ b/spec/helper.rb
+Index: ruby-delayed-job.git/spec/helper.rb
+===================================================================
+--- ruby-delayed-job.git.orig/spec/helper.rb
++++ ruby-delayed-job.git/spec/helper.rb
@@ -1,21 +1,3 @@
-require 'simplecov'
-require 'simplecov-lcov'
diff --git a/delayed_job.gemspec b/delayed_job.gemspec
index c9b60a7..0ed7afc 100644
--- a/delayed_job.gemspec
+++ b/delayed_job.gemspec
@@ -1,7 +1,7 @@
# -*- encoding: utf-8 -*-
Gem::Specification.new do |spec|
- spec.add_dependency 'activesupport', ['>= 3.0', '< 6.2']
+ spec.add_dependency 'activesupport', ['>= 3.0', '< 8.0']
spec.authors = ['Brandon Keepers', 'Brian Ryckbost', 'Chris Gaffney', 'David Genord II', 'Erik Michaels-Ober', 'Matt Griffin', 'Steve Richert', 'Tobias Lütke']
spec.description = 'Delayed_job (or DJ) encapsulates the common pattern of asynchronously executing longer tasks in the background. It is a direct extraction from Shopify where the job table is responsible for a multitude of core tasks.'
spec.email = ['brian@collectiveidea.com']
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
spec.require_paths = ['lib']
spec.summary = 'Database-backed asynchronous priority queue system -- Extracted from Shopify'
spec.test_files = Dir.glob('spec/**/*')
- spec.version = '4.1.9'
+ spec.version = '4.1.11'
spec.metadata = {
'changelog_uri' => 'https://github.com/collectiveidea/delayed_job/blob/master/CHANGELOG.md',
'bug_tracker_uri' => 'https://github.com/collectiveidea/delayed_job/issues',
diff --git a/lib/delayed/worker.rb b/lib/delayed/worker.rb
index 1a352f7..7b983a2 100644
--- a/lib/delayed/worker.rb
+++ b/lib/delayed/worker.rb
@@ -1,5 +1,6 @@
require 'timeout'
require 'active_support/dependencies'
+require 'active_support/core_ext/kernel/reporting'
require 'active_support/core_ext/numeric/time'
require 'active_support/core_ext/class/attribute_accessors'
require 'active_support/hash_with_indifferent_access'
diff --git a/spec/helper.rb b/spec/helper.rb
index e3d528d..0ba9657 100644
--- a/spec/helper.rb
+++ b/spec/helper.rb
@@ -47,8 +47,21 @@ end
Delayed::Worker.backend = :test
-# Add this directory so the ActiveSupport autoloading works
-ActiveSupport::Dependencies.autoload_paths << File.dirname(__FILE__)
+if ActiveSupport::VERSION::MAJOR < 7
+ require 'active_support/dependencies'
+
+ # Add this directory so the ActiveSupport autoloading works
+ ActiveSupport::Dependencies.autoload_paths << File.dirname(__FILE__)
+else
+ # Rails 7 dropped classic dependency auto-loading. This does a basic
+ # zeitwerk setup to test against zeitwerk directly as the Rails zeitwerk
+ # setup is intertwined in the application boot process.
+ require 'zeitwerk'
+
+ loader = Zeitwerk::Loader.new
+ loader.push_dir File.dirname(__FILE__)
+ loader.setup
+end
# Used to test interactions between DJ and an ORM
ActiveRecord::Base.establish_connection :adapter => 'sqlite3', :database => ':memory:'
diff --git a/spec/yaml_ext_spec.rb b/spec/yaml_ext_spec.rb
index aebb9af..83bceea 100644
--- a/spec/yaml_ext_spec.rb
+++ b/spec/yaml_ext_spec.rb
@@ -25,7 +25,7 @@ describe 'YAML' do
it 'autoloads the class of an anonymous struct' do
expect do
yaml = "--- !ruby/struct\nn: 1\n"
- object = YAML.load(yaml)
+ object = load_with_delayed_visitor(yaml)
expect(object).to be_kind_of(Struct)
expect(object.n).to eq(1)
end.not_to raise_error