From bfc55ebd4f7121e66fe53a6437c3aaa92014cc58 Mon Sep 17 00:00:00 2001 From: Pascal Zumkehr Date: Thu, 30 Nov 2023 12:44:07 +0100 Subject: [PATCH] Update supported gem version --- .circleci/config.yml | 16 +- .github/workflows/reviewdog.yml | 2 +- .rubocop.yml | 1 + .rubocop_todo.yml | 442 ++++++++++++++++------- .ruby-version | 2 +- Appraisals | 21 -- gemfiles/rails_5_2.gemfile | 13 - gemfiles/rails_6_0.gemfile | 17 - lib/apartment/version.rb | 2 +- puzzle-apartment.gemspec | 16 +- spec/examples/schema_adapter_examples.rb | 2 - spec/spec_helper.rb | 2 +- 12 files changed, 333 insertions(+), 203 deletions(-) delete mode 100644 gemfiles/rails_5_2.gemfile delete mode 100644 gemfiles/rails_6_0.gemfile diff --git a/.circleci/config.yml b/.circleci/config.yml index 8e901746..973e4b23 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,12 +62,10 @@ workflows: - build: matrix: parameters: - ruby_version: ["ruby:2.7.8", "ruby:3.0.6", "ruby:3.1.4", "ruby:3.2.2"] - gemfile: ["gemfiles/rails_5_2.gemfile", "gemfiles/rails_6_0.gemfile", "gemfiles/rails_6_1.gemfile", "gemfiles/rails_7_0.gemfile", "gemfiles/rails_7_1.gemfile"] - exclude: - - ruby_version: "ruby:3.0.6" - gemfile: "gemfiles/rails_5_2.gemfile" - - ruby_version: "ruby:3.1.4" - gemfile: "gemfiles/rails_5_2.gemfile" - - ruby_version: "ruby:3.2.2" - gemfile: "gemfiles/rails_5_2.gemfile" + ruby_version: ["ruby:3.0.6", "ruby:3.1.4", "ruby:3.2.2"] + gemfile: + [ + "gemfiles/rails_6_1.gemfile", + "gemfiles/rails_7_0.gemfile", + "gemfiles/rails_7_1.gemfile", + ] diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index 6b1b315a..2f73a53c 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -19,4 +19,4 @@ jobs: reporter: github-check rubocop_version: 0.93.1 github_token: ${{ secrets.github_token }} - rubocop_extensions: rubocop-performance:1.10.2 rubocop-rails:2.9.1 rubocop-rspec:1.44.1 + rubocop_extensions: rubocop-performance:1.19.1 rubocop-rails:2.22.2 rubocop-rspec:2.25.0 diff --git a/.rubocop.yml b/.rubocop.yml index 17142ddf..9b9584c8 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -13,6 +13,7 @@ AllCops: - spec/schemas/**/*.rb NewCops: enable + SuggestExtensions: false Gemspec/RequiredRubyVersion: Exclude: diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index d8338622..55a58667 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,24 +1,76 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2021-06-26 03:25:28 UTC using RuboCop version 0.93.1. +# on 2023-11-30 11:39:58 UTC using RuboCop version 1.57.2. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include. +# Include: **/*.gemfile, **/Gemfile, **/gems.rb +Bundler/OrderedGems: + Exclude: + - "Gemfile" + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Severity, Include. +# Include: **/*.gemspec +Gemspec/DeprecatedAttributeAssignment: + Exclude: + - "puzzle-apartment.gemspec" + +# Offense count: 20 +# Configuration parameters: EnforcedStyle, AllowedGems, Include. +# SupportedStyles: Gemfile, gems.rb, gemspec +# Include: **/*.gemspec, **/Gemfile, **/gems.rb +Gemspec/DevelopmentDependencies: + Exclude: + - "puzzle-apartment.gemspec" + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Severity, Include. +# Include: **/*.gemspec +Gemspec/RequireMFA: + Exclude: + - "puzzle-apartment.gemspec" + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: aligned, indented +Layout/LineEndStringConcatenationIndentation: + Exclude: + - "lib/apartment/custom_console.rb" + # Offense count: 1 Lint/MixedRegexpCaptureTypes: Exclude: - - 'lib/apartment/elevators/domain.rb' + - "lib/apartment/elevators/domain.rb" -# Offense count: 3 -# Configuration parameters: IgnoredMethods. +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Lint/RedundantCopDisableDirective: + Exclude: + - "spec/support/config.rb" + +# Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). +Lint/RedundantDirGlobSort: + Exclude: + - "spec/spec_helper.rb" + +# Offense count: 2 +# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. Metrics/AbcSize: Max: 28 -# Offense count: 5 -# Configuration parameters: CountComments, CountAsOne, ExcludedMethods. -# ExcludedMethods: refine +# Offense count: 4 +# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode. +# AllowedMethods: refine Metrics/BlockLength: Max: 83 @@ -28,207 +80,339 @@ Metrics/ClassLength: Max: 151 # Offense count: 6 -# Configuration parameters: CountComments, CountAsOne, ExcludedMethods. +# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. Metrics/MethodLength: - Max: 24 + Max: 23 + +# Offense count: 5 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, BlockForwardingName. +# SupportedStyles: anonymous, explicit +Naming/BlockForwarding: + Exclude: + - "lib/apartment/adapters/abstract_adapter.rb" + - "lib/apartment/log_subscriber.rb" + - "lib/apartment/model.rb" + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Performance/RedundantBlockCall: + Exclude: + - "lib/apartment/tasks/task_helper.rb" + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Performance/StringIdentifierArgument: + Exclude: + - "lib/apartment/railtie.rb" # Offense count: 3 RSpec/AnyInstance: Exclude: - - 'spec/unit/migrator_spec.rb' + - "spec/unit/migrator_spec.rb" + +# Offense count: 4 +# This cop supports unsafe autocorrection (--autocorrect-all). +RSpec/BeEq: + Exclude: + - "spec/adapters/sqlite3_adapter_spec.rb" + - "spec/unit/elevators/first_subdomain_spec.rb" # Offense count: 2 RSpec/BeforeAfterAll: Exclude: - - 'spec/spec_helper.rb' - - 'spec/rails_helper.rb' - - 'spec/support/**/*.rb' - - 'spec/adapters/sqlite3_adapter_spec.rb' - - 'spec/tasks/apartment_rake_spec.rb' + - "spec/adapters/sqlite3_adapter_spec.rb" + - "spec/tasks/apartment_rake_spec.rb" # Offense count: 18 -# Configuration parameters: Prefixes. +# Configuration parameters: Prefixes, AllowedPatterns. # Prefixes: when, with, without RSpec/ContextWording: Exclude: - - 'spec/adapters/sqlite3_adapter_spec.rb' - - 'spec/examples/generic_adapter_custom_configuration_example.rb' - - 'spec/examples/schema_adapter_examples.rb' - - 'spec/support/contexts.rb' - - 'spec/tasks/apartment_rake_spec.rb' - - 'spec/tenant_spec.rb' + - "spec/adapters/sqlite3_adapter_spec.rb" + - "spec/examples/generic_adapter_custom_configuration_example.rb" + - "spec/examples/schema_adapter_examples.rb" + - "spec/support/contexts.rb" + - "spec/tasks/apartment_rake_spec.rb" + - "spec/tenant_spec.rb" -# Offense count: 4 +# Offense count: 5 # Configuration parameters: IgnoredMetadata. RSpec/DescribeClass: Exclude: - - 'spec/integration/apartment_rake_integration_spec.rb' - - 'spec/integration/connection_handling_spec.rb' - - 'spec/integration/query_caching_spec.rb' - - 'spec/integration/use_within_an_engine_spec.rb' - - 'spec/tasks/apartment_rake_spec.rb' + - "spec/integration/apartment_rake_integration_spec.rb" + - "spec/integration/connection_handling_spec.rb" + - "spec/integration/query_caching_spec.rb" + - "spec/integration/use_within_an_engine_spec.rb" + - "spec/tasks/apartment_rake_spec.rb" -# Offense count: 12 -# Cop supports --auto-correct. +# Offense count: 11 +# This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: SkipBlocks, EnforcedStyle. # SupportedStyles: described_class, explicit RSpec/DescribedClass: Exclude: - - 'spec/apartment_spec.rb' - - 'spec/tenant_spec.rb' - - 'spec/unit/elevators/host_hash_spec.rb' - - 'spec/unit/migrator_spec.rb' + - "spec/apartment_spec.rb" + - "spec/tenant_spec.rb" + - "spec/unit/elevators/host_hash_spec.rb" + - "spec/unit/migrator_spec.rb" # Offense count: 5 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). RSpec/EmptyLineAfterFinalLet: Exclude: - - 'spec/adapters/sqlite3_adapter_spec.rb' - - 'spec/examples/schema_adapter_examples.rb' + - "spec/adapters/sqlite3_adapter_spec.rb" + - "spec/examples/schema_adapter_examples.rb" # Offense count: 14 -# Configuration parameters: Max. +# Configuration parameters: CountAsOne. RSpec/ExampleLength: - Exclude: - - 'spec/examples/generic_adapter_custom_configuration_example.rb' - - 'spec/examples/generic_adapter_examples.rb' - - 'spec/examples/schema_adapter_examples.rb' - - 'spec/integration/query_caching_spec.rb' - - 'spec/tenant_spec.rb' + Max: 12 # Offense count: 60 -# Cop supports --auto-correct. -# Configuration parameters: CustomTransform, IgnoredWords. +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: CustomTransform, IgnoredWords, DisallowedExamples. +# DisallowedExamples: works RSpec/ExampleWording: Exclude: - - 'spec/adapters/sqlite3_adapter_spec.rb' - - 'spec/apartment_spec.rb' - - 'spec/examples/connection_adapter_examples.rb' - - 'spec/examples/generic_adapter_custom_configuration_example.rb' - - 'spec/examples/generic_adapter_examples.rb' - - 'spec/examples/schema_adapter_examples.rb' - - 'spec/integration/apartment_rake_integration_spec.rb' - - 'spec/integration/use_within_an_engine_spec.rb' - - 'spec/tasks/apartment_rake_spec.rb' - - 'spec/tenant_spec.rb' - -# Offense count: 13 -# Configuration parameters: CustomTransform, IgnoreMethods, SpecSuffixOnly. + - "spec/adapters/sqlite3_adapter_spec.rb" + - "spec/apartment_spec.rb" + - "spec/examples/connection_adapter_examples.rb" + - "spec/examples/generic_adapter_custom_configuration_example.rb" + - "spec/examples/generic_adapter_examples.rb" + - "spec/examples/schema_adapter_examples.rb" + - "spec/integration/apartment_rake_integration_spec.rb" + - "spec/integration/use_within_an_engine_spec.rb" + - "spec/tasks/apartment_rake_spec.rb" + - "spec/tenant_spec.rb" + +# Offense count: 12 +# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly. +# Include: **/*_spec*rb*, **/spec/**/* RSpec/FilePath: Exclude: - - 'spec/adapters/mysql2_adapter_spec.rb' - - 'spec/adapters/postgresql_adapter_spec.rb' - - 'spec/adapters/sqlite3_adapter_spec.rb' - - 'spec/tenant_spec.rb' - - 'spec/unit/config_spec.rb' - - 'spec/unit/elevators/domain_spec.rb' - - 'spec/unit/elevators/first_subdomain_spec.rb' - - 'spec/unit/elevators/generic_spec.rb' - - 'spec/unit/elevators/host_hash_spec.rb' - - 'spec/unit/elevators/host_spec.rb' - - 'spec/unit/elevators/subdomain_spec.rb' - - 'spec/unit/migrator_spec.rb' + - "spec/adapters/mysql2_adapter_spec.rb" + - "spec/adapters/postgresql_adapter_spec.rb" + - "spec/adapters/sqlite3_adapter_spec.rb" + - "spec/tenant_spec.rb" + - "spec/unit/config_spec.rb" + - "spec/unit/elevators/domain_spec.rb" + - "spec/unit/elevators/first_subdomain_spec.rb" + - "spec/unit/elevators/generic_spec.rb" + - "spec/unit/elevators/host_hash_spec.rb" + - "spec/unit/elevators/host_spec.rb" + - "spec/unit/elevators/subdomain_spec.rb" + - "spec/unit/migrator_spec.rb" # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: implicit, each, example RSpec/HookArgument: Exclude: - - 'spec/support/setup.rb' + - "spec/support/setup.rb" # Offense count: 4 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). RSpec/HooksBeforeExamples: Exclude: - - 'spec/adapters/sqlite3_adapter_spec.rb' - - 'spec/examples/schema_adapter_examples.rb' + - "spec/adapters/sqlite3_adapter_spec.rb" + - "spec/examples/schema_adapter_examples.rb" + +# Offense count: 4 +# Configuration parameters: Max, AllowedIdentifiers, AllowedPatterns. +RSpec/IndexedLet: + Exclude: + - "spec/examples/schema_adapter_examples.rb" + - "spec/support/contexts.rb" # Offense count: 18 # Configuration parameters: AssignmentOnly. RSpec/InstanceVariable: Exclude: - - 'spec/examples/generic_adapter_examples.rb' - - 'spec/examples/schema_adapter_examples.rb' - - 'spec/integration/apartment_rake_integration_spec.rb' - - 'spec/integration/use_within_an_engine_spec.rb' - - 'spec/tasks/apartment_rake_spec.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -RSpec/LeadingSubject: - Exclude: + - "spec/examples/generic_adapter_examples.rb" + - "spec/examples/schema_adapter_examples.rb" + - "spec/integration/apartment_rake_integration_spec.rb" + - "spec/integration/use_within_an_engine_spec.rb" + - "spec/tasks/apartment_rake_spec.rb" # Offense count: 2 RSpec/LeakyConstantDeclaration: Exclude: - - 'spec/examples/generic_adapters_callbacks_examples.rb' - - 'spec/unit/elevators/generic_spec.rb' + - "spec/examples/generic_adapters_callbacks_examples.rb" + - "spec/unit/elevators/generic_spec.rb" # Offense count: 35 # Configuration parameters: EnforcedStyle. # SupportedStyles: have_received, receive RSpec/MessageSpies: Exclude: - - 'spec/examples/generic_adapter_custom_configuration_example.rb' - - 'spec/integration/apartment_rake_integration_spec.rb' - - 'spec/integration/use_within_an_engine_spec.rb' - - 'spec/tasks/apartment_rake_spec.rb' - - 'spec/unit/elevators/domain_spec.rb' - - 'spec/unit/elevators/generic_spec.rb' - - 'spec/unit/elevators/host_hash_spec.rb' - - 'spec/unit/elevators/host_spec.rb' - - 'spec/unit/elevators/subdomain_spec.rb' - - 'spec/unit/migrator_spec.rb' - -# Offense count: 29 + - "spec/examples/generic_adapter_custom_configuration_example.rb" + - "spec/integration/apartment_rake_integration_spec.rb" + - "spec/integration/use_within_an_engine_spec.rb" + - "spec/tasks/apartment_rake_spec.rb" + - "spec/unit/elevators/domain_spec.rb" + - "spec/unit/elevators/generic_spec.rb" + - "spec/unit/elevators/host_hash_spec.rb" + - "spec/unit/elevators/host_spec.rb" + - "spec/unit/elevators/subdomain_spec.rb" + - "spec/unit/migrator_spec.rb" + +# Offense count: 11 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: hash, symbol +RSpec/MetadataStyle: + Exclude: + - "spec/examples/schema_adapter_examples.rb" + - "spec/support/contexts.rb" + +# Offense count: 30 RSpec/MultipleExpectations: - Max: 4 + Max: 6 -# Offense count: 47 -# Configuration parameters: IgnoreSharedExamples. +# Offense count: 46 +# Configuration parameters: EnforcedStyle, IgnoreSharedExamples. +# SupportedStyles: always, named_only RSpec/NamedSubject: Exclude: - - 'spec/adapters/mysql2_adapter_spec.rb' - - 'spec/adapters/sqlite3_adapter_spec.rb' - - 'spec/support/contexts.rb' - - 'spec/support/requirements.rb' - - 'spec/tenant_spec.rb' + - "spec/adapters/mysql2_adapter_spec.rb" + - "spec/adapters/sqlite3_adapter_spec.rb" + - "spec/support/contexts.rb" + - "spec/support/requirements.rb" + - "spec/tenant_spec.rb" # Offense count: 24 +# Configuration parameters: AllowedGroups. RSpec/NestedGroups: Max: 5 +# Offense count: 1 +# Configuration parameters: AllowedPatterns. +# AllowedPatterns: ^expect_, ^assert_ +RSpec/NoExpectationExample: + Exclude: + - "spec/tenant_spec.rb" + # Offense count: 6 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: and_return, block RSpec/ReturnFromStub: Exclude: - - 'spec/integration/apartment_rake_integration_spec.rb' - - 'spec/unit/migrator_spec.rb' + - "spec/integration/apartment_rake_integration_spec.rb" + - "spec/unit/migrator_spec.rb" -# Offense count: 4 +# Offense count: 12 +# Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata. +# Include: **/*_spec.rb +RSpec/SpecFilePathFormat: + Exclude: + - "spec/adapters/mysql2_adapter_spec.rb" + - "spec/adapters/postgresql_adapter_spec.rb" + - "spec/adapters/sqlite3_adapter_spec.rb" + - "spec/tenant_spec.rb" + - "spec/unit/config_spec.rb" + - "spec/unit/elevators/domain_spec.rb" + - "spec/unit/elevators/first_subdomain_spec.rb" + - "spec/unit/elevators/generic_spec.rb" + - "spec/unit/elevators/host_hash_spec.rb" + - "spec/unit/elevators/host_spec.rb" + - "spec/unit/elevators/subdomain_spec.rb" + - "spec/unit/migrator_spec.rb" + +# Offense count: 2 # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames. RSpec/VerifiedDoubles: Exclude: - - 'spec/integration/apartment_rake_integration_spec.rb' - - 'spec/unit/elevators/first_subdomain_spec.rb' + - "spec/integration/apartment_rake_integration_spec.rb" + - "spec/unit/elevators/first_subdomain_spec.rb" + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +Rails/IndexWith: + Exclude: + - "lib/apartment.rb" + - "spec/unit/config_spec.rb" + +# Offense count: 7 +# This cop supports unsafe autocorrection (--autocorrect-all). +Rails/Pluck: + Exclude: + - "spec/adapters/jdbc_mysql_adapter_spec.rb" + - "spec/adapters/jdbc_postgresql_adapter_spec.rb" + - "spec/adapters/mysql2_adapter_spec.rb" + - "spec/adapters/postgresql_adapter_spec.rb" -# Offense count: 17 +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Security/IoMethods: + Exclude: + - "spec/support/config.rb" + +# Offense count: 16 +# Configuration parameters: AllowedConstants. Style/Documentation: Exclude: - - 'spec/**/*' - - 'test/**/*' - - 'lib/apartment/adapters/jdbc_mysql_adapter.rb' - - 'lib/apartment/adapters/postgis_adapter.rb' - - 'lib/apartment/adapters/postgresql_adapter.rb' - - 'lib/apartment/adapters/sqlite3_adapter.rb' - - 'lib/apartment/custom_console.rb' - - 'lib/apartment/deprecation.rb' - - 'lib/apartment/migrator.rb' - - 'lib/apartment/model.rb' - - 'lib/apartment/railtie.rb' - - 'lib/apartment/tasks/enhancements.rb' - - 'lib/apartment/tasks/task_helper.rb' - - 'lib/generators/apartment/install/install_generator.rb' + - "lib/apartment/adapters/jdbc_mysql_adapter.rb" + - "lib/apartment/adapters/postgis_adapter.rb" + - "lib/apartment/adapters/postgresql_adapter.rb" + - "lib/apartment/adapters/sqlite3_adapter.rb" + - "lib/apartment/custom_console.rb" + - "lib/apartment/deprecation.rb" + - "lib/apartment/migrator.rb" + - "lib/apartment/model.rb" + - "lib/apartment/railtie.rb" + - "lib/apartment/tasks/enhancements.rb" + - "lib/apartment/tasks/task_helper.rb" + - "lib/generators/apartment/install/install_generator.rb" + - "spec/**/*.rb" + +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowedVars. +Style/FetchEnvVar: + Exclude: + - "lib/apartment/adapters/postgresql_adapter.rb" + +# Offense count: 6 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. +# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys +# SupportedShorthandSyntax: always, never, either, consistent +Style/HashSyntax: + Exclude: + - "lib/apartment/active_record/connection_handling.rb" + - "spec/integration/connection_handling_spec.rb" + +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantConstantBase: + Exclude: + - "spec/apartment_spec.rb" + - "spec/dummy/config.ru" + - "spec/dummy_engine/test/dummy/config.ru" + - "spec/dummy_engine/test/dummy/config/environments/production.rb" + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantRegexpArgument: + Exclude: + - "lib/apartment/tasks/enhancements.rb" + +# Offense count: 3 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength. +# AllowedMethods: present?, blank?, presence, try, try! +Style/SafeNavigation: + Exclude: + - "lib/apartment/migrator.rb" + - "lib/tasks/apartment.rake" + +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline. +# SupportedStyles: single_quotes, double_quotes +Style/StringLiterals: + Exclude: + - "Gemfile" diff --git a/.ruby-version b/.ruby-version index a603bb50..be94e6f5 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.7.5 +3.2.2 diff --git a/Appraisals b/Appraisals index b4c115ce..990aa234 100644 --- a/Appraisals +++ b/Appraisals @@ -1,26 +1,5 @@ # frozen_string_literal: true -appraise 'rails-5-2' do - gem 'rails', '~> 5.2.0' - platforms :jruby do - gem 'activerecord-jdbc-adapter', '~> 52.0' - gem 'activerecord-jdbcpostgresql-adapter', '~> 52.0' - gem 'activerecord-jdbcmysql-adapter', '~> 52.0' - end -end - -appraise 'rails-6-0' do - gem 'rails', '~> 6.0.0' - platforms :ruby do - gem 'sqlite3', '~> 1.4' - end - platforms :jruby do - gem 'activerecord-jdbc-adapter', '~> 60.0' - gem 'activerecord-jdbcpostgresql-adapter', '~> 60.0' - gem 'activerecord-jdbcmysql-adapter', '~> 60.0' - end -end - appraise 'rails-6-1' do gem 'rails', '~> 6.1.0' platforms :ruby do diff --git a/gemfiles/rails_5_2.gemfile b/gemfiles/rails_5_2.gemfile deleted file mode 100644 index e50bd638..00000000 --- a/gemfiles/rails_5_2.gemfile +++ /dev/null @@ -1,13 +0,0 @@ -# This file was generated by Appraisal - -source "http://rubygems.org" - -gem "rails", "~> 5.2.0" - -platforms :jruby do - gem "activerecord-jdbc-adapter", "~> 52.0" - gem "activerecord-jdbcpostgresql-adapter", "~> 52.0" - gem "activerecord-jdbcmysql-adapter", "~> 52.0" -end - -gemspec path: "../" diff --git a/gemfiles/rails_6_0.gemfile b/gemfiles/rails_6_0.gemfile deleted file mode 100644 index 64778099..00000000 --- a/gemfiles/rails_6_0.gemfile +++ /dev/null @@ -1,17 +0,0 @@ -# This file was generated by Appraisal - -source "http://rubygems.org" - -gem "rails", "~> 6.0.0" - -platforms :ruby do - gem "sqlite3", "~> 1.4" -end - -platforms :jruby do - gem "activerecord-jdbc-adapter", "~> 60.0" - gem "activerecord-jdbcpostgresql-adapter", "~> 60.0" - gem "activerecord-jdbcmysql-adapter", "~> 60.0" -end - -gemspec path: "../" diff --git a/lib/apartment/version.rb b/lib/apartment/version.rb index 4a24fa5e..43fef9ab 100644 --- a/lib/apartment/version.rb +++ b/lib/apartment/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Apartment - VERSION = '2.11.0' + VERSION = '2.12.0' end diff --git a/puzzle-apartment.gemspec b/puzzle-apartment.gemspec index 27028dfd..2ea9fd36 100644 --- a/puzzle-apartment.gemspec +++ b/puzzle-apartment.gemspec @@ -27,10 +27,10 @@ Gem::Specification.new do |s| s.homepage = 'https://github.com/puzzle/apartment' s.licenses = ['MIT'] - s.add_dependency 'activerecord', '>= 5.0.0', '< 7.2' - s.add_dependency 'parallel', '< 2.0' - s.add_dependency 'public_suffix', '>= 2.0.5', '< 5.0' - s.add_dependency 'rack', '>= 1.3.6', '< 3.0' + s.add_dependency 'activerecord', '>= 6.1.0', '< 7.2' + s.add_dependency 'parallel', '>= 1.10' + s.add_dependency 'public_suffix', '>= 2.0.5' + s.add_dependency 'rack', '>= 1.3.6' s.add_development_dependency 'appraisal', '~> 2.2' s.add_development_dependency 'bundler', '>= 1.3', '< 3.0' @@ -40,10 +40,10 @@ Gem::Specification.new do |s| s.add_development_dependency 'rspec', '~> 3.4' s.add_development_dependency 'rspec_junit_formatter' s.add_development_dependency 'rspec-rails', '~> 6.0' - s.add_development_dependency 'rubocop', '~> 0.93' - s.add_development_dependency 'rubocop-performance', '~> 1.10' - s.add_development_dependency 'rubocop-rails', '~> 2.1' - s.add_development_dependency 'rubocop-rspec', '~> 1.44' + s.add_development_dependency 'rubocop' + s.add_development_dependency 'rubocop-performance' + s.add_development_dependency 'rubocop-rails' + s.add_development_dependency 'rubocop-rspec' if defined?(JRUBY_VERSION) s.add_development_dependency 'activerecord-jdbc-adapter' diff --git a/spec/examples/schema_adapter_examples.rb b/spec/examples/schema_adapter_examples.rb index 34a1d2f4..aa1a1340 100644 --- a/spec/examples/schema_adapter_examples.rb +++ b/spec/examples/schema_adapter_examples.rb @@ -128,7 +128,6 @@ end end - # rubocop:disable RSpec/MultipleExpectations it 'connects and resets' do subject.switch(schema1) do expect(connection.schema_search_path).to start_with %("#{schema1}") @@ -140,7 +139,6 @@ expect(User.sequence_name).to eq "#{User.table_name}_id_seq" expect(Company.sequence_name).to eq "#{public_schema}.#{Company.table_name}_id_seq" end - # rubocop:enable RSpec/MultipleExpectations it 'allows a list of schemas' do subject.switch([schema1, schema2]) do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index caf2222c..aa0bb2d4 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -42,7 +42,7 @@ config.include Apartment::Spec::Setup # Somewhat brutal hack so that rails 4 postgres extensions don't modify this file - config.after(:all) do + config.after(:all) do # rubocop:disable RSpec/BeforeAfterAll `git checkout -- spec/dummy/db/schema.rb` end