From 0eec09a762ea54b6761f9c866b0171d94262ab4e Mon Sep 17 00:00:00 2001 From: Matt McMahand Date: Sun, 8 Feb 2026 11:41:22 -0500 Subject: [PATCH 01/26] loosen development dependencies --- impressionist.gemspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/impressionist.gemspec b/impressionist.gemspec index 20e8a3c1..8b59684e 100644 --- a/impressionist.gemspec +++ b/impressionist.gemspec @@ -22,8 +22,8 @@ Gem::Specification.new do |s| s.add_dependency 'nokogiri', RUBY_VERSION < '2.1.0' ? '~> 1.6.0' : '~> 1' s.add_dependency 'rails', '>= 3.2.15' - s.add_development_dependency 'bundler', '~> 2.0' + s.add_development_dependency 'bundler', '~> 4.0' s.add_development_dependency 'capybara' s.add_development_dependency 'rspec-rails' - s.add_development_dependency 'sqlite3', '~> 1.4' + s.add_development_dependency 'sqlite3' end From badc2fa34ce83b58521d2cc90ea3fd2f5e4a6d06 Mon Sep 17 00:00:00 2001 From: Matt McMahand Date: Sun, 8 Feb 2026 12:03:55 -0500 Subject: [PATCH 02/26] update development dependencies --- impressionist.gemspec | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/impressionist.gemspec b/impressionist.gemspec index 8b59684e..f4ff0de4 100644 --- a/impressionist.gemspec +++ b/impressionist.gemspec @@ -18,12 +18,12 @@ Gem::Specification.new do |s| s.test_files = `git ls-files -- tests/**/*`.split("\n") s.require_path = 'lib' - s.add_dependency "friendly_id" - s.add_dependency 'nokogiri', RUBY_VERSION < '2.1.0' ? '~> 1.6.0' : '~> 1' + s.add_dependency "friendly_id", '~> 5.6' + s.add_dependency 'nokogiri', '~> 1.19' s.add_dependency 'rails', '>= 3.2.15' s.add_development_dependency 'bundler', '~> 4.0' - s.add_development_dependency 'capybara' - s.add_development_dependency 'rspec-rails' - s.add_development_dependency 'sqlite3' + s.add_development_dependency 'capybara', '~> 3.40' + s.add_development_dependency 'rspec-rails', '~> 8.0' + s.add_development_dependency 'sqlite3', '~> 2.9' end From 458277bc06d691568ab52f1000aede56809561f3 Mon Sep 17 00:00:00 2001 From: Matt McMahand Date: Sun, 8 Feb 2026 12:10:24 -0500 Subject: [PATCH 03/26] bump ruby matrix for currently maintained versions of ruby see https://www.ruby-lang.org/en/downloads/branches/ for more info --- .github/workflows/main.yml | 6 +++--- mise.toml | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 mise.toml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 89f16b62..ae16d479 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,7 +5,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby: ['3.1.2', '2.7.5'] + ruby: ["3.3.10", "4.0.1"] env: RAILS_ENV: test steps: @@ -15,7 +15,8 @@ jobs: ruby-version: ${{ matrix.ruby }} - name: setup app run: | - bundle + bundle install + cd spec/dummy bundle exec rails g impressionist -f bundle exec rake db:create db:migrate RAILS_ENV=test @@ -23,4 +24,3 @@ jobs: run: bundle exec rubocop - name: Run Tests run: bundle exec rspec - diff --git a/mise.toml b/mise.toml new file mode 100644 index 00000000..5a061357 --- /dev/null +++ b/mise.toml @@ -0,0 +1,2 @@ +[tools] +ruby = "4.0.1" From 5168867c817df20200c1923308bf4a02dc882426 Mon Sep 17 00:00:00 2001 From: Matt McMahand Date: Sun, 8 Feb 2026 12:16:58 -0500 Subject: [PATCH 04/26] remove bundler --- impressionist.gemspec | 1 - 1 file changed, 1 deletion(-) diff --git a/impressionist.gemspec b/impressionist.gemspec index f4ff0de4..12507b10 100644 --- a/impressionist.gemspec +++ b/impressionist.gemspec @@ -22,7 +22,6 @@ Gem::Specification.new do |s| s.add_dependency 'nokogiri', '~> 1.19' s.add_dependency 'rails', '>= 3.2.15' - s.add_development_dependency 'bundler', '~> 4.0' s.add_development_dependency 'capybara', '~> 3.40' s.add_development_dependency 'rspec-rails', '~> 8.0' s.add_development_dependency 'sqlite3', '~> 2.9' From c26a7747719bc7865ee976cc8909f627b3fb20c8 Mon Sep 17 00:00:00 2001 From: Matt McMahand Date: Sun, 8 Feb 2026 12:18:42 -0500 Subject: [PATCH 05/26] cache bundling --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ae16d479..9c350710 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,6 +13,7 @@ jobs: - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} + bundler-cache: true - name: setup app run: | bundle install From eff0747e0914d2b7ab824a303adaf1722c5e9465 Mon Sep 17 00:00:00 2001 From: Matt McMahand Date: Sun, 8 Feb 2026 12:19:09 -0500 Subject: [PATCH 06/26] legacy_connection_handling not longer a method --- spec/dummy/config/environments/test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/dummy/config/environments/test.rb b/spec/dummy/config/environments/test.rb index 4782029e..2fc7cc77 100644 --- a/spec/dummy/config/environments/test.rb +++ b/spec/dummy/config/environments/test.rb @@ -7,7 +7,7 @@ # Settings specified here will take precedence over those in config/application.rb. config.cache_classes = false - config.active_record.legacy_connection_handling = false + # 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 From 980166548dbdf0be4accdf65e747462855770bf0 Mon Sep 17 00:00:00 2001 From: Matt McMahand Date: Sun, 8 Feb 2026 12:46:20 -0500 Subject: [PATCH 07/26] fix timestamped_migrations removal https://guides.rubyonrails.org/v5.0/upgrading_ruby_on_rails.html#active-record --- lib/generators/active_record/impressionist_generator.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/generators/active_record/impressionist_generator.rb b/lib/generators/active_record/impressionist_generator.rb index 1c899782..dc6ad5c0 100644 --- a/lib/generators/active_record/impressionist_generator.rb +++ b/lib/generators/active_record/impressionist_generator.rb @@ -4,13 +4,12 @@ class ImpressionistGenerator < Rails::Generators::Base include Rails::Generators::Migration source_root File.join(File.dirname(__FILE__), 'templates') - # FIX, why is this implementing rails behaviour? def self.next_migration_number(dirname) - sleep 1 - if ActiveRecord::Base.timestamped_migrations - Time.now.utc.strftime("%Y%m%d%H%M%S") + next_number = current_migration_number(dirname) + 1 + if ActiveRecord.timestamped_migrations + [Time.now.utc.strftime("%Y%m%d%H%M%S"), "%.14d" % next_number].max else - "%.3d" % (current_migration_number(dirname) + 1) + "%.3d" % next_number end end From 23aeefe008427e033967bdc45045b958f188e60a Mon Sep 17 00:00:00 2001 From: Matt McMahand Date: Sun, 8 Feb 2026 12:52:44 -0500 Subject: [PATCH 08/26] get rubocop working again --- .rubocop.yml | 4 ++-- .rubocop_todo.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index c7a7a4de..894b589c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,7 +5,7 @@ AllCops: inherit_from: .rubocop_todo.yml -require: +plugins: - rubocop-rspec - rubocop-rails @@ -23,5 +23,5 @@ Style/HashTransformKeys: Enabled: True Style/HashTransformValues: Enabled: True -RSpec/FilePath: +RSpec/SpecFilePathFormat: Enabled: False diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index f3a5e539..66699c30 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -362,7 +362,7 @@ Metrics/ModuleLength: # ForbiddenPrefixes: is_, has_, have_ # AllowedMethods: is_a? # MethodDefinitionMacros: define_method, define_singleton_method -Naming/PredicateName: +Naming/PredicatePrefix: Exclude: - "spec/**/*" - "lib/impressionist/is_impressionable.rb" @@ -389,7 +389,7 @@ RSpec/ExampleLength: # Offense count: 5 # Configuration parameters: CustomTransform, IgnoreMethods. -RSpec/FilePath: +RSpec/SpecFilePathFormat: Exclude: - "spec/bots_spec.rb" - "spec/controllers/impressionist_uniqueness_spec.rb" From 99d245034e7fd78aac893f3aa2b0d9e6532df346 Mon Sep 17 00:00:00 2001 From: Matt McMahand Date: Sun, 8 Feb 2026 12:55:09 -0500 Subject: [PATCH 09/26] add new cops --- .rubocop.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.rubocop.yml b/.rubocop.yml index 894b589c..afffd4f7 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,6 +1,8 @@ + AllCops: Exclude: - "spec/dummy/**/*" + NewCops: enable SuggestExtensions: false inherit_from: .rubocop_todo.yml From eb59027d6f12a3be2fa5e4741715b2cadfa0b0c7 Mon Sep 17 00:00:00 2001 From: Matt McMahand Date: Sun, 8 Feb 2026 13:00:57 -0500 Subject: [PATCH 10/26] try TargetRubyVersion --- .rubocop.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.rubocop.yml b/.rubocop.yml index afffd4f7..d78627d8 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,6 +4,7 @@ AllCops: - "spec/dummy/**/*" NewCops: enable SuggestExtensions: false + TargetRubyVersion: 4.0 inherit_from: .rubocop_todo.yml From f16dd73bfe369aef06065e55aa26f53cb9d93b0f Mon Sep 17 00:00:00 2001 From: Matt McMahand Date: Sun, 8 Feb 2026 13:01:51 -0500 Subject: [PATCH 11/26] turn off bundler-cache --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9c350710..ae16d479 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,6 @@ jobs: - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - bundler-cache: true - name: setup app run: | bundle install From 8c94d0493f514ce48d22eeb134fde1deb7f3477d Mon Sep 17 00:00:00 2001 From: Matt McMahand Date: Sun, 8 Feb 2026 13:05:11 -0500 Subject: [PATCH 12/26] BUNDLE_PATH --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ae16d479..77b7e863 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,6 +8,7 @@ jobs: ruby: ["3.3.10", "4.0.1"] env: RAILS_ENV: test + BUNDLE_PATH: vendor/bundle steps: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 From c0d8f1b0ff91009e4c1946d68dd2a575410607b8 Mon Sep 17 00:00:00 2001 From: Matt McMahand Date: Sun, 8 Feb 2026 13:07:26 -0500 Subject: [PATCH 13/26] try turning cache back on --- .github/workflows/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 77b7e863..b30f15f1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,10 +14,9 @@ jobs: - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} + bundler-cache: true - name: setup app run: | - bundle install - cd spec/dummy bundle exec rails g impressionist -f bundle exec rake db:create db:migrate RAILS_ENV=test From e445c6ae7c4e1556551d8929575a88b26c925b91 Mon Sep 17 00:00:00 2001 From: Matt McMahand Date: Sun, 8 Feb 2026 13:10:31 -0500 Subject: [PATCH 14/26] bust cache --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b30f15f1..8c941102 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,6 +15,7 @@ jobs: with: ruby-version: ${{ matrix.ruby }} bundler-cache: true + cache-version: 1 - name: setup app run: | cd spec/dummy From 07eee324c83e8331e91f49486337087ebad45225 Mon Sep 17 00:00:00 2001 From: Matt McMahand Date: Sun, 8 Feb 2026 13:15:50 -0500 Subject: [PATCH 15/26] add rubocop-rake --- Gemfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Gemfile b/Gemfile index 01777386..5501c703 100644 --- a/Gemfile +++ b/Gemfile @@ -14,6 +14,7 @@ group :test do gem 'pry' gem 'rspec', "~> 3.0" gem 'rubocop-rails', require: false + gem 'rubocop-rake', require: false gem 'rubocop-rspec', require: false gem 'simplecov' gem 'systemu' From d9b256f825721e50a65dd1d9d49e9c9c16d85b31 Mon Sep 17 00:00:00 2001 From: Matt McMahand Date: Sun, 8 Feb 2026 13:16:48 -0500 Subject: [PATCH 16/26] so much rubocop --- .rubocop.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index d78627d8..c04647ed 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -9,8 +9,9 @@ AllCops: inherit_from: .rubocop_todo.yml plugins: - - rubocop-rspec - rubocop-rails + - rubocop-rake + - rubocop-rspec Layout/SpaceAroundMethodCallOperator: Enabled: true From b10c54bee38830ed08414cd05555d689fa188c71 Mon Sep 17 00:00:00 2001 From: Matt McMahand Date: Sun, 8 Feb 2026 13:20:20 -0500 Subject: [PATCH 17/26] add vendor to excludes --- .rubocop.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.rubocop.yml b/.rubocop.yml index c04647ed..26ed9af7 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,6 +2,7 @@ AllCops: Exclude: - "spec/dummy/**/*" + - "vendor/bundle/**/*" NewCops: enable SuggestExtensions: false TargetRubyVersion: 4.0 From 23009ff6986648e706a84b9e500512f45d52fece Mon Sep 17 00:00:00 2001 From: Matt McMahand Date: Sun, 8 Feb 2026 13:38:12 -0500 Subject: [PATCH 18/26] move dev dependencies to Gemfile --- Gemfile | 3 +++ impressionist.gemspec | 5 +---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 5501c703..702abb42 100644 --- a/Gemfile +++ b/Gemfile @@ -10,13 +10,16 @@ platforms :jruby do end group :test do + gem 'capybara', '~> 3.40' gem 'minitest' gem 'pry' gem 'rspec', "~> 3.0" + gem 'rspec-rails', '~> 8.0' gem 'rubocop-rails', require: false gem 'rubocop-rake', require: false gem 'rubocop-rspec', require: false gem 'simplecov' + gem 'sqlite3', '~> 2.9' gem 'systemu' end diff --git a/impressionist.gemspec b/impressionist.gemspec index 12507b10..a03be526 100644 --- a/impressionist.gemspec +++ b/impressionist.gemspec @@ -15,14 +15,11 @@ Gem::Specification.new do |s| s.authors = ['johnmcaliley'] s.files = `git ls-files`.split("\n") - s.test_files = `git ls-files -- tests/**/*`.split("\n") s.require_path = 'lib' s.add_dependency "friendly_id", '~> 5.6' s.add_dependency 'nokogiri', '~> 1.19' s.add_dependency 'rails', '>= 3.2.15' - s.add_development_dependency 'capybara', '~> 3.40' - s.add_development_dependency 'rspec-rails', '~> 8.0' - s.add_development_dependency 'sqlite3', '~> 2.9' + s.metadata['rubygems_mfa_required'] = 'true' end From b5c18852c207726c34f57b46335b52c760d6ab73 Mon Sep 17 00:00:00 2001 From: Matt McMahand Date: Sun, 8 Feb 2026 13:38:53 -0500 Subject: [PATCH 19/26] run rubocop auto-gen-config --- .rubocop_todo.yml | 554 +++++++++--------- app/models/impressionist/bots.rb | 6 +- app/models/impressionist/impressionable.rb | 8 +- .../active_record/impressionist_generator.rb | 1 + .../mongoid/impressionist_controller.rb | 2 +- .../models/mongoid/impression.rb | 1 + spec/controllers/articles_controller_spec.rb | 10 +- .../impressionist_uniqueness_spec.rb | 8 +- .../rails_generators/rails_generators_spec.rb | 7 +- spec/rails_helper.rb | 3 - spec/rails_toggle_spec.rb | 6 +- spec/setup_association_spec.rb | 4 +- spec/spec_helper.rb | 6 +- 13 files changed, 298 insertions(+), 318 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 66699c30..3c0f5538 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,660 +1,646 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2020-04-25 21:43:29 -0400 using RuboCop version 0.82.0. +# on 2026-02-08 18:36:41 UTC using RuboCop version 1.84.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 # versions of RuboCop, may require this file to be generated again. # Offense count: 1 -# Configuration parameters: Include. -# Include: **/*.gemspec -Gemspec/RubyVersionGlobalsUsage: - Exclude: - - "impressionist.gemspec" Gemspec/RequiredRubyVersion: Exclude: - - "impressionist.gemspec" + - 'impressionist.gemspec' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, IndentationWidth. # SupportedStyles: outdent, indent Layout/AccessModifierIndentation: Exclude: - - "lib/impressionist/engine.rb" + - 'lib/impressionist/engine.rb' # Offense count: 2 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, IndentationWidth. # SupportedStyles: with_first_argument, with_fixed_indentation Layout/ArgumentAlignment: Exclude: - - "lib/impressionist/is_impressionable.rb" - - "lib/impressionist/models/mongo_mapper/impressionist/impressionable.rb" - -# Offense count: 1455 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, IndentationWidth. -# SupportedStyles: with_first_element, with_fixed_indentation -Layout/ArrayAlignment: - Exclude: - - "app/models/impressionist/bots.rb" + - 'lib/impressionist/is_impressionable.rb' + - 'lib/impressionist/models/mongo_mapper/impressionist/impressionable.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyleAlignWith. # SupportedStylesAlignWith: either, start_of_block, start_of_line Layout/BlockAlignment: Exclude: - - "lib/impressionist/engine.rb" + - 'lib/impressionist/engine.rb' # Offense count: 3 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Layout/ClosingParenthesisIndentation: Exclude: - - "app/controllers/impressionist_controller.rb" - - "lib/impressionist/controllers/mongoid/impressionist_controller.rb" + - 'app/controllers/impressionist_controller.rb' + - 'lib/impressionist/controllers/mongoid/impressionist_controller.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowForAlignment. Layout/CommentIndentation: Exclude: - - "app/controllers/impressionist_controller.rb" + - 'app/controllers/impressionist_controller.rb' # Offense count: 6 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: leading, trailing Layout/DotPosition: Exclude: - - "lib/impressionist/counter_cache.rb" - - "lib/impressionist/models/active_record/impressionist/impressionable.rb" - - "lib/impressionist/models/mongoid/impressionist/impressionable.rb" - - "lib/impressionist/setup_association.rb" - - "lib/impressionist/update_counters.rb" + - 'lib/impressionist/counter_cache.rb' + - 'lib/impressionist/models/active_record/impressionist/impressionable.rb' + - 'lib/impressionist/models/mongoid/impressionist/impressionable.rb' + - 'lib/impressionist/setup_association.rb' + - 'lib/impressionist/update_counters.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Layout/EmptyLineAfterGuardClause: Exclude: - - "app/models/impressionist/bots.rb" + - 'app/models/impressionist/bots.rb' # Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: AllowAdjacentOneLineDefs, NumberOfEmptyLines. +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, DefLikeMacros, AllowAdjacentOneLineDefs, NumberOfEmptyLines. Layout/EmptyLineBetweenDefs: Exclude: - - "lib/impressionist/counter_cache.rb" + - 'lib/impressionist/counter_cache.rb' # Offense count: 6 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Layout/EmptyLines: Exclude: - - "Rakefile" - - "app/controllers/impressionist_controller.rb" - - "lib/impressionist/counter_cache.rb" - - "lib/impressionist/engine.rb" - - "lib/impressionist/models/mongoid/impressionist/impressionable.rb" + - 'Rakefile' + - 'app/controllers/impressionist_controller.rb' + - 'lib/impressionist/counter_cache.rb' + - 'lib/impressionist/engine.rb' + - 'lib/impressionist/models/mongoid/impressionist/impressionable.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: around, only_before Layout/EmptyLinesAroundAccessModifier: Exclude: - - "lib/impressionist/setup_association.rb" + - 'lib/impressionist/setup_association.rb' # Offense count: 6 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only Layout/EmptyLinesAroundClassBody: Exclude: - - "lib/generators/impressionist_generator.rb" - - "lib/impressionist/engine.rb" - - "lib/impressionist/models/active_record/impression.rb" - - "lib/impressionist/models/mongoid/impression.rb" - - "lib/impressionist/rails_toggle.rb" - - "lib/impressionist/update_counters.rb" + - 'lib/generators/impressionist_generator.rb' + - 'lib/impressionist/engine.rb' + - 'lib/impressionist/models/active_record/impression.rb' + - 'lib/impressionist/models/mongoid/impression.rb' + - 'lib/impressionist/rails_toggle.rb' + - 'lib/impressionist/update_counters.rb' -# Offense count: 4 -# Cop supports --auto-correct. +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). Layout/EmptyLinesAroundMethodBody: Exclude: - - "app/controllers/impressionist_controller.rb" - - "lib/impressionist/counter_cache.rb" - - "lib/impressionist/models/mongoid/impressionist/impressionable.rb" - - "upgrade_migrations/version_0_3_0.rb" + - 'lib/impressionist/counter_cache.rb' + - 'lib/impressionist/models/mongoid/impressionist/impressionable.rb' + - 'upgrade_migrations/version_0_3_0.rb' # Offense count: 19 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines Layout/EmptyLinesAroundModuleBody: Exclude: - - "app/models/impressionist/bots.rb" - - "app/models/impressionist/impressionable.rb" - - "lib/impressionist/counter_cache.rb" - - "lib/impressionist/is_impressionable.rb" - - "lib/impressionist/models/active_record/impressionist/impressionable.rb" - - "lib/impressionist/models/mongo_mapper/impressionist/impressionable.rb" - - "lib/impressionist/models/mongoid/impressionist/impressionable.rb" - - "lib/impressionist/rails_toggle.rb" - - "lib/impressionist/update_counters.rb" + - 'app/models/impressionist/bots.rb' + - 'app/models/impressionist/impressionable.rb' + - 'lib/impressionist/counter_cache.rb' + - 'lib/impressionist/is_impressionable.rb' + - 'lib/impressionist/models/active_record/impressionist/impressionable.rb' + - 'lib/impressionist/models/mongo_mapper/impressionist/impressionable.rb' + - 'lib/impressionist/models/mongoid/impressionist/impressionable.rb' + - 'lib/impressionist/rails_toggle.rb' + - 'lib/impressionist/update_counters.rb' # Offense count: 2 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment. Layout/ExtraSpacing: Exclude: - - "lib/impressionist/counter_cache.rb" + - 'lib/impressionist/counter_cache.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, IndentationWidth. # SupportedStyles: consistent, consistent_relative_to_receiver, special_for_inner_method_call, special_for_inner_method_call_in_parentheses Layout/FirstArgumentIndentation: Exclude: - - "lib/impressionist/controllers/mongoid/impressionist_controller.rb" + - 'lib/impressionist/controllers/mongoid/impressionist_controller.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. # SupportedHashRocketStyles: key, separator, table # SupportedColonStyles: key, separator, table # SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit Layout/HashAlignment: Exclude: - - "lib/impressionist/controllers/mongoid/impressionist_controller.rb" + - 'lib/impressionist/controllers/mongoid/impressionist_controller.rb' # Offense count: 18 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: normal, indented_internal_methods Layout/IndentationConsistency: Exclude: - - "lib/impressionist/counter_cache.rb" - - "lib/impressionist/engine.rb" - - "lib/impressionist/models/mongoid/impressionist/impressionable.rb" - - "lib/impressionist/rails_toggle.rb" - - "lib/impressionist/setup_association.rb" + - 'lib/impressionist/counter_cache.rb' + - 'lib/impressionist/engine.rb' + - 'lib/impressionist/models/mongoid/impressionist/impressionable.rb' + - 'lib/impressionist/rails_toggle.rb' + - 'lib/impressionist/setup_association.rb' # Offense count: 8 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: IndentationWidth, EnforcedStyle. # SupportedStyles: spaces, tabs Layout/IndentationStyle: Exclude: - - "lib/impressionist/controllers/mongoid/impressionist_controller.rb" + - 'lib/impressionist/controllers/mongoid/impressionist_controller.rb' # Offense count: 24 -# Cop supports --auto-correct. -# Configuration parameters: Width, IgnoredPatterns. +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Width, EnforcedStyleAlignWith, AllowedPatterns. +# SupportedStylesAlignWith: start_of_line, relative_to_receiver Layout/IndentationWidth: Exclude: - - "app/models/impressionist/impressionable.rb" - - "lib/impressionist/controllers/mongoid/impressionist_controller.rb" - - "lib/impressionist/counter_cache.rb" - - "lib/impressionist/engine.rb" - - "lib/impressionist/models/active_record/impressionist/impressionable.rb" - - "lib/impressionist/models/mongo_mapper/impressionist/impressionable.rb" - - "lib/impressionist/models/mongoid/impressionist/impressionable.rb" - - "lib/impressionist/rails_toggle.rb" - - "lib/impressionist/setup_association.rb" + - 'app/models/impressionist/impressionable.rb' + - 'lib/impressionist/controllers/mongoid/impressionist_controller.rb' + - 'lib/impressionist/counter_cache.rb' + - 'lib/impressionist/engine.rb' + - 'lib/impressionist/models/active_record/impressionist/impressionable.rb' + - 'lib/impressionist/models/mongo_mapper/impressionist/impressionable.rb' + - 'lib/impressionist/models/mongoid/impressionist/impressionable.rb' + - 'lib/impressionist/rails_toggle.rb' + - 'lib/impressionist/setup_association.rb' # Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment. +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment, AllowRBSInlineAnnotation, AllowSteepAnnotation. Layout/LeadingCommentSpace: Exclude: - - "app/controllers/impressionist_controller.rb" - - "lib/impressionist/bots.rb" + - 'app/controllers/impressionist_controller.rb' + - 'lib/impressionist/bots.rb' # Offense count: 6 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, IndentationWidth. # SupportedStyles: aligned, indented, indented_relative_to_receiver Layout/MultilineMethodCallIndentation: Exclude: - - "lib/impressionist/counter_cache.rb" - - "lib/impressionist/models/active_record/impressionist/impressionable.rb" - - "lib/impressionist/models/mongoid/impressionist/impressionable.rb" - - "lib/impressionist/setup_association.rb" - - "lib/impressionist/update_counters.rb" + - 'lib/impressionist/counter_cache.rb' + - 'lib/impressionist/models/active_record/impressionist/impressionable.rb' + - 'lib/impressionist/models/mongoid/impressionist/impressionable.rb' + - 'lib/impressionist/setup_association.rb' + - 'lib/impressionist/update_counters.rb' # Offense count: 21 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Layout/SpaceAfterComma: Exclude: - - "app/controllers/impressionist_controller.rb" - - "app/models/impressionist/bots.rb" - - "lib/impressionist/bots.rb" - - "upgrade_migrations/version_0_3_0.rb" + - 'app/controllers/impressionist_controller.rb' + - 'app/models/impressionist/bots.rb' + - 'lib/impressionist/bots.rb' + - 'upgrade_migrations/version_0_3_0.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyleInsidePipes. # SupportedStylesInsidePipes: space, no_space Layout/SpaceAroundBlockParameters: Exclude: - - "app/controllers/impressionist_controller.rb" + - 'app/controllers/impressionist_controller.rb' # Offense count: 13 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: space, no_space Layout/SpaceAroundEqualsInParameterDefault: Exclude: - - "app/controllers/impressionist_controller.rb" - - "app/models/impressionist/impressionable.rb" - - "lib/impressionist/controllers/mongoid/impressionist_controller.rb" - - "lib/impressionist/counter_cache.rb" - - "lib/impressionist/is_impressionable.rb" - - "lib/impressionist/models/mongo_mapper/impressionist/impressionable.rb" - - "lib/impressionist/models/mongoid/impressionist/impressionable.rb" + - 'app/controllers/impressionist_controller.rb' + - 'app/models/impressionist/impressionable.rb' + - 'lib/impressionist/controllers/mongoid/impressionist_controller.rb' + - 'lib/impressionist/counter_cache.rb' + - 'lib/impressionist/is_impressionable.rb' + - 'lib/impressionist/models/mongo_mapper/impressionist/impressionable.rb' + - 'lib/impressionist/models/mongoid/impressionist/impressionable.rb' # Offense count: 5 -# Cop supports --auto-correct. -# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator. +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator, EnforcedStyleForRationalLiterals. # SupportedStylesForExponentOperator: space, no_space +# SupportedStylesForRationalLiterals: space, no_space Layout/SpaceAroundOperators: Exclude: - - "app/controllers/impressionist_controller.rb" - - "lib/impressionist/controllers/mongoid/impressionist_controller.rb" - - "lib/impressionist/counter_cache.rb" - - "lib/impressionist/models/mongo_mapper/impression.rb" + - 'app/controllers/impressionist_controller.rb' + - 'lib/impressionist/controllers/mongoid/impressionist_controller.rb' + - 'lib/impressionist/counter_cache.rb' + - 'lib/impressionist/models/mongo_mapper/impression.rb' # Offense count: 2 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces. # SupportedStyles: space, no_space # SupportedStylesForEmptyBraces: space, no_space Layout/SpaceBeforeBlockBraces: Exclude: - - "app/controllers/impressionist_controller.rb" + - 'app/controllers/impressionist_controller.rb' # Offense count: 3 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters. # SupportedStyles: space, no_space # SupportedStylesForEmptyBraces: space, no_space Layout/SpaceInsideBlockBraces: Exclude: - - "app/controllers/impressionist_controller.rb" + - 'app/controllers/impressionist_controller.rb' # Offense count: 4 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces. # SupportedStyles: space, no_space, compact # SupportedStylesForEmptyBraces: space, no_space Layout/SpaceInsideHashLiteralBraces: Exclude: - - "app/controllers/impressionist_controller.rb" - - "lib/impressionist/update_counters.rb" + - 'app/controllers/impressionist_controller.rb' + - 'lib/impressionist/update_counters.rb' -# Offense count: 3 -# Cop supports --auto-correct. +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: final_newline, final_blank_line Layout/TrailingEmptyLines: Exclude: - - "Gemfile" - - "lib/impressionist/setup_association.rb" - - "upgrade_migrations/version_1_5_2.rb" + - 'lib/impressionist/setup_association.rb' + - 'upgrade_migrations/version_1_5_2.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowInHeredoc. Layout/TrailingWhitespace: Exclude: - - "lib/impressionist/setup_association.rb" + - 'lib/impressionist/setup_association.rb' # Offense count: 1 Lint/DuplicateMethods: Exclude: - - "lib/impressionist/setup_association.rb" + - 'lib/impressionist/setup_association.rb' # Offense count: 1 -# Cop supports --auto-correct. +# Configuration parameters: AllowComments. +Lint/EmptyClass: + Exclude: + - 'app/models/impression.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). Lint/RedundantStringCoercion: Exclude: - - "app/controllers/impressionist_controller.rb" + - 'app/controllers/impressionist_controller.rb' # Offense count: 2 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Lint/SendWithMixinArgument: Exclude: - - "lib/impressionist/models/active_record/impressionist/impressionable.rb" - - "lib/impressionist/models/mongoid/impressionist/impressionable.rb" + - 'lib/impressionist/models/active_record/impressionist/impressionable.rb' + - 'lib/impressionist/models/mongoid/impressionist/impressionable.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments. Lint/UnusedBlockArgument: Exclude: - - "lib/impressionist/engine.rb" + - 'lib/impressionist/engine.rb' # Offense count: 3 -# Configuration parameters: IgnoredMethods. +# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. Metrics/AbcSize: Max: 23 -# Offense count: 11 -# Configuration parameters: CountComments, ExcludedMethods. -# ExcludedMethods: refine -Metrics/BlockLength: - Max: 336 +# Offense count: 1 +# Configuration parameters: LengthThreshold. +Metrics/CollectionLiteralLength: + Exclude: + - 'app/models/impressionist/bots.rb' # Offense count: 3 -# Configuration parameters: CountComments, ExcludedMethods. +# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. Metrics/MethodLength: Max: 15 # Offense count: 2 -# Configuration parameters: CountComments. +# Configuration parameters: CountComments, CountAsOne. Metrics/ModuleLength: - Max: 1462 + Max: 1464 + +# Offense count: 4 +# Configuration parameters: Mode, AllowedMethods, AllowedPatterns, AllowBangMethods, WaywardPredicates. +# AllowedMethods: call +# WaywardPredicates: infinite?, nonzero? +Naming/PredicateMethod: + Exclude: + - 'app/controllers/impressionist_controller.rb' + - 'lib/impressionist/is_impressionable.rb' + - 'lib/impressionist/setup_association.rb' # Offense count: 2 -# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros. -# NamePrefix: is_, has_, have_ -# ForbiddenPrefixes: is_, has_, have_ +# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros, UseSorbetSigs. +# NamePrefix: is_, has_, have_, does_ +# ForbiddenPrefixes: is_, has_, have_, does_ # AllowedMethods: is_a? # MethodDefinitionMacros: define_method, define_singleton_method Naming/PredicatePrefix: Exclude: - - "spec/**/*" - - "lib/impressionist/is_impressionable.rb" - - "lib/impressionist/models/mongo_mapper/impressionist/impressionable.rb" + - 'lib/impressionist/is_impressionable.rb' + - 'lib/impressionist/models/mongo_mapper/impressionist/impressionable.rb' # Offense count: 6 -# Configuration parameters: Prefixes. +# Configuration parameters: Prefixes, AllowedPatterns. # Prefixes: when, with, without RSpec/ContextWording: Exclude: - - "spec/controllers/impressionist_uniqueness_spec.rb" - - "spec/controllers/widgets_controller_spec.rb" + - 'spec/controllers/impressionist_uniqueness_spec.rb' + - 'spec/controllers/widgets_controller_spec.rb' # Offense count: 31 -# Configuration parameters: Max. +# Configuration parameters: CountAsOne. RSpec/ExampleLength: - Exclude: - - "spec/controllers/articles_controller_spec.rb" - - "spec/controllers/impressionist_uniqueness_spec.rb" - - "spec/controllers/posts_controller_spec.rb" - - "spec/controllers/widgets_controller_spec.rb" - - "spec/rails_generators/rails_generators_spec.rb" - - "spec/setup_association_spec.rb" - -# Offense count: 5 -# Configuration parameters: CustomTransform, IgnoreMethods. -RSpec/SpecFilePathFormat: - Exclude: - - "spec/bots_spec.rb" - - "spec/controllers/impressionist_uniqueness_spec.rb" - - "spec/models/bots_spec.rb" - - "spec/rails_toggle_spec.rb" - - "spec/setup_association_spec.rb" + Max: 16 -# Offense count: 77 +# Offense count: 45 # Configuration parameters: AssignmentOnly. RSpec/InstanceVariable: Exclude: - - "spec/controllers/articles_controller_spec.rb" - - "spec/controllers/impressionist_uniqueness_spec.rb" - - "spec/controllers/widgets_controller_spec.rb" - - "spec/model_spec.rb" - - "spec/models/model_spec.rb" + - 'spec/controllers/articles_controller_spec.rb' + - 'spec/controllers/impressionist_uniqueness_spec.rb' + - 'spec/controllers/widgets_controller_spec.rb' -# Offense count: 5 +# Offense count: 2 # Configuration parameters: . # SupportedStyles: have_received, receive RSpec/MessageSpies: EnforcedStyle: receive -# Offense count: 29 -# Configuration parameters: AggregateFailuresByDefault. +# Offense count: 25 RSpec/MultipleExpectations: Max: 8 # Offense count: 4 +# Configuration parameters: AllowedGroups. RSpec/NestedGroups: Max: 4 # Offense count: 2 RSpec/RepeatedExample: Exclude: - - "spec/controllers/widgets_controller_spec.rb" - -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, Include. -# SupportedStyles: action, filter -# Include: app/controllers/**/*.rb -Rails/ActionFilter: - Exclude: - - "app/controllers/impressionist_controller.rb" + - 'spec/controllers/widgets_controller_spec.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports unsafe autocorrection (--autocorrect-all). Rails/ApplicationRecord: Exclude: - - "lib/impressionist/models/active_record/impression.rb" + - 'lib/impressionist/models/active_record/impression.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: NotNilAndNotEmpty, NotBlank, UnlessBlank. Rails/Present: Exclude: - - "app/controllers/impressionist_controller.rb" + - 'app/controllers/impressionist_controller.rb' # Offense count: 1 -# Configuration parameters: Include. -# Include: **/Rakefile, **/*.rake +# This cop supports unsafe autocorrection (--autocorrect-all). Rails/RakeEnvironment: Exclude: - - "lib/capistrano/tasks/**/*.rake" - - "Rakefile" + - 'Rakefile' # Offense count: 1 -# Configuration parameters: Blacklist, Whitelist. -# Blacklist: decrement!, decrement_counter, increment!, increment_counter, toggle!, touch, update_all, update_attribute, update_column, update_columns, update_counters +# Configuration parameters: ForbiddenMethods, AllowedMethods. +# ForbiddenMethods: decrement!, decrement_counter, increment!, increment_counter, insert, insert!, insert_all, insert_all!, toggle!, touch, touch_all, update_all, update_attribute, update_column, update_columns, update_counters, upsert, upsert_all Rails/SkipsModelValidations: Exclude: - - "lib/impressionist/update_counters.rb" + - 'lib/impressionist/update_counters.rb' # Offense count: 2 -# Cop supports --auto-correct. +# This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. # SupportedStyles: strict, flexible Rails/TimeZone: Exclude: - - "app/models/impressionist/impressionable.rb" - - "lib/impressionist/models/mongoid/impressionist/impressionable.rb" + - 'app/models/impressionist/impressionable.rb' + - 'lib/impressionist/models/mongoid/impressionist/impressionable.rb' # Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, IgnoredMethods, AllowBracesOnProceduralOneLiners, BracesRequiredMethods. +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods. # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces # ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object # FunctionalMethods: let, let!, subject, watch -# IgnoredMethods: lambda, proc, it +# AllowedMethods: lambda, proc, it Style/BlockDelimiters: Exclude: - - "lib/impressionist/counter_cache.rb" + - 'lib/impressionist/counter_cache.rb' # Offense count: 1 Style/ClassVars: Exclude: - - "lib/impressionist.rb" + - 'lib/impressionist.rb' # Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). Style/CommentedKeyword: Exclude: - - "app/models/impressionist/impressionable.rb" + - 'app/models/impressionist/impressionable.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions. # SupportedStyles: assign_to_condition, assign_inside_condition Style/ConditionalAssignment: Exclude: - - "app/controllers/impressionist_controller.rb" + - 'app/controllers/impressionist_controller.rb' -# Offense count: 24 +# Offense count: 23 +# Configuration parameters: AllowedConstants. Style/Documentation: Enabled: false # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Style/EachWithObject: Exclude: - - "app/controllers/impressionist_controller.rb" + - 'app/controllers/impressionist_controller.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Style/ExpandPathArguments: Exclude: - - "lib/generators/impressionist_generator.rb" + - 'lib/generators/impressionist_generator.rb' -# Offense count: 1 -# Cop supports --auto-correct. +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: format, sprintf, percent Style/FormatString: Exclude: - - "lib/generators/active_record/impressionist_generator.rb" + - 'lib/generators/active_record/impressionist_generator.rb' -# Offense count: 1 -# Configuration parameters: EnforcedStyle. -# SupportedStyles: annotated, template, unannotated -Style/FormatStringToken: - Exclude: - - "lib/generators/active_record/impressionist_generator.rb" - -# Offense count: 41 -# Cop supports --auto-correct. +# Offense count: 40 +# This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. # SupportedStyles: always, always_true, never Style/FrozenStringLiteralComment: Enabled: false -# Offense count: 3 -# Configuration parameters: MinBodyLength. +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals. Style/GuardClause: Exclude: - - "app/controllers/impressionist_controller.rb" + - 'app/controllers/impressionist_controller.rb' -# Offense count: 136 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. +# Offense count: 119 +# 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, either_consistent Style/HashSyntax: - Enabled: false + Exclude: + - 'app/controllers/impressionist_controller.rb' + - 'app/models/impressionist/impressionable.rb' + - 'lib/impressionist/controllers/mongoid/impressionist_controller.rb' + - 'lib/impressionist/is_impressionable.rb' + - 'lib/impressionist/models/mongo_mapper/impression.rb' + - 'lib/impressionist/models/mongo_mapper/impressionist/impressionable.rb' + - 'lib/impressionist/models/mongoid/impressionist/impressionable.rb' + - 'lib/impressionist/setup_association.rb' + - 'lib/impressionist/update_counters.rb' + - 'spec/controllers/impressionist_uniqueness_spec.rb' + - 'spec/counter_caching_spec.rb' + - 'spec/models/impression_spec.rb' + - 'spec/spec_helper.rb' + - 'upgrade_migrations/version_0_3_0.rb' + - 'upgrade_migrations/version_1_5_2.rb' # Offense count: 3 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Style/IfUnlessModifier: Exclude: - - "app/controllers/impressionist_controller.rb" - - "app/models/impressionist/impressionable.rb" + - 'app/controllers/impressionist_controller.rb' + - 'app/models/impressionist/impressionable.rb' # Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). Style/MultilineTernaryOperator: Exclude: - - "lib/impressionist/models/mongoid/impressionist/impressionable.rb" + - 'lib/impressionist/models/mongoid/impressionist/impressionable.rb' # Offense count: 5 -# Cop supports --auto-correct. +# This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. # SupportedStyles: literals, strict Style/MutableConstant: Exclude: - - "app/models/impressionist/bots.rb" - - "app/models/impressionist/impressionable.rb" - - "lib/impressionist/bots.rb" - - "lib/impressionist/version.rb" + - 'app/models/impressionist/bots.rb' + - 'app/models/impressionist/impressionable.rb' + - 'lib/impressionist/bots.rb' + - 'lib/impressionist/version.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Style/Not: Exclude: - - "lib/impressionist/rails_toggle.rb" + - 'lib/impressionist/rails_toggle.rb' # Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: Strict. +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Strict, AllowedNumbers, AllowedPatterns. Style/NumericLiterals: MinDigits: 6 # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Style/RedundantBegin: Exclude: - - "lib/impressionist/counter_cache.rb" + - 'lib/impressionist/counter_cache.rb' # Offense count: 2 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowMultipleReturnValues. Style/RedundantReturn: Exclude: - - "app/controllers/impressionist_controller.rb" + - 'app/controllers/impressionist_controller.rb' # Offense count: 4 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Style/RedundantSelf: Exclude: - - "app/controllers/impressionist_controller.rb" - - "lib/impressionist/counter_cache.rb" + - 'app/controllers/impressionist_controller.rb' + - 'lib/impressionist/counter_cache.rb' # Offense count: 2 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Style/RescueModifier: Exclude: - - "app/controllers/impressionist_controller.rb" + - 'app/controllers/impressionist_controller.rb' -# Offense count: 1670 -# Cop supports --auto-correct. +# Offense count: 1636 +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline. # SupportedStyles: single_quotes, double_quotes Style/StringLiterals: Enabled: false # Offense count: 40 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: MinSize. # SupportedStyles: percent, brackets Style/SymbolArray: EnforcedStyle: brackets # Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: IgnoredMethods. -# IgnoredMethods: respond_to, define_method +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments. +# AllowedMethods: define_method, mail, respond_to Style/SymbolProc: Exclude: - - "app/controllers/impressionist_controller.rb" + - 'app/controllers/impressionist_controller.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, AllowSafeAssignment. # SupportedStyles: require_parentheses, require_no_parentheses, require_parentheses_when_complex Style/TernaryParentheses: Exclude: - - "lib/impressionist/controllers/mongoid/impressionist_controller.rb" + - 'lib/impressionist/controllers/mongoid/impressionist_controller.rb' # Offense count: 2 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: MinSize, WordRegex. # SupportedStyles: percent, brackets Style/WordArray: EnforcedStyle: brackets -# Offense count: 401 -# Cop supports --auto-correct. -# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. +# Offense count: 46 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings. # URISchemes: http, https Layout/LineLength: Max: 197 - diff --git a/app/models/impressionist/bots.rb b/app/models/impressionist/bots.rb index aee7cf9c..9b61f8cf 100644 --- a/app/models/impressionist/bots.rb +++ b/app/models/impressionist/bots.rb @@ -8,7 +8,8 @@ def self.bot?(user_agent = nil) WILD_CARDS = ["bot","yahoo","slurp","google","msn","crawler"] - LIST = [" UnChaos From Chaos To Order Hybrid Web Search Engine.(vadim_gonchar@unchaos.com)", + LIST = [ + " UnChaos From Chaos To Order Hybrid Web Search Engine.(vadim_gonchar@unchaos.com)", " UnChaos Bot Hybrid Web Search Engine. (vadim_gonchar@unchaos.com)", " UnChaosBot From Chaos To Order UnChaos Hybrid Web Search Engine at www.unchaos.com (info@unchaos.com)", " http://www.sygol.com", @@ -1463,6 +1464,7 @@ def self.bot?(user_agent = nil) "Zippy v2.0 - Zippyfinder.com", "ZoomSpider - wrensoft.com", "zspider/0.9-dev http://feedback.redkolibri.com/", - "ZyBorg/1.0 (ZyBorg@WISEnut.com; http://www.WISEnut.com)"] + "ZyBorg/1.0 (ZyBorg@WISEnut.com; http://www.WISEnut.com)" + ] end end diff --git a/app/models/impressionist/impressionable.rb b/app/models/impressionist/impressionable.rb index 7bfd8e8d..4140fd90 100644 --- a/app/models/impressionist/impressionable.rb +++ b/app/models/impressionist/impressionable.rb @@ -5,7 +5,7 @@ module Impressionable module ClassMethods attr_accessor :impressionist_cache_options - DEFAULT_CACHE ||= { + DEFAULT_CACHE = { :counter_cache => false, :column_name => :impressions_count, :unique => :all @@ -22,7 +22,7 @@ def impressionist_counter_caching? end def counter_caching? - ::ActiveSupport::Deprecation.warn("#counter_caching? is deprecated; please use #impressionist_counter_caching? instead") + ActiveSupport::Deprecation.new('2.1', 'Impressionist').warn("#counter_caching? is deprecated; please use #impressionist_counter_caching? instead") impressionist_counter_caching? end @@ -33,10 +33,10 @@ def impressionist_count(options={}) options.reverse_merge!(:filter => :request_hash, :start_date => nil, :end_date => Time.now) # If a start_date is provided, finds impressions between then and the end_date. Otherwise returns all impressions - imps = options[:start_date].blank? ? impressions : impressions.where("created_at >= ? and created_at <= ?", options[:start_date], options[:end_date]) + imps = options[:start_date].blank? ? impressions : impressions.where(created_at: (options[:start_date])..(options[:end_date])) if options[:message] - imps = imps.where("impressions.message = ?", options[:message]) + imps = imps.where(impressions: { message: options[:message] }) end # Count all distinct impressions unless the :all filter is provided. diff --git a/lib/generators/active_record/impressionist_generator.rb b/lib/generators/active_record/impressionist_generator.rb index dc6ad5c0..aa658eb3 100644 --- a/lib/generators/active_record/impressionist_generator.rb +++ b/lib/generators/active_record/impressionist_generator.rb @@ -2,6 +2,7 @@ module ActiveRecord module Generators class ImpressionistGenerator < Rails::Generators::Base include Rails::Generators::Migration + source_root File.join(File.dirname(__FILE__), 'templates') def self.next_migration_number(dirname) diff --git a/lib/impressionist/controllers/mongoid/impressionist_controller.rb b/lib/impressionist/controllers/mongoid/impressionist_controller.rb index f07cb2f4..5e5a4a09 100644 --- a/lib/impressionist/controllers/mongoid/impressionist_controller.rb +++ b/lib/impressionist/controllers/mongoid/impressionist_controller.rb @@ -4,7 +4,7 @@ base = (defined? Moped) ? Moped::BSON : BSON query_params.reverse_merge!( :impressionable_type => controller_path.singularize.camelize, - :impressionable_id=> !base::ObjectId.legal?(params[:id]) ? params[:id] : base::ObjectId.from_string(params[:id]) + :impressionable_id=> base::ObjectId.legal?(params[:id]) ? base::ObjectId.from_string(params[:id]) : params[:id] ) associative_create_statement(query_params) end diff --git a/lib/impressionist/models/mongoid/impression.rb b/lib/impressionist/models/mongoid/impression.rb index 5e10e337..1bfac085 100644 --- a/lib/impressionist/models/mongoid/impression.rb +++ b/lib/impressionist/models/mongoid/impression.rb @@ -6,6 +6,7 @@ class Impression include Mongoid::Timestamps include Impressionist::CounterCache + Impressionist::SetupAssociation.new(self).set field :impressionable_id, type: BSON::ObjectId diff --git a/spec/controllers/articles_controller_spec.rb b/spec/controllers/articles_controller_spec.rb index e519b3bc..113ab160 100644 --- a/spec/controllers/articles_controller_spec.rb +++ b/spec/controllers/articles_controller_spec.rb @@ -31,7 +31,7 @@ expect(Impression.all.size).to eq 12 - expect(latest_impression.message).to eq nil + expect(latest_impression.message).to be_nil expect(latest_impression.controller_name).to eq 'articles' expect(latest_impression.action_name).to eq 'show' end @@ -46,7 +46,7 @@ it 'does not log the user_id if user is authenticated' do get :show, params: { id: 1 } - expect(Article.first.impressions.last.user_id).to eq nil + expect(Article.first.impressions.last.user_id).to be_nil end it 'logs the request_hash, ip_address, referrer and session_hash' do @@ -57,7 +57,7 @@ expect(impression.request_hash.size).to eq 64 expect(impression.ip_address).to eq '0.0.0.0' expect(impression.session_hash.size).to eq 32 - expect(impression.referrer).to eq nil + expect(impression.referrer).to be_nil end # Capybara has change the way it works @@ -80,7 +80,7 @@ expect(impression.request_hash.size).to eq 64 expect(impression.ip_address).to eq '0.0.0.0' expect(impression.session_hash.size).to eq 32 - expect(impression.referrer).to eq nil + expect(impression.referrer).to be_nil end it 'logs request with params: {}' do @@ -92,7 +92,7 @@ expect(impression.request_hash.size).to eq 64 expect(impression.ip_address).to eq '0.0.0.0' expect(impression.session_hash.size).to eq 32 - expect(impression.referrer).to eq nil + expect(impression.referrer).to be_nil end describe 'when filtering params' do diff --git a/spec/controllers/impressionist_uniqueness_spec.rb b/spec/controllers/impressionist_uniqueness_spec.rb index 2b1d9e08..0e947d8c 100644 --- a/spec/controllers/impressionist_uniqueness_spec.rb +++ b/spec/controllers/impressionist_uniqueness_spec.rb @@ -359,9 +359,7 @@ describe "impressionist filter and method uniqueness" do it "recognize uniqueness" do impressionable = Post.create - allow(controller).to receive(:controller_name).and_return("posts") # for correct impressionable type in filter - allow(controller).to receive(:params).and_return({ :id => impressionable.id.to_s }) # for correct impressionable id in filter - allow(controller).to receive(:session_hash).and_return("foo") + allow(controller).to receive_messages(controller_name: "posts", params: { :id => impressionable.id.to_s }, session_hash: "foo") allow(controller.request).to receive(:remote_ip).and_return("1.2.3.4") # order of the following methods is important for the test! controller.impressionist_subapp_filter(unique: [:ip_address, :request_hash, :session_hash]) @@ -374,9 +372,7 @@ it 'unique' do impressionable = Profile.create({ username: 'test_profile', slug: 'test_profile' }) - allow(controller).to receive(:controller_name).and_return('profile') - allow(controller).to receive(:action_name).and_return('show') - allow(controller).to receive(:params).and_return({ id: impressionable.slug }) + allow(controller).to receive_messages(controller_name: 'profile', action_name: 'show', params: { id: impressionable.slug }) allow(controller.request).to receive(:remote_ip).and_return('1.2.3.4') controller.impressionist(impressionable, nil, :unique => [:impressionable_type, :impressionable_id]) diff --git a/spec/rails_generators/rails_generators_spec.rb b/spec/rails_generators/rails_generators_spec.rb index 45bd238f..39e1e18e 100644 --- a/spec/rails_generators/rails_generators_spec.rb +++ b/spec/rails_generators/rails_generators_spec.rb @@ -5,8 +5,8 @@ # started fixing @nbit001 describe Impressionist, :migration do fixtures :articles, :impressions, :posts, :profiles - it "deletes existing migration and generate the migration file" do - pending + + it "deletes existing migration and generate the migration file", skip: "FIXME" do migrations_dir = Rails.root.join('db/migrate') impressions_migration = Dir.entries(migrations_dir).grep(/impressions/)[0] File.delete("#{migrations_dir}/#{impressions_migration}") if impressions_migration.present? @@ -15,8 +15,7 @@ Dir.entries(migrations_dir).include?(migration_name).should be_truthy end - it "runs the migration created in the previous spec" do - pending + it "runs the migration created in the previous spec", skip: "FIXME" do migrate_output = systemu("rake db:migrate RAILS_ENV=test") migrate_output[1].include?("CreateImpressionsTable: migrated").should be_truthy end diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 2318b794..aa36106a 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -6,6 +6,3 @@ require 'rspec/rails' require File.expand_path('./test_app/config/environment', __dir__) - -RSpec.configure do |config| -end diff --git a/spec/rails_toggle_spec.rb b/spec/rails_toggle_spec.rb index d2c12932..c8c777e9 100644 --- a/spec/rails_toggle_spec.rb +++ b/spec/rails_toggle_spec.rb @@ -7,13 +7,13 @@ let(:toggle) { described_class.new } context 'when using rails < 4' do - it 'will be included' do + it 'is included' do stub_const('::Rails::VERSION::MAJOR', 3) expect(toggle).to be_should_include end - it 'will not be included when strong parameters is defined' do + it 'does not be included when strong parameters is defined' do stub_const('::Rails::VERSION::MAJOR', 3) stub_const('StrongParameters', Module.new) @@ -22,7 +22,7 @@ end context 'when using rails >= 4' do - it 'will not be included' do + it 'does not be included' do stub_const('::Rails::VERSION::MAJOR', 4) expect(toggle).not_to be_should_include diff --git a/spec/setup_association_spec.rb b/spec/setup_association_spec.rb index 908c8105..b896a97f 100644 --- a/spec/setup_association_spec.rb +++ b/spec/setup_association_spec.rb @@ -8,14 +8,14 @@ let(:mock) { double } let(:setup_association) { described_class.new(mock) } - it 'will include when togglable' do + it 'includes when togglable' do allow(mock).to receive(:attr_accessible).and_return(true) allow(setup_association).to receive(:toggle).and_return(true) expect(setup_association).to be_include_attr_acc end - it 'will not include if it is not togglable' do + it 'does not include if it is not togglable' do allow(setup_association).to receive(:toggle).and_return(false) expect(setup_association).not_to be_include_attr_acc end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8eefba3e..178ee975 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -23,7 +23,7 @@ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration RSpec.configure do |config| - config.fixture_path = "spec/fixtures" + config.fixture_paths = ["spec/fixtures"] config.infer_spec_type_from_file_location! config.mock_with :rspec @@ -37,7 +37,5 @@ config.run_all_when_everything_filtered = true # make the rails logger usable in the tests as logger.xxx "..." - def logger - Rails.logger - end + delegate :logger, to: :Rails end From cf0f3b0a7504341135ca2e48e4b50b8e7b886a83 Mon Sep 17 00:00:00 2001 From: Matt McMahand Date: Sun, 8 Feb 2026 13:46:39 -0500 Subject: [PATCH 20/26] update timezone handling --- app/models/impressionist/impressionable.rb | 9 ++++++++- spec/dummy/config/environments/test.rb | 1 - spec/spec_helper.rb | 3 --- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/models/impressionist/impressionable.rb b/app/models/impressionist/impressionable.rb index 4140fd90..04797b58 100644 --- a/app/models/impressionist/impressionable.rb +++ b/app/models/impressionist/impressionable.rb @@ -33,7 +33,14 @@ def impressionist_count(options={}) options.reverse_merge!(:filter => :request_hash, :start_date => nil, :end_date => Time.now) # If a start_date is provided, finds impressions between then and the end_date. Otherwise returns all impressions - imps = options[:start_date].blank? ? impressions : impressions.where(created_at: (options[:start_date])..(options[:end_date])) + imps = if options[:start_date].blank? + impressions + else + # Parse date strings to ensure proper timezone handling + start_date = options[:start_date].is_a?(String) ? Date.parse(options[:start_date]) : options[:start_date] + end_date = options[:end_date].is_a?(String) ? Date.parse(options[:end_date]) : options[:end_date] + impressions.where(created_at: start_date..end_date) + end if options[:message] imps = imps.where(impressions: { message: options[:message] }) diff --git a/spec/dummy/config/environments/test.rb b/spec/dummy/config/environments/test.rb index 2fc7cc77..1d62e91b 100644 --- a/spec/dummy/config/environments/test.rb +++ b/spec/dummy/config/environments/test.rb @@ -8,7 +8,6 @@ config.cache_classes = false - # 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. diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 178ee975..349fed1a 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -35,7 +35,4 @@ # self explanatory # runs everything config.run_all_when_everything_filtered = true - - # make the rails logger usable in the tests as logger.xxx "..." - delegate :logger, to: :Rails end From 292a748cead99a6c05f1688506d2ccad4fe4f7fb Mon Sep 17 00:00:00 2001 From: Matt McMahand Date: Sun, 8 Feb 2026 13:49:08 -0500 Subject: [PATCH 21/26] cops --- .rubocop_todo.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 3c0f5538..ad3fca2a 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2026-02-08 18:36:41 UTC using RuboCop version 1.84.1. +# on 2026-02-08 18:48:27 UTC using RuboCop version 1.84.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 @@ -332,7 +332,7 @@ Lint/UnusedBlockArgument: # Offense count: 3 # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. Metrics/AbcSize: - Max: 23 + Max: 32 # Offense count: 1 # Configuration parameters: LengthThreshold. @@ -340,16 +340,26 @@ Metrics/CollectionLiteralLength: Exclude: - 'app/models/impressionist/bots.rb' +# Offense count: 1 +# Configuration parameters: AllowedMethods, AllowedPatterns. +Metrics/CyclomaticComplexity: + Max: 8 + # Offense count: 3 # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. Metrics/MethodLength: - Max: 15 + Max: 17 # Offense count: 2 # Configuration parameters: CountComments, CountAsOne. Metrics/ModuleLength: Max: 1464 +# Offense count: 1 +# Configuration parameters: AllowedMethods, AllowedPatterns. +Metrics/PerceivedComplexity: + Max: 10 + # Offense count: 4 # Configuration parameters: Mode, AllowedMethods, AllowedPatterns, AllowBangMethods, WaywardPredicates. # AllowedMethods: call @@ -638,7 +648,7 @@ Style/TernaryParentheses: Style/WordArray: EnforcedStyle: brackets -# Offense count: 46 +# Offense count: 45 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings. # URISchemes: http, https From cf9c14a94ab50dd6b3de3f8dada106dd562a7bdc Mon Sep 17 00:00:00 2001 From: Matt McMahand Date: Sun, 8 Feb 2026 13:49:33 -0500 Subject: [PATCH 22/26] bust cache --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8c941102..b30f15f1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,7 +15,6 @@ jobs: with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - cache-version: 1 - name: setup app run: | cd spec/dummy From 6b9840eeaadd59676ff9bc2700eeae57032220f3 Mon Sep 17 00:00:00 2001 From: Matt McMahand Date: Sun, 8 Feb 2026 13:56:15 -0500 Subject: [PATCH 23/26] remove counter_caching? --- app/models/impressionist/impressionable.rb | 5 ----- spec/counter_caching_spec.rb | 12 ------------ 2 files changed, 17 deletions(-) diff --git a/app/models/impressionist/impressionable.rb b/app/models/impressionist/impressionable.rb index 04797b58..acf5f742 100644 --- a/app/models/impressionist/impressionable.rb +++ b/app/models/impressionist/impressionable.rb @@ -21,11 +21,6 @@ def impressionist_counter_caching? impressionist_counter_cache_options[:counter_cache] end - def counter_caching? - ActiveSupport::Deprecation.new('2.1', 'Impressionist').warn("#counter_caching? is deprecated; please use #impressionist_counter_caching? instead") - impressionist_counter_caching? - end - end # end of ClassMethods def impressionist_count(options={}) diff --git a/spec/counter_caching_spec.rb b/spec/counter_caching_spec.rb index 10852b6e..1c8709db 100644 --- a/spec/counter_caching_spec.rb +++ b/spec/counter_caching_spec.rb @@ -19,18 +19,6 @@ end end - describe "self#counter_caching?" do - it "knows when counter caching is enabled" do - allow(ActiveSupport::Deprecation).to receive(:warn) - expect(Widget).to be_counter_caching - end - - it "knows when counter caching is disabled" do - allow(ActiveSupport::Deprecation).to receive(:warn) - expect(Article).not_to be_counter_caching - end - end - describe "#update_impressionist_counter_cache" do it "updates the counter cache column to reflect the correct number of impressions" do expect do From c8331581f658ed93eff7255e75b81bee658438d5 Mon Sep 17 00:00:00 2001 From: Matt McMahand Date: Sun, 8 Feb 2026 14:32:55 -0500 Subject: [PATCH 24/26] bump to rails 7 --- impressionist.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/impressionist.gemspec b/impressionist.gemspec index a03be526..c7f1dfe0 100644 --- a/impressionist.gemspec +++ b/impressionist.gemspec @@ -19,7 +19,7 @@ Gem::Specification.new do |s| s.add_dependency "friendly_id", '~> 5.6' s.add_dependency 'nokogiri', '~> 1.19' - s.add_dependency 'rails', '>= 3.2.15' + s.add_dependency 'rails', '>= 7.2' s.metadata['rubygems_mfa_required'] = 'true' end From ee5f2848d61cdb4ab033eb7e2da85430196d9d1f Mon Sep 17 00:00:00 2001 From: Matt McMahand Date: Sun, 8 Feb 2026 15:42:22 -0500 Subject: [PATCH 25/26] add workflow to publish gem to github --- .github/workflows/publish.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..ce285a0e --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,28 @@ +name: Publish Gem to GitHub Packages + +on: + push: + branches: [master] + paths: + - "lib/*/version.rb" + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + + steps: + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - name: Checkout + uses: actions/checkout@v4 + - name: Build and publish to GitHub Packages + uses: actionshub/publish-gem-to-github@v1.0.13 + with: + token: ${{ secrets.GITHUB_TOKEN }} + owner: ${{ github.repository_owner }} From 757e2fe653b62c2e60488e76807f464a4afe367a Mon Sep 17 00:00:00 2001 From: Matt McMahand Date: Sun, 8 Feb 2026 15:59:15 -0500 Subject: [PATCH 26/26] reorder steps --- .github/workflows/publish.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ce285a0e..1cc19615 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -15,12 +15,10 @@ jobs: contents: read steps: - - name: Setup Ruby - uses: ruby/setup-ruby@v1 + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 with: bundler-cache: true - - name: Checkout - uses: actions/checkout@v4 - name: Build and publish to GitHub Packages uses: actionshub/publish-gem-to-github@v1.0.13 with: