Add Ruby 3.1 to CI

Also fixes the unquoted 3.0, which needs to be quoted to avoid truncation
Addresses a few Rubocop issues and an active_support require issue on Rails 7 w/Zeitwerk
This commit is contained in:
Peter Goldstein 2022-02-02 10:52:32 -08:00
parent 44cf8495ea
commit 826a8c4323
9 changed files with 14 additions and 6 deletions

View File

@ -4,10 +4,10 @@ on: [push, pull_request]
jobs:
tests:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
strategy:
matrix:
ruby: [2.4, 2.7, 3.0, truffleruby-head]
ruby: [2.4, 2.7, '3.0', 3.1, truffleruby-head]
steps:
- uses: actions/checkout@master

View File

@ -42,6 +42,9 @@ Performance/TimesMap:
Exclude:
- 'spec/**/**.rb'
Gemspec/RequiredRubyVersion:
Enabled: false
# TODO: Fix these...
Style/Documentation:
Enabled: false

View File

@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
gem.summary = 'Fast JSON:API serialization library'
gem.description = 'Fast, simple and easy to use '\
'JSON:API serialization library (also known as fast_jsonapi).'
'JSON:API serialization library (also known as fast_jsonapi).'
gem.homepage = 'https://github.com/jsonapi-serializer/jsonapi-serializer'
gem.licenses = ['Apache-2.0']
gem.files = Dir['lib/**/*']
@ -33,4 +33,5 @@ Gem::Specification.new do |gem|
gem.add_development_dependency('rubocop-rspec')
gem.add_development_dependency('simplecov')
gem.add_development_dependency('sqlite3')
gem.metadata['rubygems_mfa_required'] = 'true'
end

View File

@ -1,5 +1,6 @@
# frozen_string_literal: true
require 'active_support'
require 'active_support/time'
require 'active_support/concern'
require 'active_support/inflector'
@ -133,9 +134,7 @@ module FastJsonapi
def reflected_record_type
return @reflected_record_type if defined?(@reflected_record_type)
@reflected_record_type ||= begin
name.split('::').last.chomp('Serializer').underscore.to_sym if name&.end_with?('Serializer')
end
@reflected_record_type ||= (name.split('::').last.chomp('Serializer').underscore.to_sym if name&.end_with?('Serializer'))
end
def set_key_transform(transform_name)

View File

@ -1,5 +1,6 @@
# frozen_string_literal: true
require 'active_support'
require 'active_support/concern'
require 'digest/sha1'

View File

@ -1,3 +1,4 @@
require 'active_support'
require 'active_support/notifications'
module JSONAPI

View File

@ -1,3 +1,4 @@
require 'active_support'
require 'active_support/cache'
class User

View File

@ -1,3 +1,4 @@
require 'active_support'
require 'active_support/cache'
require 'jsonapi/serializer/instrumentation'

View File

@ -6,6 +6,7 @@ SimpleCov.start do
end
SimpleCov.minimum_coverage 90
require 'active_support'
require 'active_support/core_ext/object/json'
require 'jsonapi/serializer'
require 'ffaker'