Skip to content

Commit

Permalink
Rails 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
eddierubeiz committed Jul 13, 2022
1 parent 9122480 commit 8d6303b
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 19 deletions.
70 changes: 56 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,31 @@ jobs:

- samvera/parallel_rspec



workflows:
ci:
jobs:
# Ruby 3.1 release
- bundle_and_test:
name: "ruby3-1_rails6-1"
ruby_version: 3.1.2
rails_version: 6.1.1
- bundle_and_test:
name: "ruby3-1_rails6-0"
ruby_version: 3.1.2
rails_version: 6.0.5

# Ruby 3.0 release
- bundle_and_test:
name: "ruby3-0_rails6-1"
ruby_version: 3.0.0
rails_version: 6.1.1
- bundle_and_test:
name: "ruby3-0_rails6-0"
ruby_version: 3.0.0
rails_version: 6.0.5

# Ruby 2.7 release
- bundle_and_test:
name: "ruby2-7_rails6-1"
Expand All @@ -62,11 +84,11 @@ workflows:
- bundle_and_test:
name: "ruby2-7_rails6-0"
ruby_version: 2.7.5
rails_version: 6.0.2
rails_version: 6.0.5
- bundle_and_test:
name: "ruby2-7_rails5-2"
ruby_version: 2.7.5
rails_version: 5.2.4
rails_version: 5.2.6
- bundle_and_test:
name: "ruby2-7_rails5-1"
ruby_version: 2.7.5
Expand All @@ -80,11 +102,11 @@ workflows:
- bundle_and_test:
name: "ruby2-6_rails6-0"
ruby_version: 2.6.9
rails_version: 6.0.2
rails_version: 6.0.5
- bundle_and_test:
name: "ruby2-6_rails5-2"
ruby_version: 2.6.9
rails_version: 5.2.4
rails_version: 5.2.6
- bundle_and_test:
name: "ruby2-6_rails5-1"
ruby_version: 2.6.9
Expand All @@ -94,15 +116,15 @@ workflows:
- bundle_and_test:
name: "ruby2-5_rails6-1"
ruby_version: 2.5.9
rails_version: 6.1.0
rails_version: 6.1.1
- bundle_and_test:
name: "ruby2-5_rails6-0"
ruby_version: 2.5.9
rails_version: 6.0.2
rails_version: 6.0.5
- bundle_and_test:
name: "ruby2-5_rails5-2"
ruby_version: 2.5.9
rails_version: 5.2.4
rails_version: 5.2.6
- bundle_and_test:
name: "ruby2-5_rails5-1"
ruby_version: 2.5.9
Expand All @@ -118,6 +140,26 @@ workflows:
- main

jobs:
# Ruby 3.1 release
- bundle_and_test:
name: "ruby3-1_rails6-1"
ruby_version: 3.1.2
rails_version: 6.1.1
- bundle_and_test:
name: "ruby3-1_rails6-0"
ruby_version: 3.1.2
rails_version: 6.0.5

# Ruby 3.0 release
- bundle_and_test:
name: "ruby3-0_rails6-1"
ruby_version: 3.0.0
rails_version: 6.1.1
- bundle_and_test:
name: "ruby3-0_rails6-0"
ruby_version: 3.0.0
rails_version: 6.0.5

# Ruby 2.7 release
- bundle_and_test:
name: "ruby2-7_rails6-1"
Expand All @@ -126,11 +168,11 @@ workflows:
- bundle_and_test:
name: "ruby2-7_rails6-0"
ruby_version: 2.7.5
rails_version: 6.0.2
rails_version: 6.0.5
- bundle_and_test:
name: "ruby2-7_rails5-2"
ruby_version: 2.7.5
rails_version: 5.2.4
rails_version: 5.2.6
- bundle_and_test:
name: "ruby2-7_rails5-1"
ruby_version: 2.7.5
Expand All @@ -144,11 +186,11 @@ workflows:
- bundle_and_test:
name: "ruby2-6_rails6-0"
ruby_version: 2.6.9
rails_version: 6.0.2
rails_version: 6.0.5
- bundle_and_test:
name: "ruby2-6_rails5-2"
ruby_version: 2.6.9
rails_version: 5.2.4
rails_version: 5.2.6
- bundle_and_test:
name: "ruby2-6_rails5-1"
ruby_version: 2.6.9
Expand All @@ -158,15 +200,15 @@ workflows:
- bundle_and_test:
name: "ruby2-5_rails6-1"
ruby_version: 2.5.9
rails_version: 6.1.0
rails_version: 6.1.1
- bundle_and_test:
name: "ruby2-5_rails6-0"
ruby_version: 2.5.9
rails_version: 6.0.2
rails_version: 6.0.5
- bundle_and_test:
name: "ruby2-5_rails5-2"
ruby_version: 2.5.9
rails_version: 5.2.4
rails_version: 5.2.6
- bundle_and_test:
name: "ruby2-5_rails5-1"
ruby_version: 2.5.9
Expand Down
5 changes: 4 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ inherit_gem:
inherit_from: .rubocop_todo.yml

AllCops:
TargetRubyVersion: 2.6
TargetRubyVersion: 3.1
DisplayCopNames: true
Exclude:
- 'db/**/*'
Expand All @@ -21,6 +21,9 @@ Metrics/BlockLength:
- 'qa.gemspec'
- 'spec/**/*.rb'

Style/HashSyntax:
Enabled: false

# By default RSpec/MessageSpies has the following:
# Prefer have_received for setting message expectations. Setup form as a spy using allow or instance_spy.
# The default assumes EnforcedStyle is 'have_received'. Most of our specs are 'receive'
Expand Down
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,14 @@ If you're working on PR for this project, create a feature branch off of `main`.
This repository follows the [Samvera Community Code of Conduct](https://samvera.atlassian.net/wiki/spaces/samvera/pages/405212316/Code+of+Conduct) and [language recommendations](https://github.com/samvera/maintenance/blob/main/templates/CONTRIBUTING.md#language). Please ***do not*** create a branch called `master` for this repository or as part of your pull request; the branch will either need to be removed or renamed before it can be considered for inclusion in the code base and history of this repository.

## Compatibility

- Ruby 2.5 or the latest 2.4 version is recommended. Later versions may also work.
- Rails 5 is required. We recommend the latest Rails 5.2 release.
This code works with the latest versions of:
- Rails 6.1 and 6.0.
- Rails 5 also works with Ruby versions older than 3.
- Ruby 3.0 (except with Rails 5), 2.6, and 2.5.
- The combination of Ruby 3 and Rails 6 comes with two caveats:
- your app will not be able to use `psych 4` (which ordinarily comes with 3.1). See https://bugs.ruby-lang.org/issues/17866 and https://stackoverflow.com/questions/71191685/visit-psych-nodes-alias-unknown-alias-default-psychbadalias/71192990#71192990 for an explanation. One workaround is to modify your app's `Gemfile` to hold back `psych`: `gem 'psych', '< 4'`.
- likewise, you want to add gem 'net-smtp', require: false to your Gemfile to get around the bug described in https://stackoverflow.com/questions/70500220/rails-7-ruby-3-1-loaderror-cannot-load-such-file-net-smtp .
See also `.circleci/config.yml` and `spec/test_app_templates/Gemfile.extra`.

## Product Owner & Maintenance

Expand Down
2 changes: 1 addition & 1 deletion qa.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Gem::Specification.new do |s|
s.add_dependency 'rdf'

# the hyrax style guide is based on `bixby`. see `.rubocop.yml`
s.add_development_dependency 'bixby', '~> 3.0.0'
s.add_development_dependency 'bixby', '~> 5.0', '>= 5.0.2' # bixby 5 briefly dropped Ruby 2.5
s.add_development_dependency 'rails', '!=5.2.0', '!=5.2.1', '!=5.2.2'
s.add_development_dependency 'byebug'
s.add_development_dependency 'engine_cart', '~> 2.0'
Expand Down
14 changes: 14 additions & 0 deletions spec/test_app_templates/Gemfile.extra
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,18 @@

group :development do
gem 'linkeddata'
case ENV['RAILS_VERSION']
when /^6\.[01]\./
# Ruby 3.0 comes with Psych 3, while Ruby 3.1 comes with Psych 4,
# which has a major breaking change (diff 3.3.2 → 4.0.0).
# See: https://bugs.ruby-lang.org/issues/17866
# See also: https://stackoverflow.com/questions/71191685/visit-psych-nodes-alias-unknown-alias-default-psychbadalias/71192990#71192990
gem 'psych', '< 4'
# opt into mail 2.8.0.rc1 so we get extra dependencies
# Once mail 2.8.0 final is released this will not be required.
# https://github.com/mikel/mail/pull/1472
gem "mail", ">= 2.8.0.rc1"
# See https://stackoverflow.com/questions/70500220/rails-7-ruby-3-1-loaderror-cannot-load-such-file-net-smtp
gem 'net-smtp', require: false
end
end

0 comments on commit 8d6303b

Please sign in to comment.