Skip to content

Commit

Permalink
Require ruby > 2.7 (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
will89 authored Sep 8, 2022
1 parent ff0343f commit d09f418
Show file tree
Hide file tree
Showing 14 changed files with 77 additions and 26 deletions.
28 changes: 18 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ version: 2.1
jobs:
lint:
docker:
- image: salsify/ruby_ci:2.5.8
- image: salsify/ruby_ci:2.7.6
working_directory: ~/delayed_job_worker_pool
steps:
- checkout
- restore_cache:
keys:
- v1-gems-ruby-2.5.8-{{ checksum "delayed_job_worker_pool.gemspec" }}-{{ checksum "Gemfile" }}
- v1-gems-ruby-2.5.8-
- v1-gems-ruby-2.7.6-{{ checksum "delayed_job_worker_pool.gemspec" }}-{{ checksum "Gemfile" }}
- v1-gems-ruby-2.7.6-
- run:
name: Install Gems
command: |
Expand All @@ -18,7 +18,7 @@ jobs:
bundle clean
fi
- save_cache:
key: v1-gems-ruby-2.5.8-{{ checksum "delayed_job_worker_pool.gemspec" }}-{{ checksum "Gemfile" }}
key: v1-gems-ruby-2.7.6-{{ checksum "delayed_job_worker_pool.gemspec" }}-{{ checksum "Gemfile" }}
paths:
- "vendor/bundle"
- "gemfiles/vendor/bundle"
Expand All @@ -29,16 +29,19 @@ jobs:
parameters:
ruby_version:
type: string
gemfile:
type: string
docker:
- image: salsify/ruby_ci:<< parameters.ruby_version >>
environment:
CIRCLE_TEST_REPORTS: "test-results"
BUNDLE_GEMFILE: "~/delayed_job_worker_pool/<< parameters.gemfile >>"
working_directory: ~/delayed_job_worker_pool
steps:
- checkout
- restore_cache:
keys:
- v1-gems-ruby-<< parameters.ruby_version >>-{{ checksum "delayed_job_worker_pool.gemspec" }}-{{ checksum "Gemfile" }}
- v1-gems-ruby-<< parameters.ruby_version >>-{{ checksum "delayed_job_worker_pool.gemspec" }}-{{ checksum "<< parameters.gemfile >>" }}
- v1-gems-ruby-<< parameters.ruby_version >>-
- run:
name: Install Gems
Expand All @@ -48,7 +51,7 @@ jobs:
bundle clean
fi
- save_cache:
key: v1-gems-ruby-<< parameters.ruby_version >>-{{ checksum "delayed_job_worker_pool.gemspec" }}-{{ checksum "Gemfile" }}
key: v1-gems-ruby-<< parameters.ruby_version >>-{{ checksum "delayed_job_worker_pool.gemspec" }}-{{ checksum "<< parameters.gemfile >>" }}
paths:
- "vendor/bundle"
- "gemfiles/vendor/bundle"
Expand All @@ -58,15 +61,20 @@ jobs:
bundle exec rspec --format RspecJunitFormatter --out $CIRCLE_TEST_REPORTS/rspec/junit.xml --format progress spec
- store_test_results:
path: "test-results"
- store_artifacts:
path: "tmp/log/"
workflows:
build:
jobs:
- lint
- test:
matrix:
parameters:
gemfile:
- "gemfiles/rails_6.0.gemfile"
- "gemfiles/rails_6.1.gemfile"
- "gemfiles/rails_7.0.gemfile"
ruby_version:
- "2.5.8"
- "2.6.6"
- "2.7.2"
- "3.0.0"
- "2.7.6"
- "3.0.4"
- "3.1.2"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@
/tmp/
.rspec
*.sqlite3
gemfiles/*.gemfile.lock
gemfiles/.bundle/*
spec/dummy/log/
4 changes: 2 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ inherit_gem:
salsify_rubocop: conf/rubocop.yml

AllCops:
TargetRubyVersion: 2.5
TargetRubyVersion: 2.7
Exclude:
- 'vendor/**/*'
- 'gemfiles/vendor/**/*'
- 'gemfiles/**/*'
13 changes: 13 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

appraise 'rails-6.0' do
gem 'rails', '~> 6.0.5'
end

appraise 'rails-6.1' do
gem 'rails', '~> 6.1.6'
end

appraise 'rails-7.0' do
gem 'rails', '~> 7.0.3'
end
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

### 1.0.0
* Require Ruby 2.7 or higher.

### 0.3.0
* Require Ruby 2.5 or higher.
* Support for running multiple worker pools on a single node.
Expand Down
7 changes: 4 additions & 3 deletions delayed_job_worker_pool.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,18 @@ Gem::Specification.new do |spec|
spec.executables = ['delayed_job_worker_pool']
spec.require_paths = ['lib']

spec.required_ruby_version = '>= 2.5'
spec.required_ruby_version = '>= 2.7'

spec.add_dependency 'delayed_job', ['>= 3.0', '< 4.2']

spec.add_development_dependency 'appraisal'
spec.add_development_dependency 'bundler', '~> 2.0'
spec.add_development_dependency 'delayed_job_active_record'
spec.add_development_dependency 'rails', '>= 5.2', '< 7'
spec.add_development_dependency 'rails', '>= 6.0', '< 8'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rspec', '>= 3.8'
spec.add_development_dependency 'rspec_junit_formatter'
spec.add_development_dependency 'salsify_rubocop', '~> 1.0.2'
spec.add_development_dependency 'salsify_rubocop', '~> 1.27.1'
spec.add_development_dependency 'sprockets', '< 4'
spec.add_development_dependency 'sqlite3', '>= 1.3'
end
7 changes: 7 additions & 0 deletions gemfiles/rails_6.0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "~> 6.0.5"

gemspec path: "../"
7 changes: 7 additions & 0 deletions gemfiles/rails_6.1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "~> 6.1.6"

gemspec path: "../"
7 changes: 7 additions & 0 deletions gemfiles/rails_7.0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "~> 7.0.3"

gemspec path: "../"
2 changes: 1 addition & 1 deletion lib/delayed_job_worker_pool/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module DelayedJobWorkerPool
VERSION = '0.3.0'
VERSION = '1.0.0'
end
14 changes: 8 additions & 6 deletions spec/dummy/config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,24 @@
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
#
default: &default

development:
adapter: sqlite3
pool: 5
timeout: 5000

development:
<<: *default
database: db/development.sqlite3

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
adapter: sqlite3
pool: 5
timeout: 5000
database: db/test.sqlite3

production:
<<: *default
adapter: sqlite3
pool: 5
timeout: 5000
database: db/production.sqlite3
4 changes: 2 additions & 2 deletions spec/dummy/config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = true
# config.assets.debug = true

# Adds additional error checking when serving assets at runtime.
# Checks for improperly declared sprockets dependencies.
# Raises helpful error messages.
config.assets.raise_runtime_errors = true
# config.assets.raise_runtime_errors = true

# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/config/initializers/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Be sure to restart your server when you modify this file.

# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.0'
# Rails.application.config.assets.version = '1.0'

# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
Expand Down
2 changes: 1 addition & 1 deletion spec/support/wait.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Wait
extend self

def for(condition_name, max_wait_time: 10, polling_interval: 0.001)
def for(condition_name, max_wait_time: 60, polling_interval: 0.001)
wait_until = Time.now + max_wait_time
loop do
return if yield
Expand Down

0 comments on commit d09f418

Please sign in to comment.