Skip to content
Snippets Groups Projects
Commit 597d548a authored by Henk's avatar Henk
Browse files

Support rails 6.1, drop support or rails 5.1

parent 99369ac4
Branches
Tags
1 merge request!44Add stripped string type, add support for rails 6.1, appsignal 3 and active_interaction 4. Drop support for rails 5.1
Pipeline #82085 failed
......@@ -5,8 +5,7 @@ before_script:
- if [ -x "$(command -v apk)" ]; then apk add sqlite-dev; fi
- export BUNDLE_PATH=$CI_PROJECT_DIR/.gems
- bundle --jobs 2 --retry 3
- bundle exec appraisal
- bundle --jobs 2 --retry 3
- bundle exec appraisal install
.ruby_25: &ruby_25
image: registry.roqua.nl/roqua/docker-base-images:ruby-2.5
......@@ -22,10 +21,12 @@ before_script:
paths:
- .gems
rails_51_ruby_25:
<<: *ruby_25
script:
- bundle exec appraisal rails51 bundle exec rspec
.ruby_27: &ruby_27
image: registry.roqua.nl/roqua/docker-base-images:ruby-2.7-builder
cache:
key: ruby_27
paths:
- .gems
rails_52_ruby_25:
<<: *ruby_25
......@@ -37,6 +38,11 @@ rails_52_ruby_26:
script:
- bundle exec appraisal rails52 bundle exec rspec
rails_52_ruby_27:
<<: *ruby_27
script:
- bundle exec appraisal rails52 bundle exec rspec
rails_60_ruby_25:
<<: *ruby_25
script:
......@@ -46,3 +52,13 @@ rails_60_ruby_26:
<<: *ruby_26
script:
- bundle exec appraisal rails60 bundle exec rspec
rails_60_ruby_27:
<<: *ruby_27
script:
- bundle exec appraisal rails60 bundle exec rspec
rails_61_ruby_27:
<<: *ruby_27
script:
- bundle exec appraisal rails61 bundle exec rspec
appraise "rails51" do
gem "activesupport", "~> 5.1.0"
gem 'sqlite3', '~> 1.3.6'
end
appraise "rails52" do
gem "active_interaction", "~> 3.0"
gem "activesupport", "~> 5.2.0"
gem 'sqlite3', '~> 1.4'
gem 'appsignal', '~> 2.9.8' # test each minor versions we support
end
appraise "rails60" do
gem "activesupport", "~> 6.0.0"
gem 'sqlite3', '~> 1.4'
gem 'appsignal', '~> 2.10.6'
end
appraise "rails61" do
gem "activesupport", "~> 6.1.0"
gem 'appsignal', '~> 3.0.0'
end
......@@ -7,8 +7,8 @@ gem 'appraisal'
gem 'roqua_styleguide', git: 'https://gitlab.roqua.nl/roqua/styleguide.git'
group :test do
gem 'sqlite3'
gem 'actionpack', '>= 4.0'
gem 'active_interaction', '~> 3.0'
gem 'climate_control' # For ENV modification in specs
gem 'combustion', '~> 1.1.1'
gem 'fakefs', require: 'fakefs/safe'
......@@ -17,4 +17,4 @@ group :test do
gem 'rspec-instrumentation-matcher'
gem 'rspec-rails'
gem 'pry'
end
\ No newline at end of file
end
......@@ -10,9 +10,9 @@ PATH
remote: .
specs:
roqua-support (0.3.5)
active_interaction (~> 3.0)
activesupport (>= 5.1, < 6.1)
appsignal (>= 2.9, < 2.11)
active_interaction (>= 3.0, < 5.0)
activesupport (>= 5.2, < 6.2)
appsignal (>= 2.9, < 3.1)
naught (~> 1.0)
with_advisory_lock (~> 3.2)
......@@ -170,6 +170,7 @@ GEM
rubocop (>= 0.72.0)
ruby-progressbar (1.10.1)
shellany (0.0.1)
sqlite3 (1.4.2)
thor (1.0.1)
thread_safe (0.3.6)
timecop (0.9.1)
......@@ -201,6 +202,7 @@ DEPENDENCIES
rspec (>= 2.12.0, < 4.0)
rspec-instrumentation-matcher
rspec-rails
sqlite3
timecop
BUNDLED WITH
......
......@@ -4,13 +4,13 @@ source "https://rubygems.org"
gem "appraisal"
gem "roqua_styleguide", git: "https://gitlab.roqua.nl/roqua/styleguide.git"
gem "active_interaction", "~> 3.0"
gem "activesupport", "~> 5.2.0"
gem "sqlite3", "~> 1.4"
gem "appsignal", "~> 2.9.8"
group :test do
gem "sqlite3"
gem "actionpack", ">= 4.0"
gem "active_interaction", "~> 3.0"
gem "climate_control"
gem "combustion", "~> 1.1.1"
gem "fakefs", require: "fakefs/safe"
......
......@@ -5,12 +5,11 @@ source "https://rubygems.org"
gem "appraisal"
gem "roqua_styleguide", git: "https://gitlab.roqua.nl/roqua/styleguide.git"
gem "activesupport", "~> 6.0.0"
gem "sqlite3", "~> 1.4"
gem "appsignal", "~> 2.10.6"
group :test do
gem "sqlite3"
gem "actionpack", ">= 4.0"
gem "active_interaction", "~> 3.0"
gem "climate_control"
gem "combustion", "~> 1.1.1"
gem "fakefs", require: "fakefs/safe"
......
......@@ -4,12 +4,12 @@ source "https://rubygems.org"
gem "appraisal"
gem "roqua_styleguide", git: "https://gitlab.roqua.nl/roqua/styleguide.git"
gem "activesupport", "~> 5.1.0"
gem "sqlite3", "~> 1.3.6"
gem "activesupport", "~> 6.1.0"
gem "appsignal", "~> 3.0.0"
group :test do
gem "sqlite3"
gem "actionpack", ">= 4.0"
gem "active_interaction", "~> 3.0"
gem "climate_control"
gem "combustion", "~> 1.1.1"
gem "fakefs", require: "fakefs/safe"
......
......@@ -29,7 +29,10 @@ class Roqua::Scheduling::Scheduler
end
def advisory_lock_name
"#{ActiveRecord::Base.connection_config[:database]}_cron_lock"
db_name = ActiveRecord::Base.respond_to?(:connection_db_config) \
? ActiveRecord::Base.connection_db_config.database
: ActiveRecord::Base.connection_config[:database]
"#{db_name}_cron_lock"
end
private
......
......@@ -6,7 +6,7 @@ class SubsetValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
return unless value
unless value.all? { |element| options.fetch(:of).include? element }
record.errors[attribute] << (options[:message] || I18n.t('errors.messages.subset'))
record.errors.add attribute, (options[:message] || I18n.t('errors.messages.subset'))
end
end
end
......@@ -19,8 +19,8 @@ Gem::Specification.new do |gem|
gem.require_paths = ["lib"]
gem.required_ruby_version = '>= 2.5'
gem.add_dependency 'activesupport', '>= 5.1', '< 6.1'
gem.add_dependency 'active_interaction', '>= 3.0', '< 5.0'
gem.add_dependency 'activesupport', '>= 5.2', '< 6.2'
gem.add_dependency 'naught', '~> 1.0'
gem.add_dependency 'with_advisory_lock', '~> 3.2'
gem.add_dependency 'appsignal', '>= 2.9', '< 3.1'
......
......@@ -51,7 +51,7 @@ describe Roqua::Scheduling::Scheduler do
end
it 'generates a database specific advisory lock name' do
expect(ActiveRecord::Base.connection_config[:database]).to eql(':memory:')
# expect(ActiveRecord::Base.connection_config[:database]).to eql(':memory:')
expect(subject.advisory_lock_name).to eql ':memory:_cron_lock'
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment