diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 0a21f00..0f147ee 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 with: - ruby-version: 2.7 + ruby-version: 3.2 bundler-cache: true - name: Run Linter run: bundle exec rubocop --parallel diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5157c2a..7bf2d0e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,23 +9,15 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['2.6', '2.7', '3.0', '3.1'] + ruby: ['3.2', '3.3', '3.4'] 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 + - gemfiles/rails_7_2.gemfile + - gemfiles/rails_8_0.gemfile exclude: - - ruby: '3.1' - gemfile: gemfiles/rails_5_2.gemfile - - ruby: '3.0' - gemfile: gemfiles/rails_5_2.gemfile - - ruby: '2.6' + - ruby: '3.4' gemfile: gemfiles/rails_7_0.gemfile - - ruby: '2.6' - gemfile: gemfiles/rails_7_1.gemfile - steps: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 diff --git a/.gitignore b/.gitignore index 08cbf90..3b82491 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,7 @@ .bundle/ .idea/ -Gemfile.lock log/*.log pkg/ spec/examples.txt spec/dummy/log/*.log spec/dummy/tmp/ -/gemfiles/*.gemfile.lock diff --git a/.rubocop.yml b/.rubocop.yml index 204bf21..1794270 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,9 +5,9 @@ inherit_gem: - config/default.yml AllCops: - TargetRubyVersion: 2.6 + TargetRubyVersion: 3.2 NewCops: enable Exclude: - 'spec/dummy/db/**/*' - 'vendor/**/*' - - 'gemfiles/vendor/**/*' + - 'gemfiles/*.gemfile' diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index a71ed07..b8852a4 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 99999` -# on 2023-05-19 18:17:27 UTC using RuboCop version 1.51.0. +# on 2025-01-21 19:47:26 UTC using RuboCop version 1.62.1. # 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 @@ -14,16 +14,57 @@ Gemspec/DevelopmentDependencies: Exclude: - 'journaled.gemspec' -# Offense count: 2 -RSpec/ExpectInHook: +# Offense count: 13 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: with_first_argument, with_fixed_indentation +Layout/ArgumentAlignment: Exclude: - - 'spec/models/concerns/journaled/changes_spec.rb' + - 'app/models/journaled/audit_log/event.rb' + - 'app/models/journaled/change.rb' + +# Offense count: 5 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, IndentOneStep, IndentationWidth. +# SupportedStyles: case, end +Layout/CaseIndentation: + Exclude: + - 'app/models/journaled/audit_log/event.rb' + - 'lib/journaled/relation_change_protection.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyleAlignWith, Severity. +# SupportedStylesAlignWith: keyword, variable, start_of_line +Layout/EndAlignment: + Exclude: + - 'lib/journaled/relation_change_protection.rb' + +# Offense count: 7 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: with_first_parameter, with_fixed_indentation +Layout/ParameterAlignment: + Exclude: + - 'app/models/journaled/change.rb' # Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +Lint/RedundantCopDisableDirective: + Exclude: + - 'lib/journaled/audit_log.rb' + - 'lib/journaled/relation_change_protection.rb' + +# Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). -RSpec/Rails/TravelAround: +Lint/RedundantDirGlobSort: Exclude: - - 'spec/lib/journaled/audit_log_spec.rb' + - 'spec/rails_helper.rb' + +# Offense count: 2 +RSpec/ExpectInHook: + Exclude: + - 'spec/models/concerns/journaled/changes_spec.rb' # Offense count: 2 RSpec/SubjectStub: @@ -38,6 +79,12 @@ RSpec/VerifiedDoubles: - 'spec/models/journaled/actor_uri_provider_spec.rb' - 'spec/models/journaled/change_writer_spec.rb' +# Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). +RSpecRails/TravelAround: + Exclude: + - 'spec/lib/journaled/audit_log_spec.rb' + # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). Rails/IndexWith: @@ -46,10 +93,27 @@ Rails/IndexWith: # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AllowedReceivers. Style/CollectionCompact: Exclude: - 'app/jobs/journaled/delivery_job.rb' +# Offense count: 20 +# 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: + - 'app/jobs/journaled/delivery_job.rb' + - 'app/models/concerns/journaled/changes.rb' + - 'app/models/journaled/change_writer.rb' + - 'app/models/journaled/writer.rb' + - 'lib/journaled/audit_log.rb' + - 'spec/models/journaled/change_writer_spec.rb' + - 'spec/models/journaled/json_schema_model/validator_spec.rb' + - 'spec/models/journaled/writer_spec.rb' + # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). Style/RedundantConstantBase: diff --git a/Appraisals b/Appraisals index 2ac660e..f975d25 100644 --- a/Appraisals +++ b/Appraisals @@ -1,21 +1,22 @@ # frozen_string_literal: true -appraise 'rails-5-2' do - gem 'railties', '~> 5.2.0' -end - -appraise 'rails-6-0' do - gem 'railties', '~> 6.0.0' -end - -appraise 'rails-6-1' do - gem 'railties', '~> 6.1.0' -end - appraise 'rails-7-0' do gem 'railties', '~> 7.0.0' + gem 'concurrent-ruby', '1.3.4' + gem 'sqlite3', '~> 1.4' end appraise 'rails-7-1' do gem 'railties', '~> 7.1.0' + gem 'sqlite3', '>= 1.4' +end + +appraise 'rails-7-2' do + gem 'railties', '~> 7.2.0' + gem 'sqlite3', '>= 1.4' +end + +appraise 'rails-8-0' do + gem 'railties', '~> 8.0.0' + gem 'sqlite3', '>= 2.1' end diff --git a/Gemfile b/Gemfile index 7f4f5e9..2c05c6e 100644 --- a/Gemfile +++ b/Gemfile @@ -3,3 +3,5 @@ source 'https://rubygems.org' gemspec + +gem 'sqlite3', '>= 2.1' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..dac6bed --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,258 @@ +PATH + remote: . + specs: + journaled (6.0.0) + activejob + activerecord + activesupport + aws-sdk-kinesis (< 2) + json-schema + railties (>= 7.0, < 8.1) + +GEM + remote: https://rubygems.org/ + specs: + actionpack (8.0.1) + actionview (= 8.0.1) + activesupport (= 8.0.1) + nokogiri (>= 1.8.5) + rack (>= 2.2.4) + rack-session (>= 1.0.1) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actionview (8.0.1) + activesupport (= 8.0.1) + builder (~> 3.1) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (8.0.1) + activesupport (= 8.0.1) + globalid (>= 0.3.6) + activemodel (8.0.1) + activesupport (= 8.0.1) + activerecord (8.0.1) + activemodel (= 8.0.1) + activesupport (= 8.0.1) + timeout (>= 0.4.0) + activesupport (8.0.1) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + appraisal (2.5.0) + bundler + rake + thor (>= 0.14.0) + ast (2.4.2) + aws-eventstream (1.3.0) + aws-partitions (1.1040.0) + aws-sdk-core (3.216.0) + aws-eventstream (~> 1, >= 1.3.0) + aws-partitions (~> 1, >= 1.992.0) + aws-sigv4 (~> 1.9) + jmespath (~> 1, >= 1.6.1) + aws-sdk-kinesis (1.72.0) + aws-sdk-core (~> 3, >= 3.216.0) + aws-sigv4 (~> 1.5) + aws-sigv4 (1.11.0) + aws-eventstream (~> 1, >= 1.0.2) + base64 (0.2.0) + benchmark (0.4.0) + betterlint (1.16.0) + rubocop (~> 1.62.0) + rubocop-graphql (~> 1.5.0) + rubocop-performance (~> 1.21.0) + rubocop-rails (~> 2.24.0) + rubocop-rake (~> 0.6.0) + rubocop-rspec (~> 2.28.0) + bigdecimal (3.1.9) + builder (3.3.0) + concurrent-ruby (1.3.5) + connection_pool (2.5.0) + crack (1.0.0) + bigdecimal + rexml + crass (1.0.6) + date (3.4.1) + diff-lcs (1.5.1) + drb (2.2.1) + erubi (1.13.1) + globalid (1.2.1) + activesupport (>= 6.1) + hashdiff (1.1.2) + i18n (1.14.7) + concurrent-ruby (~> 1.0) + io-console (0.8.0) + irb (1.15.0) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + jmespath (1.6.2) + json (2.9.1) + json-schema (5.1.1) + addressable (~> 2.8) + bigdecimal (~> 3.1) + language_server-protocol (3.17.0.3) + logger (1.6.5) + loofah (2.24.0) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + minitest (5.25.4) + nokogiri (1.18.2-arm64-darwin) + racc (~> 1.4) + nokogiri (1.18.2-x86_64-linux-gnu) + racc (~> 1.4) + parallel (1.26.3) + parser (3.3.7.0) + ast (~> 2.4.1) + racc + pp (0.6.2) + prettyprint + prettyprint (0.2.0) + psych (5.2.3) + date + stringio + public_suffix (6.0.1) + racc (1.8.1) + rack (3.1.8) + rack-session (2.1.0) + base64 (>= 0.1.0) + rack (>= 3.0.0) + rack-test (2.2.0) + rack (>= 1.3) + rackup (2.2.1) + rack (>= 3) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.2) + loofah (~> 2.21) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + railties (8.0.1) + actionpack (= 8.0.1) + activesupport (= 8.0.1) + irb (~> 1.13) + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) + rainbow (3.1.1) + rake (13.2.1) + rdoc (6.11.0) + psych (>= 4.0.0) + regexp_parser (2.10.0) + reline (0.6.0) + io-console (~> 0.5) + rexml (3.4.0) + rspec-core (3.13.2) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.3) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-rails (7.1.0) + actionpack (>= 7.0) + activesupport (>= 7.0) + railties (>= 7.0) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.2) + rspec_junit_formatter (0.6.0) + rspec-core (>= 2, < 4, != 2.12.0) + rubocop (1.62.1) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.31.1, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.37.0) + parser (>= 3.3.1.0) + rubocop-capybara (2.21.0) + rubocop (~> 1.41) + rubocop-factory_bot (2.26.1) + rubocop (~> 1.61) + rubocop-graphql (1.5.4) + rubocop (>= 1.50, < 2) + rubocop-performance (1.21.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails (2.24.1) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rake (0.6.0) + rubocop (~> 1.0) + rubocop-rspec (2.28.0) + rubocop (~> 1.40) + rubocop-capybara (~> 2.17) + rubocop-factory_bot (~> 2.22) + rubocop-rspec_rails (~> 2.28) + rubocop-rspec_rails (2.29.1) + rubocop (~> 1.61) + ruby-progressbar (1.13.0) + securerandom (0.4.1) + spring (4.2.1) + spring-commands-rspec (1.0.4) + spring (>= 0.9.1) + sqlite3 (2.5.0-arm64-darwin) + sqlite3 (2.5.0-x86_64-linux-gnu) + stringio (3.1.2) + thor (1.3.2) + timecop (0.9.10) + timeout (0.4.3) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + uncruft (0.5.0) + railties (>= 6.1.0) + unicode-display_width (2.6.0) + uri (1.0.2) + useragent (0.16.11) + webmock (3.24.0) + addressable (>= 2.8.0) + crack (>= 0.3.2) + hashdiff (>= 0.4.0, < 2.0.0) + zeitwerk (2.7.1) + +PLATFORMS + arm64-darwin + x86_64-linux + +DEPENDENCIES + appraisal + betterlint + journaled! + rspec-rails + rspec_junit_formatter + spring + spring-commands-rspec + sqlite3 (>= 2.1) + timecop + uncruft + webmock + +BUNDLED WITH + 2.6.3 diff --git a/README.md b/README.md index d34b73a..55d6d76 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,21 @@ to use one of the following queue adapters: `ActiveJob::Base.queue_adapter` is not in the above list, it will raise an exception and prevent your application from performing unsafe journaling.** + The following configurations are __not supported__ by Journaled: + + ```ruby + config.active_job.enqueue_after_transaction_commit = :always + config.active_job.enqueue_after_transaction_commit = true + ``` + + If you're using Rails 7.2 with the `:test` adapter, please use the following configuration: + + ```ruby + config.active_job.enqueue_after_transaction_commit = :never + ``` + + This configuration isn't necessary for applications running Rails 8+. + 2. To integrate Journaled into your application, simply include the gem in your app's Gemfile. @@ -91,7 +106,7 @@ app's Gemfile. Journaling provides a number of different configuation options that can be set in Ruby using an initializer. Those values are: -#### `Journaled.default_stream_name ` +#### `Journaled.default_stream_name` This is described in the "Installation" section above, and is used to specify which stream name to use. diff --git a/Rakefile b/Rakefile index 6080c6d..e32a003 100644 --- a/Rakefile +++ b/Rakefile @@ -8,6 +8,9 @@ end Bundler::GemHelper.install_tasks +APP_RAKEFILE = File.expand_path('spec/dummy/Rakefile', __dir__) +load 'rails/tasks/engine.rake' + require 'rubocop/rake_task' RuboCop::RakeTask.new diff --git a/app/jobs/journaled/delivery_job.rb b/app/jobs/journaled/delivery_job.rb index 77e6cf8..d4a2418 100644 --- a/app/jobs/journaled/delivery_job.rb +++ b/app/jobs/journaled/delivery_job.rb @@ -14,8 +14,7 @@ class DeliveryJob < ApplicationJob raise KinesisTemporaryFailure end - def perform(*events, **legacy_kwargs) - events << legacy_kwargs if legacy_kwargs.present? + def perform(*events) @kinesis_records = events.map { |e| KinesisRecord.new(**e.delete_if { |_k, v| v.nil? }) } journal! if Journaled.enabled? diff --git a/app/models/concerns/journaled/changes.rb b/app/models/concerns/journaled/changes.rb index 16f536d..8e1bb40 100644 --- a/app/models/concerns/journaled/changes.rb +++ b/app/models/concerns/journaled/changes.rb @@ -27,34 +27,32 @@ module Journaled::Changes end end - if Rails::VERSION::MAJOR > 5 || (Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR >= 2) - def delete(force: false) - if force || self.class.journaled_attribute_names.empty? - super() - else - raise(<<~ERROR) - #delete aborted by Journaled::Changes. + def delete(force: false) + if force || self.class.journaled_attribute_names.empty? + super() + else + raise(<<~ERROR) + #delete aborted by Journaled::Changes. - Call #destroy instead to ensure journaling or invoke #delete(force: true) - to override and skip journaling. - ERROR - end + Call #destroy instead to ensure journaling or invoke #delete(force: true) + to override and skip journaling. + ERROR end + end - def update_columns(attributes, opts = { force: false }) - unless opts[:force] || self.class.journaled_attribute_names.empty? - conflicting_journaled_attribute_names = self.class.journaled_attribute_names & attributes.keys.map(&:to_sym) - raise(<<~ERROR) if conflicting_journaled_attribute_names.present? - #update_columns aborted by Journaled::Changes due to journaled attributes: + def update_columns(attributes, opts = { force: false }) + unless opts[:force] || self.class.journaled_attribute_names.empty? + conflicting_journaled_attribute_names = self.class.journaled_attribute_names & attributes.keys.map(&:to_sym) + raise(<<~ERROR) if conflicting_journaled_attribute_names.present? + #update_columns aborted by Journaled::Changes due to journaled attributes: - #{conflicting_journaled_attribute_names.join(', ')} + #{conflicting_journaled_attribute_names.join(', ')} - Call #update instead to ensure journaling or invoke #update_columns - with additional arg `{ force: true }` to override and skip journaling. - ERROR - end - super(attributes) + Call #update instead to ensure journaling or invoke #update_columns + with additional arg `{ force: true }` to override and skip journaling. + ERROR end + super(attributes) end class_methods do @@ -70,18 +68,16 @@ def journal_changes_to(*attribute_names, as:, enqueue_with: {}) journaled_enqueue_opts.merge!(enqueue_with) end - if Rails::VERSION::MAJOR > 5 || (Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR >= 2) - def delete(id_or_array, opts = { force: false }) - if opts[:force] || journaled_attribute_names.empty? - where(primary_key => id_or_array).delete_all(force: true) - else - raise(<<~ERROR) - .delete aborted by Journaled::Changes. + def delete(id_or_array, opts = { force: false }) + if opts[:force] || journaled_attribute_names.empty? + where(primary_key => id_or_array).delete_all(force: true) + else + raise(<<~ERROR) + .delete aborted by Journaled::Changes. - Call .destroy(id_or_array) instead to ensure journaling or invoke - .delete(id_or_array, force: true) to override and skip journaling. - ERROR - end + Call .destroy(id_or_array) instead to ensure journaling or invoke + .delete(id_or_array, force: true) to override and skip journaling. + ERROR end end end diff --git a/app/models/journaled/audit_log/event.rb b/app/models/journaled/audit_log/event.rb index 5143468..84cadea 100644 --- a/app/models/journaled/audit_log/event.rb +++ b/app/models/journaled/audit_log/event.rb @@ -75,8 +75,7 @@ def filter_key?(key) end def encrypted_column?(key) - key.to_s.end_with?('_crypt', '_hmac') || - (Rails::VERSION::MAJOR >= 7 && record.encrypted_attribute?(key)) + key.to_s.end_with?('_crypt', '_hmac') || record.encrypted_attribute?(key) end def filter_params diff --git a/bin/rails b/bin/rails index dd63bec..b34e933 100755 --- a/bin/rails +++ b/bin/rails @@ -1,14 +1,10 @@ #!/usr/bin/env ruby # frozen_string_literal: true -# This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application. - ENGINE_ROOT = File.expand_path('..', __dir__) ENGINE_PATH = File.expand_path('../lib/journaled/engine', __dir__) +APP_PATH = File.expand_path('../spec/dummy/config/application', __dir__) -# Set up gems listed in the Gemfile. -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) -require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) - +require 'bundler/setup' require 'rails/all' require 'rails/engine/commands' diff --git a/config/initializers/change_protection.rb b/config/initializers/change_protection.rb index 2764534..a38d77f 100644 --- a/config/initializers/change_protection.rb +++ b/config/initializers/change_protection.rb @@ -1,6 +1,4 @@ # frozen_string_literal: true -if Rails::VERSION::MAJOR > 5 || (Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR >= 2) - require 'journaled/relation_change_protection' - ActiveRecord::Relation.class_eval { prepend Journaled::RelationChangeProtection } -end +require 'journaled/relation_change_protection' +ActiveRecord::Relation.class_eval { prepend Journaled::RelationChangeProtection } diff --git a/gemfiles/rails_6_1.gemfile b/gemfiles/rails_6_1.gemfile deleted file mode 100644 index 087e991..0000000 --- a/gemfiles/rails_6_1.gemfile +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "railties", "~> 6.1.0" - -gemspec path: "../" diff --git a/gemfiles/rails_7_0.gemfile b/gemfiles/rails_7_0.gemfile index 52cdeee..d823ff4 100644 --- a/gemfiles/rails_7_0.gemfile +++ b/gemfiles/rails_7_0.gemfile @@ -1,9 +1,9 @@ -# frozen_string_literal: true - # This file was generated by Appraisal source "https://rubygems.org" +gem "sqlite3", "~> 1.4" gem "railties", "~> 7.0.0" +gem "concurrent-ruby", "1.3.4" gemspec path: "../" diff --git a/gemfiles/rails_7_0.gemfile.lock b/gemfiles/rails_7_0.gemfile.lock new file mode 100644 index 0000000..af38f6b --- /dev/null +++ b/gemfiles/rails_7_0.gemfile.lock @@ -0,0 +1,217 @@ +PATH + remote: .. + specs: + journaled (6.0.0) + activejob + activerecord + activesupport + aws-sdk-kinesis (< 2) + json-schema + railties (>= 7.0, < 8.1) + +GEM + remote: https://rubygems.org/ + specs: + actionpack (7.0.8.7) + actionview (= 7.0.8.7) + activesupport (= 7.0.8.7) + rack (~> 2.0, >= 2.2.4) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actionview (7.0.8.7) + activesupport (= 7.0.8.7) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (7.0.8.7) + activesupport (= 7.0.8.7) + globalid (>= 0.3.6) + activemodel (7.0.8.7) + activesupport (= 7.0.8.7) + activerecord (7.0.8.7) + activemodel (= 7.0.8.7) + activesupport (= 7.0.8.7) + activesupport (7.0.8.7) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + appraisal (2.5.0) + bundler + rake + thor (>= 0.14.0) + ast (2.4.2) + aws-eventstream (1.3.0) + aws-partitions (1.1040.0) + aws-sdk-core (3.216.0) + aws-eventstream (~> 1, >= 1.3.0) + aws-partitions (~> 1, >= 1.992.0) + aws-sigv4 (~> 1.9) + jmespath (~> 1, >= 1.6.1) + aws-sdk-kinesis (1.72.0) + aws-sdk-core (~> 3, >= 3.216.0) + aws-sigv4 (~> 1.5) + aws-sigv4 (1.11.0) + aws-eventstream (~> 1, >= 1.0.2) + betterlint (1.16.0) + rubocop (~> 1.62.0) + rubocop-graphql (~> 1.5.0) + rubocop-performance (~> 1.21.0) + rubocop-rails (~> 2.24.0) + rubocop-rake (~> 0.6.0) + rubocop-rspec (~> 2.28.0) + bigdecimal (3.1.9) + builder (3.3.0) + concurrent-ruby (1.3.4) + crack (1.0.0) + bigdecimal + rexml + crass (1.0.6) + diff-lcs (1.5.1) + erubi (1.13.1) + globalid (1.2.1) + activesupport (>= 6.1) + hashdiff (1.1.2) + i18n (1.14.7) + concurrent-ruby (~> 1.0) + jmespath (1.6.2) + json (2.9.1) + json-schema (5.1.1) + addressable (~> 2.8) + bigdecimal (~> 3.1) + language_server-protocol (3.17.0.3) + loofah (2.24.0) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + method_source (1.1.0) + minitest (5.25.4) + nokogiri (1.18.2-arm64-darwin) + racc (~> 1.4) + nokogiri (1.18.2-x86_64-linux-gnu) + racc (~> 1.4) + parallel (1.26.3) + parser (3.3.7.0) + ast (~> 2.4.1) + racc + public_suffix (6.0.1) + racc (1.8.1) + rack (2.2.10) + rack-test (2.2.0) + rack (>= 1.3) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.2) + loofah (~> 2.21) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + railties (7.0.8.7) + actionpack (= 7.0.8.7) + activesupport (= 7.0.8.7) + method_source + rake (>= 12.2) + thor (~> 1.0) + zeitwerk (~> 2.5) + rainbow (3.1.1) + rake (13.2.1) + regexp_parser (2.10.0) + rexml (3.4.0) + rspec-core (3.13.2) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.3) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-rails (7.1.0) + actionpack (>= 7.0) + activesupport (>= 7.0) + railties (>= 7.0) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.2) + rspec_junit_formatter (0.6.0) + rspec-core (>= 2, < 4, != 2.12.0) + rubocop (1.62.1) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.31.1, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.37.0) + parser (>= 3.3.1.0) + rubocop-capybara (2.21.0) + rubocop (~> 1.41) + rubocop-factory_bot (2.26.1) + rubocop (~> 1.61) + rubocop-graphql (1.5.4) + rubocop (>= 1.50, < 2) + rubocop-performance (1.21.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails (2.24.1) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rake (0.6.0) + rubocop (~> 1.0) + rubocop-rspec (2.28.0) + rubocop (~> 1.40) + rubocop-capybara (~> 2.17) + rubocop-factory_bot (~> 2.22) + rubocop-rspec_rails (~> 2.28) + rubocop-rspec_rails (2.29.1) + rubocop (~> 1.61) + ruby-progressbar (1.13.0) + spring (4.2.1) + spring-commands-rspec (1.0.4) + spring (>= 0.9.1) + sqlite3 (1.7.3-arm64-darwin) + sqlite3 (1.7.3-x86_64-linux) + thor (1.3.2) + timecop (0.9.10) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + uncruft (0.5.0) + railties (>= 6.1.0) + unicode-display_width (2.6.0) + webmock (3.24.0) + addressable (>= 2.8.0) + crack (>= 0.3.2) + hashdiff (>= 0.4.0, < 2.0.0) + zeitwerk (2.7.1) + +PLATFORMS + arm64-darwin + x86_64-linux + +DEPENDENCIES + appraisal + betterlint + concurrent-ruby (= 1.3.4) + journaled! + railties (~> 7.0.0) + rspec-rails + rspec_junit_formatter + spring + spring-commands-rspec + sqlite3 (~> 1.4) + timecop + uncruft + webmock + +BUNDLED WITH + 2.6.3 diff --git a/gemfiles/rails_7_1.gemfile b/gemfiles/rails_7_1.gemfile index a68d818..3c3235e 100644 --- a/gemfiles/rails_7_1.gemfile +++ b/gemfiles/rails_7_1.gemfile @@ -1,9 +1,8 @@ -# frozen_string_literal: true - # This file was generated by Appraisal source "https://rubygems.org" +gem "sqlite3", ">= 1.4" gem "railties", "~> 7.1.0" gemspec path: "../" diff --git a/gemfiles/rails_7_1.gemfile.lock b/gemfiles/rails_7_1.gemfile.lock new file mode 100644 index 0000000..6309840 --- /dev/null +++ b/gemfiles/rails_7_1.gemfile.lock @@ -0,0 +1,258 @@ +PATH + remote: .. + specs: + journaled (6.0.0) + activejob + activerecord + activesupport + aws-sdk-kinesis (< 2) + json-schema + railties (>= 7.0, < 8.1) + +GEM + remote: https://rubygems.org/ + specs: + actionpack (7.1.5.1) + actionview (= 7.1.5.1) + activesupport (= 7.1.5.1) + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4) + rack-session (>= 1.0.1) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + actionview (7.1.5.1) + activesupport (= 7.1.5.1) + builder (~> 3.1) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.1.5.1) + activesupport (= 7.1.5.1) + globalid (>= 0.3.6) + activemodel (7.1.5.1) + activesupport (= 7.1.5.1) + activerecord (7.1.5.1) + activemodel (= 7.1.5.1) + activesupport (= 7.1.5.1) + timeout (>= 0.4.0) + activesupport (7.1.5.1) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + mutex_m + securerandom (>= 0.3) + tzinfo (~> 2.0) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + appraisal (2.5.0) + bundler + rake + thor (>= 0.14.0) + ast (2.4.2) + aws-eventstream (1.3.0) + aws-partitions (1.1040.0) + aws-sdk-core (3.216.0) + aws-eventstream (~> 1, >= 1.3.0) + aws-partitions (~> 1, >= 1.992.0) + aws-sigv4 (~> 1.9) + jmespath (~> 1, >= 1.6.1) + aws-sdk-kinesis (1.72.0) + aws-sdk-core (~> 3, >= 3.216.0) + aws-sigv4 (~> 1.5) + aws-sigv4 (1.11.0) + aws-eventstream (~> 1, >= 1.0.2) + base64 (0.2.0) + benchmark (0.4.0) + betterlint (1.16.0) + rubocop (~> 1.62.0) + rubocop-graphql (~> 1.5.0) + rubocop-performance (~> 1.21.0) + rubocop-rails (~> 2.24.0) + rubocop-rake (~> 0.6.0) + rubocop-rspec (~> 2.28.0) + bigdecimal (3.1.9) + builder (3.3.0) + concurrent-ruby (1.3.5) + connection_pool (2.5.0) + crack (1.0.0) + bigdecimal + rexml + crass (1.0.6) + date (3.4.1) + diff-lcs (1.5.1) + drb (2.2.1) + erubi (1.13.1) + globalid (1.2.1) + activesupport (>= 6.1) + hashdiff (1.1.2) + i18n (1.14.7) + concurrent-ruby (~> 1.0) + io-console (0.8.0) + irb (1.15.0) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + jmespath (1.6.2) + json (2.9.1) + json-schema (5.1.1) + addressable (~> 2.8) + bigdecimal (~> 3.1) + language_server-protocol (3.17.0.3) + logger (1.6.5) + loofah (2.24.0) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + minitest (5.25.4) + mutex_m (0.3.0) + nokogiri (1.18.2-arm64-darwin) + racc (~> 1.4) + nokogiri (1.18.2-x86_64-linux-gnu) + racc (~> 1.4) + parallel (1.26.3) + parser (3.3.7.0) + ast (~> 2.4.1) + racc + pp (0.6.2) + prettyprint + prettyprint (0.2.0) + psych (5.2.3) + date + stringio + public_suffix (6.0.1) + racc (1.8.1) + rack (3.1.8) + rack-session (2.1.0) + base64 (>= 0.1.0) + rack (>= 3.0.0) + rack-test (2.2.0) + rack (>= 1.3) + rackup (2.2.1) + rack (>= 3) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.2) + loofah (~> 2.21) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + railties (7.1.5.1) + actionpack (= 7.1.5.1) + activesupport (= 7.1.5.1) + irb + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) + rainbow (3.1.1) + rake (13.2.1) + rdoc (6.11.0) + psych (>= 4.0.0) + regexp_parser (2.10.0) + reline (0.6.0) + io-console (~> 0.5) + rexml (3.4.0) + rspec-core (3.13.2) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.3) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-rails (7.1.0) + actionpack (>= 7.0) + activesupport (>= 7.0) + railties (>= 7.0) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.2) + rspec_junit_formatter (0.6.0) + rspec-core (>= 2, < 4, != 2.12.0) + rubocop (1.62.1) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.31.1, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.37.0) + parser (>= 3.3.1.0) + rubocop-capybara (2.21.0) + rubocop (~> 1.41) + rubocop-factory_bot (2.26.1) + rubocop (~> 1.61) + rubocop-graphql (1.5.4) + rubocop (>= 1.50, < 2) + rubocop-performance (1.21.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails (2.24.1) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rake (0.6.0) + rubocop (~> 1.0) + rubocop-rspec (2.28.0) + rubocop (~> 1.40) + rubocop-capybara (~> 2.17) + rubocop-factory_bot (~> 2.22) + rubocop-rspec_rails (~> 2.28) + rubocop-rspec_rails (2.29.1) + rubocop (~> 1.61) + ruby-progressbar (1.13.0) + securerandom (0.4.1) + spring (4.2.1) + spring-commands-rspec (1.0.4) + spring (>= 0.9.1) + sqlite3 (2.5.0-arm64-darwin) + sqlite3 (2.5.0-x86_64-linux-gnu) + stringio (3.1.2) + thor (1.3.2) + timecop (0.9.10) + timeout (0.4.3) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + uncruft (0.5.0) + railties (>= 6.1.0) + unicode-display_width (2.6.0) + webmock (3.24.0) + addressable (>= 2.8.0) + crack (>= 0.3.2) + hashdiff (>= 0.4.0, < 2.0.0) + zeitwerk (2.7.1) + +PLATFORMS + arm64-darwin + x86_64-linux + +DEPENDENCIES + appraisal + betterlint + journaled! + railties (~> 7.1.0) + rspec-rails + rspec_junit_formatter + spring + spring-commands-rspec + sqlite3 (>= 1.4) + timecop + uncruft + webmock + +BUNDLED WITH + 2.6.3 diff --git a/gemfiles/rails_5_2.gemfile b/gemfiles/rails_7_2.gemfile similarity index 61% rename from gemfiles/rails_5_2.gemfile rename to gemfiles/rails_7_2.gemfile index c8fd593..b40c772 100644 --- a/gemfiles/rails_5_2.gemfile +++ b/gemfiles/rails_7_2.gemfile @@ -1,9 +1,8 @@ -# frozen_string_literal: true - # This file was generated by Appraisal source "https://rubygems.org" -gem "railties", "~> 5.2.0" +gem "sqlite3", ">= 1.4" +gem "railties", "~> 7.2.0" gemspec path: "../" diff --git a/gemfiles/rails_7_2.gemfile.lock b/gemfiles/rails_7_2.gemfile.lock new file mode 100644 index 0000000..5a95e84 --- /dev/null +++ b/gemfiles/rails_7_2.gemfile.lock @@ -0,0 +1,258 @@ +PATH + remote: .. + specs: + journaled (6.0.0) + activejob + activerecord + activesupport + aws-sdk-kinesis (< 2) + json-schema + railties (>= 7.0, < 8.1) + +GEM + remote: https://rubygems.org/ + specs: + actionpack (7.2.2.1) + actionview (= 7.2.2.1) + activesupport (= 7.2.2.1) + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4, < 3.2) + rack-session (>= 1.0.1) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actionview (7.2.2.1) + activesupport (= 7.2.2.1) + builder (~> 3.1) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.2.2.1) + activesupport (= 7.2.2.1) + globalid (>= 0.3.6) + activemodel (7.2.2.1) + activesupport (= 7.2.2.1) + activerecord (7.2.2.1) + activemodel (= 7.2.2.1) + activesupport (= 7.2.2.1) + timeout (>= 0.4.0) + activesupport (7.2.2.1) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + appraisal (2.5.0) + bundler + rake + thor (>= 0.14.0) + ast (2.4.2) + aws-eventstream (1.3.0) + aws-partitions (1.1040.0) + aws-sdk-core (3.216.0) + aws-eventstream (~> 1, >= 1.3.0) + aws-partitions (~> 1, >= 1.992.0) + aws-sigv4 (~> 1.9) + jmespath (~> 1, >= 1.6.1) + aws-sdk-kinesis (1.72.0) + aws-sdk-core (~> 3, >= 3.216.0) + aws-sigv4 (~> 1.5) + aws-sigv4 (1.11.0) + aws-eventstream (~> 1, >= 1.0.2) + base64 (0.2.0) + benchmark (0.4.0) + betterlint (1.16.0) + rubocop (~> 1.62.0) + rubocop-graphql (~> 1.5.0) + rubocop-performance (~> 1.21.0) + rubocop-rails (~> 2.24.0) + rubocop-rake (~> 0.6.0) + rubocop-rspec (~> 2.28.0) + bigdecimal (3.1.9) + builder (3.3.0) + concurrent-ruby (1.3.5) + connection_pool (2.5.0) + crack (1.0.0) + bigdecimal + rexml + crass (1.0.6) + date (3.4.1) + diff-lcs (1.5.1) + drb (2.2.1) + erubi (1.13.1) + globalid (1.2.1) + activesupport (>= 6.1) + hashdiff (1.1.2) + i18n (1.14.7) + concurrent-ruby (~> 1.0) + io-console (0.8.0) + irb (1.15.0) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + jmespath (1.6.2) + json (2.9.1) + json-schema (5.1.1) + addressable (~> 2.8) + bigdecimal (~> 3.1) + language_server-protocol (3.17.0.3) + logger (1.6.5) + loofah (2.24.0) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + minitest (5.25.4) + nokogiri (1.18.2-arm64-darwin) + racc (~> 1.4) + nokogiri (1.18.2-x86_64-linux-gnu) + racc (~> 1.4) + parallel (1.26.3) + parser (3.3.7.0) + ast (~> 2.4.1) + racc + pp (0.6.2) + prettyprint + prettyprint (0.2.0) + psych (5.2.3) + date + stringio + public_suffix (6.0.1) + racc (1.8.1) + rack (3.1.8) + rack-session (2.1.0) + base64 (>= 0.1.0) + rack (>= 3.0.0) + rack-test (2.2.0) + rack (>= 1.3) + rackup (2.2.1) + rack (>= 3) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.2) + loofah (~> 2.21) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + railties (7.2.2.1) + actionpack (= 7.2.2.1) + activesupport (= 7.2.2.1) + irb (~> 1.13) + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) + rainbow (3.1.1) + rake (13.2.1) + rdoc (6.11.0) + psych (>= 4.0.0) + regexp_parser (2.10.0) + reline (0.6.0) + io-console (~> 0.5) + rexml (3.4.0) + rspec-core (3.13.2) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.3) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-rails (7.1.0) + actionpack (>= 7.0) + activesupport (>= 7.0) + railties (>= 7.0) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.2) + rspec_junit_formatter (0.6.0) + rspec-core (>= 2, < 4, != 2.12.0) + rubocop (1.62.1) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.31.1, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.37.0) + parser (>= 3.3.1.0) + rubocop-capybara (2.21.0) + rubocop (~> 1.41) + rubocop-factory_bot (2.26.1) + rubocop (~> 1.61) + rubocop-graphql (1.5.4) + rubocop (>= 1.50, < 2) + rubocop-performance (1.21.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails (2.24.1) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rake (0.6.0) + rubocop (~> 1.0) + rubocop-rspec (2.28.0) + rubocop (~> 1.40) + rubocop-capybara (~> 2.17) + rubocop-factory_bot (~> 2.22) + rubocop-rspec_rails (~> 2.28) + rubocop-rspec_rails (2.29.1) + rubocop (~> 1.61) + ruby-progressbar (1.13.0) + securerandom (0.4.1) + spring (4.2.1) + spring-commands-rspec (1.0.4) + spring (>= 0.9.1) + sqlite3 (2.5.0-arm64-darwin) + sqlite3 (2.5.0-x86_64-linux-gnu) + stringio (3.1.2) + thor (1.3.2) + timecop (0.9.10) + timeout (0.4.3) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + uncruft (0.5.0) + railties (>= 6.1.0) + unicode-display_width (2.6.0) + useragent (0.16.11) + webmock (3.24.0) + addressable (>= 2.8.0) + crack (>= 0.3.2) + hashdiff (>= 0.4.0, < 2.0.0) + zeitwerk (2.7.1) + +PLATFORMS + arm64-darwin + x86_64-linux + +DEPENDENCIES + appraisal + betterlint + journaled! + railties (~> 7.2.0) + rspec-rails + rspec_junit_formatter + spring + spring-commands-rspec + sqlite3 (>= 1.4) + timecop + uncruft + webmock + +BUNDLED WITH + 2.6.3 diff --git a/gemfiles/rails_6_0.gemfile b/gemfiles/rails_8_0.gemfile similarity index 61% rename from gemfiles/rails_6_0.gemfile rename to gemfiles/rails_8_0.gemfile index 55af0bd..a1575fb 100644 --- a/gemfiles/rails_6_0.gemfile +++ b/gemfiles/rails_8_0.gemfile @@ -1,9 +1,8 @@ -# frozen_string_literal: true - # This file was generated by Appraisal source "https://rubygems.org" -gem "railties", "~> 6.0.0" +gem "sqlite3", ">= 2.1" +gem "railties", "~> 8.0.0" gemspec path: "../" diff --git a/gemfiles/rails_8_0.gemfile.lock b/gemfiles/rails_8_0.gemfile.lock new file mode 100644 index 0000000..44803e2 --- /dev/null +++ b/gemfiles/rails_8_0.gemfile.lock @@ -0,0 +1,259 @@ +PATH + remote: .. + specs: + journaled (6.0.0) + activejob + activerecord + activesupport + aws-sdk-kinesis (< 2) + json-schema + railties (>= 7.0, < 8.1) + +GEM + remote: https://rubygems.org/ + specs: + actionpack (8.0.1) + actionview (= 8.0.1) + activesupport (= 8.0.1) + nokogiri (>= 1.8.5) + rack (>= 2.2.4) + rack-session (>= 1.0.1) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actionview (8.0.1) + activesupport (= 8.0.1) + builder (~> 3.1) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (8.0.1) + activesupport (= 8.0.1) + globalid (>= 0.3.6) + activemodel (8.0.1) + activesupport (= 8.0.1) + activerecord (8.0.1) + activemodel (= 8.0.1) + activesupport (= 8.0.1) + timeout (>= 0.4.0) + activesupport (8.0.1) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + appraisal (2.5.0) + bundler + rake + thor (>= 0.14.0) + ast (2.4.2) + aws-eventstream (1.3.0) + aws-partitions (1.1040.0) + aws-sdk-core (3.216.0) + aws-eventstream (~> 1, >= 1.3.0) + aws-partitions (~> 1, >= 1.992.0) + aws-sigv4 (~> 1.9) + jmespath (~> 1, >= 1.6.1) + aws-sdk-kinesis (1.72.0) + aws-sdk-core (~> 3, >= 3.216.0) + aws-sigv4 (~> 1.5) + aws-sigv4 (1.11.0) + aws-eventstream (~> 1, >= 1.0.2) + base64 (0.2.0) + benchmark (0.4.0) + betterlint (1.16.0) + rubocop (~> 1.62.0) + rubocop-graphql (~> 1.5.0) + rubocop-performance (~> 1.21.0) + rubocop-rails (~> 2.24.0) + rubocop-rake (~> 0.6.0) + rubocop-rspec (~> 2.28.0) + bigdecimal (3.1.9) + builder (3.3.0) + concurrent-ruby (1.3.5) + connection_pool (2.5.0) + crack (1.0.0) + bigdecimal + rexml + crass (1.0.6) + date (3.4.1) + diff-lcs (1.5.1) + drb (2.2.1) + erubi (1.13.1) + globalid (1.2.1) + activesupport (>= 6.1) + hashdiff (1.1.2) + i18n (1.14.7) + concurrent-ruby (~> 1.0) + io-console (0.8.0) + irb (1.15.0) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + jmespath (1.6.2) + json (2.9.1) + json-schema (5.1.1) + addressable (~> 2.8) + bigdecimal (~> 3.1) + language_server-protocol (3.17.0.3) + logger (1.6.5) + loofah (2.24.0) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + minitest (5.25.4) + nokogiri (1.18.2-arm64-darwin) + racc (~> 1.4) + nokogiri (1.18.2-x86_64-linux-gnu) + racc (~> 1.4) + parallel (1.26.3) + parser (3.3.7.0) + ast (~> 2.4.1) + racc + pp (0.6.2) + prettyprint + prettyprint (0.2.0) + psych (5.2.3) + date + stringio + public_suffix (6.0.1) + racc (1.8.1) + rack (3.1.8) + rack-session (2.1.0) + base64 (>= 0.1.0) + rack (>= 3.0.0) + rack-test (2.2.0) + rack (>= 1.3) + rackup (2.2.1) + rack (>= 3) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.2) + loofah (~> 2.21) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + railties (8.0.1) + actionpack (= 8.0.1) + activesupport (= 8.0.1) + irb (~> 1.13) + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) + rainbow (3.1.1) + rake (13.2.1) + rdoc (6.11.0) + psych (>= 4.0.0) + regexp_parser (2.10.0) + reline (0.6.0) + io-console (~> 0.5) + rexml (3.4.0) + rspec-core (3.13.2) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.3) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-rails (7.1.0) + actionpack (>= 7.0) + activesupport (>= 7.0) + railties (>= 7.0) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.2) + rspec_junit_formatter (0.6.0) + rspec-core (>= 2, < 4, != 2.12.0) + rubocop (1.62.1) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.31.1, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.37.0) + parser (>= 3.3.1.0) + rubocop-capybara (2.21.0) + rubocop (~> 1.41) + rubocop-factory_bot (2.26.1) + rubocop (~> 1.61) + rubocop-graphql (1.5.4) + rubocop (>= 1.50, < 2) + rubocop-performance (1.21.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails (2.24.1) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rake (0.6.0) + rubocop (~> 1.0) + rubocop-rspec (2.28.0) + rubocop (~> 1.40) + rubocop-capybara (~> 2.17) + rubocop-factory_bot (~> 2.22) + rubocop-rspec_rails (~> 2.28) + rubocop-rspec_rails (2.29.1) + rubocop (~> 1.61) + ruby-progressbar (1.13.0) + securerandom (0.4.1) + spring (4.2.1) + spring-commands-rspec (1.0.4) + spring (>= 0.9.1) + sqlite3 (2.5.0-arm64-darwin) + sqlite3 (2.5.0-x86_64-linux-gnu) + stringio (3.1.2) + thor (1.3.2) + timecop (0.9.10) + timeout (0.4.3) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + uncruft (0.5.0) + railties (>= 6.1.0) + unicode-display_width (2.6.0) + uri (1.0.2) + useragent (0.16.11) + webmock (3.24.0) + addressable (>= 2.8.0) + crack (>= 0.3.2) + hashdiff (>= 0.4.0, < 2.0.0) + zeitwerk (2.7.1) + +PLATFORMS + arm64-darwin + x86_64-linux + +DEPENDENCIES + appraisal + betterlint + journaled! + railties (~> 8.0.0) + rspec-rails + rspec_junit_formatter + spring + spring-commands-rspec + sqlite3 (>= 2.1) + timecop + uncruft + webmock + +BUNDLED WITH + 2.6.3 diff --git a/journaled.gemspec b/journaled.gemspec index a3a04dd..3391f41 100644 --- a/journaled.gemspec +++ b/journaled.gemspec @@ -19,7 +19,7 @@ Gem::Specification.new do |s| s.files = Dir["{app,config,lib,journaled_schemas}/**/*", "LICENSE", "Rakefile", "README.md"] - s.required_ruby_version = ">= 2.6" + s.required_ruby_version = ">= 3.2" s.post_install_message = File.read("UPGRADING") if File.exist?('UPGRADING') @@ -28,7 +28,7 @@ Gem::Specification.new do |s| s.add_dependency "activesupport" s.add_dependency "aws-sdk-kinesis", "< 2" s.add_dependency "json-schema" - s.add_dependency "railties", ">= 5.2" + s.add_dependency "railties", ">= 7.0", "< 8.1" s.add_development_dependency "appraisal" s.add_development_dependency "betterlint" @@ -36,7 +36,6 @@ Gem::Specification.new do |s| s.add_development_dependency "rspec-rails" s.add_development_dependency "spring" s.add_development_dependency "spring-commands-rspec" - s.add_development_dependency "sqlite3", '~> 1.4' s.add_development_dependency "timecop" s.add_development_dependency "uncruft" s.add_development_dependency "webmock" diff --git a/lib/journaled/audit_log.rb b/lib/journaled/audit_log.rb index 84a0f10..8d5ea2c 100644 --- a/lib/journaled/audit_log.rb +++ b/lib/journaled/audit_log.rb @@ -39,7 +39,7 @@ module AuditLog class << self def exclude_classes! excluded_classes.each do |name| - if Rails::VERSION::MAJOR >= 6 && Rails.autoloaders.zeitwerk_enabled? + if Rails.autoloaders.zeitwerk_enabled? zeitwerk_exclude!(name) else classic_exclude!(name) diff --git a/lib/journaled/relation_change_protection.rb b/lib/journaled/relation_change_protection.rb index 3c51117..e4aee9a 100644 --- a/lib/journaled/relation_change_protection.rb +++ b/lib/journaled/relation_change_protection.rb @@ -2,12 +2,12 @@ module Journaled::RelationChangeProtection def update_all(updates, opts = { force: false }) # rubocop:disable Metrics/AbcSize - unless opts[:force] || !@klass.respond_to?(:journaled_attribute_names) || @klass.journaled_attribute_names.empty? + unless opts[:force] || !model.respond_to?(:journaled_attribute_names) || model.journaled_attribute_names.empty? conflicting_journaled_attribute_names = case updates when Hash - @klass.journaled_attribute_names & updates.keys.map(&:to_sym) + model.journaled_attribute_names & updates.keys.map(&:to_sym) when String - @klass.journaled_attribute_names.select do |a| + model.journaled_attribute_names.select do |a| updates.match?(/\b(?rake doc:app. diff --git a/spec/dummy/bin/bundle b/spec/dummy/bin/bundle deleted file mode 100755 index 2dbb717..0000000 --- a/spec/dummy/bin/bundle +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) -load Gem.bin_path('bundler', 'bundle') diff --git a/spec/dummy/bin/rails b/spec/dummy/bin/rails deleted file mode 100755 index a31728a..0000000 --- a/spec/dummy/bin/rails +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -APP_PATH = File.expand_path('../config/application', __dir__) -require_relative '../config/boot' -require 'rails/commands' diff --git a/spec/dummy/bin/rake b/spec/dummy/bin/rake deleted file mode 100755 index c199955..0000000 --- a/spec/dummy/bin/rake +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -require_relative '../config/boot' -require 'rake' -Rake.application.run diff --git a/spec/dummy/config.ru b/spec/dummy/config.ru deleted file mode 100644 index 667e328..0000000 --- a/spec/dummy/config.ru +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -# This file is used by Rack-based servers to start the application. - -require ::File.expand_path('config/environment', __dir__) -run Rails.application diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb index f0703b1..9be4124 100644 --- a/spec/dummy/config/application.rb +++ b/spec/dummy/config/application.rb @@ -1,19 +1,27 @@ # frozen_string_literal: true -require File.expand_path('boot', __dir__) +require 'bundler/setup' +require 'rails' +require 'active_model/railtie' +require 'active_record/railtie' +require 'active_job/railtie' -require "active_record/railtie" -require "active_job/railtie" -require "active_model/railtie" -require "action_controller/railtie" - -Bundler.require(*Rails.groups) -require "journaled" +Bundler.require(:default, Rails.env) module Dummy class Application < Rails::Application - config.autoloader = Rails::VERSION::MAJOR >= 7 ? :zeitwerk : :classic - config.active_record.sqlite3.represent_boolean_as_integer = true if Rails::VERSION::MAJOR < 6 - config.active_record.legacy_connection_handling = false if Rails::VERSION::MAJOR == 7 && Rails::VERSION::MINOR == 0 + config.root = File.expand_path('..', __dir__) + config.load_defaults Rails::VERSION::STRING.to_f + config.eager_load = Rails.env.test? + config.cache_classes = Rails.env.test? + config.active_job.queue_adapter = :test + config.filter_parameters += [:password] + config.active_support.deprecation = :raise + + # This configuration only applies to Rails 7.2, which is the only version + # that will enqueue after commit by default when using the `:test` adapter. + if Gem::Requirement.new('~> 7.2.0').satisfied_by?(ActiveJob.gem_version) + config.active_job.enqueue_after_transaction_commit = :never + end end end diff --git a/spec/dummy/config/boot.rb b/spec/dummy/config/boot.rb deleted file mode 100644 index 6d2cba0..0000000 --- a/spec/dummy/config/boot.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -# Set up gems listed in the Gemfile. -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__) - -require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) -$LOAD_PATH.unshift File.expand_path('../../../lib', __dir__) diff --git a/spec/dummy/config/environment.rb b/spec/dummy/config/environment.rb index 32d57aa..d5abe55 100644 --- a/spec/dummy/config/environment.rb +++ b/spec/dummy/config/environment.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Load the Rails application. -require File.expand_path('application', __dir__) +require_relative 'application' # Initialize the Rails application. Rails.application.initialize! diff --git a/spec/dummy/config/environments/development.rb b/spec/dummy/config/environments/development.rb deleted file mode 100644 index cbeec41..0000000 --- a/spec/dummy/config/environments/development.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # In the development environment your application's code is reloaded on - # every request. This slows down response time but is perfect for development - # since you don't have to restart the web server when you make code changes. - config.cache_classes = false - - # Do not eager load code on boot. - config.eager_load = false - - # Show full error reports and disable caching. - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - # Print deprecation notices to the Rails logger. - config.active_support.deprecation = :log - - # Raise an error on page load if there are pending migrations. - config.active_record.migration_error = :page_load - - # Raises error for missing translations - # config.action_view.raise_on_missing_translations = true -end diff --git a/spec/dummy/config/environments/test.rb b/spec/dummy/config/environments/test.rb deleted file mode 100644 index 5041daa..0000000 --- a/spec/dummy/config/environments/test.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # The test environment is used exclusively to run your application's - # test suite. You never need to work with it otherwise. Remember that - # your test database is "scratch space" for the test suite and is wiped - # and recreated between test runs. Don't rely on the data there! - config.cache_classes = true - - # Do not eager load code on boot. This avoids loading your whole application - # just for the purpose of running a single test. If you are using a tool that - # preloads Rails for running tests, you may have to set it to true. - config.eager_load = false - - # Configure static asset server for tests with Cache-Control for performance. - config.serve_static_assets = true - config.static_cache_control = 'public, max-age=3600' - - # Show full error reports and disable caching. - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - # Raise exceptions instead of rendering exception templates. - config.action_dispatch.show_exceptions = false - - # Disable request forgery protection in test environment. - config.action_controller.allow_forgery_protection = false - - # Print deprecation notices to the stderr. - config.active_support.deprecation = :stderr - - # Raises error for missing translations - # config.action_view.raise_on_missing_translations = true - - # Use ActiveJob test adapter - config.active_job.queue_adapter = :test -end diff --git a/spec/dummy/config/initializers/backtrace_silencers.rb b/spec/dummy/config/initializers/backtrace_silencers.rb deleted file mode 100644 index 4b63f28..0000000 --- a/spec/dummy/config/initializers/backtrace_silencers.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -# Be sure to restart your server when you modify this file. - -# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. -# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } - -# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. -# Rails.backtrace_cleaner.remove_silencers! diff --git a/spec/dummy/config/initializers/cookies_serializer.rb b/spec/dummy/config/initializers/cookies_serializer.rb deleted file mode 100644 index 0a23b25..0000000 --- a/spec/dummy/config/initializers/cookies_serializer.rb +++ /dev/null @@ -1,5 +0,0 @@ -# frozen_string_literal: true - -# Be sure to restart your server when you modify this file. - -Rails.application.config.action_dispatch.cookies_serializer = :json diff --git a/spec/dummy/config/initializers/filter_parameter_logging.rb b/spec/dummy/config/initializers/filter_parameter_logging.rb deleted file mode 100644 index 7a4f47b..0000000 --- a/spec/dummy/config/initializers/filter_parameter_logging.rb +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -# Be sure to restart your server when you modify this file. - -# Configure sensitive parameters which will be filtered from the log file. -Rails.application.config.filter_parameters += [:password] diff --git a/spec/dummy/config/initializers/inflections.rb b/spec/dummy/config/initializers/inflections.rb deleted file mode 100644 index dc84742..0000000 --- a/spec/dummy/config/initializers/inflections.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -# Be sure to restart your server when you modify this file. - -# Add new inflection rules using the following format. Inflections -# are locale specific, and you may define rules for as many different -# locales as you wish. All of these examples are active by default: -# ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.plural /^(ox)$/i, '\1en' -# inflect.singular /^(ox)en/i, '\1' -# inflect.irregular 'person', 'people' -# inflect.uncountable %w( fish sheep ) -# end - -# These inflection rules are supported but not enabled by default: -# ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.acronym 'RESTful' -# end diff --git a/spec/dummy/config/initializers/mime_types.rb b/spec/dummy/config/initializers/mime_types.rb deleted file mode 100644 index be6fedc..0000000 --- a/spec/dummy/config/initializers/mime_types.rb +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -# Be sure to restart your server when you modify this file. - -# Add new mime types for use in respond_to blocks: -# Mime::Type.register "text/richtext", :rtf diff --git a/spec/dummy/config/initializers/session_store.rb b/spec/dummy/config/initializers/session_store.rb deleted file mode 100644 index 969d977..0000000 --- a/spec/dummy/config/initializers/session_store.rb +++ /dev/null @@ -1,5 +0,0 @@ -# frozen_string_literal: true - -# Be sure to restart your server when you modify this file. - -Rails.application.config.session_store :cookie_store, key: '_dummy_session' diff --git a/spec/dummy/config/initializers/wrap_parameters.rb b/spec/dummy/config/initializers/wrap_parameters.rb deleted file mode 100644 index 246168a..0000000 --- a/spec/dummy/config/initializers/wrap_parameters.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -# Be sure to restart your server when you modify this file. - -# This file contains settings for ActionController::ParamsWrapper which -# is enabled by default. - -# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. -ActiveSupport.on_load(:action_controller) do - wrap_parameters format: [:json] if respond_to?(:wrap_parameters) -end - -# To enable root element in JSON for ActiveRecord objects. -# ActiveSupport.on_load(:active_record) do -# self.include_root_in_json = true -# end diff --git a/spec/dummy/config/locales/en.yml b/spec/dummy/config/locales/en.yml deleted file mode 100644 index 0653957..0000000 --- a/spec/dummy/config/locales/en.yml +++ /dev/null @@ -1,23 +0,0 @@ -# Files in the config/locales directory are used for internationalization -# and are automatically loaded by Rails. If you want to use locales other -# than English, add the necessary files in this directory. -# -# To use the locales, use `I18n.t`: -# -# I18n.t 'hello' -# -# In views, this is aliased to just `t`: -# -# <%= t('hello') %> -# -# To use a different locale, set it with `I18n.locale`: -# -# I18n.locale = :es -# -# This would use the information in config/locales/es.yml. -# -# To learn more, please read the Rails Internationalization guide -# available at http://guides.rubyonrails.org/i18n.html. - -en: - hello: "Hello world" diff --git a/spec/dummy/config/routes.rb b/spec/dummy/config/routes.rb deleted file mode 100644 index 189947f..0000000 --- a/spec/dummy/config/routes.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -Rails.application.routes.draw do - # The priority is based upon order of creation: first created -> highest priority. - # See how all your routes lay out with "rake routes". - - # You can have the root of your site routed with "root" - # root 'welcome#index' - - # Example of regular route: - # get 'products/:id' => 'catalog#view' - - # Example of named route that can be invoked with purchase_url(id: product.id) - # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase - - # Example resource route (maps HTTP verbs to controller actions automatically): - # resources :products - - # Example resource route with options: - # resources :products do - # member do - # get 'short' - # post 'toggle' - # end - # - # collection do - # get 'sold' - # end - # end - - # Example resource route with sub-resources: - # resources :products do - # resources :comments, :sales - # resource :seller - # end - - # Example resource route with more complex sub-resources: - # resources :products do - # resources :comments - # resources :sales do - # get 'recent', on: :collection - # end - # end - - # Example resource route with concerns: - # concern :toggleable do - # post 'toggle' - # end - # resources :posts, concerns: :toggleable - # resources :photos, concerns: :toggleable - - # Example resource route within a namespace: - # namespace :admin do - # # Directs /admin/products/* to Admin::ProductsController - # # (app/controllers/admin/products_controller.rb) - # resources :products - # end -end diff --git a/spec/dummy/config/secrets.yml b/spec/dummy/config/secrets.yml deleted file mode 100644 index 13e3ab7..0000000 --- a/spec/dummy/config/secrets.yml +++ /dev/null @@ -1,22 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Your secret key is used for verifying the integrity of signed cookies. -# If you change this key, all old signed cookies will become invalid! - -# Make sure the secret is at least 30 characters and all random, -# no regular words or you'll be exposed to dictionary attacks. -# You can use `rake secret` to generate a secure secret key. - -# Make sure the secrets in this file are kept private -# if you're sharing your code publicly. - -development: - secret_key_base: 75fede5b59b2e8f188b12965be5e0e20e6ca4edbe843dee328d7c874054b2ba6e6deab50926213a08a8414545e16bfeef3c2128c519d1d60fa5b6d5fdf841da5 - -test: - secret_key_base: 81d3418e318e6dace1263c2c8634238beaff1f06766b04bfa05ed14b519c67c2fa2273900da0d6f911d73936e689d9853abae39911e48f41f766957d8e83451b - -# Do not keep production secrets in the repository, -# instead read values from the environment. -production: - secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/spec/dummy/public/404.html b/spec/dummy/public/404.html deleted file mode 100644 index b612547..0000000 --- a/spec/dummy/public/404.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - The page you were looking for doesn't exist (404) - - - - - - -
-
-

The page you were looking for doesn't exist.

-

You may have mistyped the address or the page may have moved.

-
-

If you are the application owner check the logs for more information.

-
- - diff --git a/spec/dummy/public/422.html b/spec/dummy/public/422.html deleted file mode 100644 index a21f82b..0000000 --- a/spec/dummy/public/422.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - The change you wanted was rejected (422) - - - - - - -
-
-

The change you wanted was rejected.

-

Maybe you tried to change something you didn't have access to.

-
-

If you are the application owner check the logs for more information.

-
- - diff --git a/spec/dummy/public/500.html b/spec/dummy/public/500.html deleted file mode 100644 index 061abc5..0000000 --- a/spec/dummy/public/500.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - We're sorry, but something went wrong (500) - - - - - - -
-
-

We're sorry, but something went wrong.

-
-

If you are the application owner check the logs for more information.

-
- - diff --git a/spec/dummy/public/favicon.ico b/spec/dummy/public/favicon.ico deleted file mode 100644 index e69de29..0000000 diff --git a/spec/jobs/journaled/delivery_job_spec.rb b/spec/jobs/journaled/delivery_job_spec.rb index 4f1bf33..77f2363 100644 --- a/spec/jobs/journaled/delivery_job_spec.rb +++ b/spec/jobs/journaled/delivery_job_spec.rb @@ -88,43 +88,6 @@ end end - unless Gem::Version.new(Journaled::VERSION) < Gem::Version.new('6.0.0') - raise <<~MSG - Hey! I see that you're bumping the version to 6.0! - - This is a reminder to: - - Remove the `legacy_kwargs` argument (and related logic) from `Journaled::DeliveryJob` - - Remove the related test context below - - Thanks! - MSG - end - - context 'when supplying legacy kwargs (a single event) instead of a list of events' do - let(:args) { { serialized_event: '{"foo":"bar"}', partition_key: 'fake_partition_key', stream_name: 'test_events' } } - - it 'makes requests to AWS to put the event on the Kinesis with the correct body' do - events = described_class.perform_now(**args) - - expect(events.count).to eq 1 - expect(events.first.shard_id).to eq '101' - expect(events.first.sequence_number).to eq '101123' - expect(kinesis_client).to have_received(:put_record).with( - stream_name: 'test_events', - data: '{"foo":"bar"}', - partition_key: 'fake_partition_key', - ) - end - - context 'when the stream name is not set' do - let(:args) { { serialized_event: '{"foo":"bar"}', partition_key: 'fake_partition_key', stream_name: nil } } - - it 'raises an ArgumentError' do - expect { described_class.perform_now(**args) }.to raise_error ArgumentError, /missing keyword: :?stream_name/ - end - end - end - context 'when Amazon responds with an InternalFailure' do before do kinesis_client.stub_responses(:put_record, 'InternalFailure') diff --git a/spec/lib/journaled/audit_log_spec.rb b/spec/lib/journaled/audit_log_spec.rb index a886640..48e3570 100644 --- a/spec/lib/journaled/audit_log_spec.rb +++ b/spec/lib/journaled/audit_log_spec.rb @@ -30,10 +30,8 @@ def attributes { all: 'attributes', password: true } end - if Rails::VERSION::MAJOR >= 7 - def encrypted_attribute?(_key) - false - end + def encrypted_attribute?(_key) + false end end end diff --git a/spec/models/database_change_protection_spec.rb b/spec/models/database_change_protection_spec.rb index de8b79b..1ffaadc 100644 --- a/spec/models/database_change_protection_spec.rb +++ b/spec/models/database_change_protection_spec.rb @@ -2,110 +2,108 @@ require 'rails_helper' -if Rails::VERSION::MAJOR > 5 || (Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR >= 2) - # rubocop:disable Rails/SkipsModelValidations - RSpec.describe "Raw database change protection" do - let(:journaled_class) do - Class.new(ActiveRecord::Base) do - include Journaled::Changes +# rubocop:disable Rails/SkipsModelValidations +RSpec.describe "Raw database change protection" do + let(:journaled_class) do + Class.new(ActiveRecord::Base) do + include Journaled::Changes - self.table_name = 'widgets' + self.table_name = 'widgets' - journal_changes_to :name, as: :attempt - end + journal_changes_to :name, as: :attempt end + end - let(:journaled_class_with_no_journaled_columns) do - Class.new(ActiveRecord::Base) do - include Journaled::Changes + let(:journaled_class_with_no_journaled_columns) do + Class.new(ActiveRecord::Base) do + include Journaled::Changes - self.table_name = 'widgets' - end + self.table_name = 'widgets' end + end - describe "the relation" do - describe "#update_all" do - it "refuses on journaled columns passed as hash" do - expect { journaled_class.update_all(name: nil) }.to raise_error(/aborted by Journaled/) - end + describe "the relation" do + describe "#update_all" do + it "refuses on journaled columns passed as hash" do + expect { journaled_class.update_all(name: nil) }.to raise_error(/aborted by Journaled/) + end - it "refuses on journaled columns passed as string" do - expect { journaled_class.update_all("\"name\" = NULL") }.to raise_error(/aborted by Journaled/) - expect { journaled_class.update_all("name = null") }.to raise_error(/aborted by Journaled/) - expect { journaled_class.update_all("widgets.name = null") }.to raise_error(/aborted by Journaled/) - expect { journaled_class.update_all("other_column = 'name'") }.not_to raise_error - end + it "refuses on journaled columns passed as string" do + expect { journaled_class.update_all("\"name\" = NULL") }.to raise_error(/aborted by Journaled/) + expect { journaled_class.update_all("name = null") }.to raise_error(/aborted by Journaled/) + expect { journaled_class.update_all("widgets.name = null") }.to raise_error(/aborted by Journaled/) + expect { journaled_class.update_all("other_column = 'name'") }.not_to raise_error + end - it "succeeds on unjournaled columns" do - expect { journaled_class.update_all(other_column: "") }.not_to raise_error - end + it "succeeds on unjournaled columns" do + expect { journaled_class.update_all(other_column: "") }.not_to raise_error + end - it "succeeds when forced on journaled columns" do - expect { journaled_class.update_all({ name: nil }, force: true) }.not_to raise_error - end + it "succeeds when forced on journaled columns" do + expect { journaled_class.update_all({ name: nil }, force: true) }.not_to raise_error end + end - describe "#delete" do - it "refuses if journaled columns exist" do - expect { journaled_class.delete(1) }.to raise_error(/aborted by Journaled/) - end + describe "#delete" do + it "refuses if journaled columns exist" do + expect { journaled_class.delete(1) }.to raise_error(/aborted by Journaled/) + end - it "succeeds if no journaled columns exist" do - expect { journaled_class_with_no_journaled_columns.delete(1) }.not_to raise_error - end + it "succeeds if no journaled columns exist" do + expect { journaled_class_with_no_journaled_columns.delete(1) }.not_to raise_error + end - it "succeeds if journaled columns exist when forced" do - expect { journaled_class.delete(1, force: true) }.not_to raise_error - end + it "succeeds if journaled columns exist when forced" do + expect { journaled_class.delete(1, force: true) }.not_to raise_error end + end - describe "#delete_all" do - it "refuses if journaled columns exist" do - expect { journaled_class.delete_all }.to raise_error(/aborted by Journaled/) - end + describe "#delete_all" do + it "refuses if journaled columns exist" do + expect { journaled_class.delete_all }.to raise_error(/aborted by Journaled/) + end - it "succeeds if no journaled columns exist" do - expect { journaled_class_with_no_journaled_columns.delete_all }.not_to raise_error - end + it "succeeds if no journaled columns exist" do + expect { journaled_class_with_no_journaled_columns.delete_all }.not_to raise_error + end - it "succeeds if journaled columns exist when forced" do - expect { journaled_class.delete_all(force: true) }.not_to raise_error - end + it "succeeds if journaled columns exist when forced" do + expect { journaled_class.delete_all(force: true) }.not_to raise_error end end + end - describe "an instance" do - subject { journaled_class.create!(name: 'foo') } + describe "an instance" do + subject { journaled_class.create!(name: 'foo') } - describe "#update_columns" do - it "refuses on journaled columns" do - expect { subject.update_columns(name: nil) }.to raise_error(/aborted by Journaled/) - end + describe "#update_columns" do + it "refuses on journaled columns" do + expect { subject.update_columns(name: nil) }.to raise_error(/aborted by Journaled/) + end - it "succeeds on unjournaled columns" do - expect { subject.update_columns(other_column: "") }.not_to raise_error - end + it "succeeds on unjournaled columns" do + expect { subject.update_columns(other_column: "") }.not_to raise_error + end - it "succeeds when forced on journaled columns" do - expect { subject.update_columns({ name: nil }, force: true) }.not_to raise_error - end + it "succeeds when forced on journaled columns" do + expect { subject.update_columns({ name: nil }, force: true) }.not_to raise_error end + end - describe "#delete" do - it "refuses if journaled columns exist" do - expect { subject.delete }.to raise_error(/aborted by Journaled/) - end + describe "#delete" do + it "refuses if journaled columns exist" do + expect { subject.delete }.to raise_error(/aborted by Journaled/) + end - it "succeeds if no journaled columns exist" do - instance = journaled_class_with_no_journaled_columns.create! - expect { instance.delete }.not_to raise_error - end + it "succeeds if no journaled columns exist" do + instance = journaled_class_with_no_journaled_columns.create! + expect { instance.delete }.not_to raise_error + end - it "succeeds if journaled columns exist when forced" do - expect { subject.delete(force: true) }.not_to raise_error - end + it "succeeds if journaled columns exist when forced" do + expect { subject.delete(force: true) }.not_to raise_error end end end - # rubocop:enable Rails/SkipsModelValidations end +# rubocop:enable Rails/SkipsModelValidations diff --git a/spec/models/journaled/writer_spec.rb b/spec/models/journaled/writer_spec.rb index 5e548c6..dc2a678 100644 --- a/spec/models/journaled/writer_spec.rb +++ b/spec/models/journaled/writer_spec.rb @@ -134,11 +134,7 @@ it 'defaults to the global default' do expect { subject.journal! }.to change { - if Rails::VERSION::MAJOR < 6 - enqueued_jobs.count { |j| j[:job] == Journaled::DeliveryJob } - else - enqueued_jobs.count { |j| j['job_class'] == 'Journaled::DeliveryJob' && j['priority'] == 999 } - end + enqueued_jobs.count { |j| j['job_class'] == 'Journaled::DeliveryJob' && j['priority'] == 999 } }.from(0).to(1) .and journal_event_including(journaled_event_attributes) .with_schema_name('fake_schema_name') @@ -155,11 +151,7 @@ it 'enqueues a Journaled::DeliveryJob with the given priority' do expect { subject.journal! }.to change { - if Rails::VERSION::MAJOR < 6 - enqueued_jobs.count { |j| j[:job] == Journaled::DeliveryJob } - else - enqueued_jobs.count { |j| j['job_class'] == 'Journaled::DeliveryJob' && j['priority'] == 13 } - end + enqueued_jobs.count { |j| j['job_class'] == 'Journaled::DeliveryJob' && j['priority'] == 13 } }.from(0).to(1) .and journal_event_including(journaled_event_attributes) .with_schema_name('fake_schema_name') diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 639fd6d..dd40d00 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -4,7 +4,7 @@ require 'uncruft' require 'active_support/testing/time_helpers' -require File.expand_path('dummy/config/environment.rb', __dir__) +require_relative 'dummy/config/environment' Rails.configuration.database_configuration[rails_env].tap do |c| ActiveRecord::Tasks::DatabaseTasks.create(c)