diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9a57e1..162a3d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,11 +13,11 @@ on: jobs: test: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: - gemfile: ['rails_7.0', 'rails_7.1'] + gemfile: ['rails_7.0', 'rails_7.1', 'rails_7.2'] ruby: [3.3, 3.2, 3.1] include: - gemfile: rails_7.0 @@ -26,14 +26,6 @@ jobs: ruby: 2.7 - gemfile: rails_6.1 ruby: 2.7 - - gemfile: rails_6.0 - ruby: 2.7 - - gemfile: rails_5.2 - ruby: 2.7 - - gemfile: rails_5.1 - ruby: 2.7 - - gemfile: rails_5.0 - ruby: 2.7 env: BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile diff --git a/.rubocop.yml b/.rubocop.yml index 6565e06..68d0f96 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,4 +1,4 @@ -require: +plugins: - rubocop-rails - rubocop-rspec - rubocop-performance diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 009c986..348ccca 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,19 +1,11 @@ # This configuration was generated by -# `rubocop --auto-gen-config --exclude-limit 180` -# on 2023-10-30 03:57:18 UTC using RuboCop version 1.57.2. +# `rubocop --auto-gen-config` +# on 2025-04-23 09:45:32 UTC using RuboCop version 1.75.3. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include. -# Include: **/*.gemfile, **/Gemfile, **/gems.rb -Bundler/OrderedGems: - Exclude: - - 'gemfiles/rails_7.1.gemfile' - # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: AllowSafeAssignment. @@ -21,12 +13,6 @@ Lint/AssignmentInCondition: Exclude: - 'lib/webhook_system/subscription.rb' -# Offense count: 1 -# This cop supports unsafe autocorrection (--autocorrect-all). -Lint/RedundantDirGlobSort: - Exclude: - - 'spec/spec_helper.rb' - # Offense count: 1 Lint/UnreachableCode: Exclude: @@ -71,16 +57,6 @@ RSpec/DescribeClass: RSpec/ExampleLength: Max: 24 -# Offense count: 4 -# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly. -# Include: **/*_spec*rb*, **/spec/**/* -RSpec/FilePath: - Exclude: - - 'spec/encoder_spec.rb' - - 'spec/event_log_spec.rb' - - 'spec/event_spec.rb' - - 'spec/models_spec.rb' - # Offense count: 11 # Configuration parameters: Max, AllowedIdentifiers, AllowedPatterns. RSpec/IndexedLet: @@ -136,6 +112,7 @@ RSpec/NestedGroups: # Offense count: 3 # This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AutoCorrect. RSpec/ScatteredSetup: Exclude: - 'spec/models_spec.rb' @@ -156,12 +133,6 @@ RSpec/VerifiedDoubles: Exclude: - 'spec/event_log_spec.rb' -# Offense count: 1 -# This cop supports unsafe autocorrection (--autocorrect-all). -Rails/RedundantPresenceValidationOnBelongsTo: - Exclude: - - 'lib/webhook_system/event_log.rb' - # Offense count: 3 # Configuration parameters: AllowedConstants. Style/Documentation: @@ -169,7 +140,6 @@ Style/Documentation: - 'lib/webhook_system.rb' - 'lib/webhook_system/encoder.rb' - 'lib/webhook_system/subscription_topic.rb' - - 'spec/support/rails_seven_one.rb' # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). @@ -178,7 +148,7 @@ Style/MultilineIfModifier: - 'spec/support/rails_seven_one.rb' # Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). +# This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle, AllowedCompactTypes. # SupportedStyles: compact, exploded Style/RaiseArgs: @@ -191,12 +161,6 @@ Style/RedundantConstantBase: Exclude: - 'spec/event_spec.rb' -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Style/RedundantFreeze: - Exclude: - - 'lib/webhook_system/subscription.rb' - # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, AllowInnerSlashes. diff --git a/gemfiles/rails_7.2.gemfile b/gemfiles/rails_7.2.gemfile new file mode 100644 index 0000000..943e32e --- /dev/null +++ b/gemfiles/rails_7.2.gemfile @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +gem "active_attr", "~> 0.16" # git: "https://github.com/mathieujobin/active_attr", branch: "rails-7.1-support" +gem "rails", "~> 7.2.2.1" +gem "sqlite3" + +gemspec path: "../" diff --git a/lib/webhook_system.rb b/lib/webhook_system.rb index 9d2ef4d..e58db7a 100644 --- a/lib/webhook_system.rb +++ b/lib/webhook_system.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require 'logger' require 'active_support/all' require 'active_record' require 'active_job' diff --git a/lib/webhook_system/event_log.rb b/lib/webhook_system/event_log.rb index 192084a..9fa0a82 100644 --- a/lib/webhook_system/event_log.rb +++ b/lib/webhook_system/event_log.rb @@ -15,8 +15,8 @@ class EventLog < ActiveRecord::Base validates :event_name, presence: true validates :status, presence: true - serialize :request, JSON - serialize :response, JSON + serialize :request, coder: JSON + serialize :response, coder: JSON def self.construct(subscription, event, request, response) request_info = { diff --git a/lib/webhook_system/version.rb b/lib/webhook_system/version.rb index fd5f19c..00ad6f3 100644 --- a/lib/webhook_system/version.rb +++ b/lib/webhook_system/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module WebhookSystem - VERSION = '2.4.1' + VERSION = '2.4.2' end diff --git a/spec/support/rails_seven_one.rb b/spec/support/rails_seven_one.rb index 9c92360..cbce39d 100644 --- a/spec/support/rails_seven_one.rb +++ b/spec/support/rails_seven_one.rb @@ -4,6 +4,7 @@ module ActiveSupport module Testing + # :nodoc: module Assertions # Assertion that the block should not raise an exception. # diff --git a/webhook_system.gemspec b/webhook_system.gemspec index b932e9b..096f6be 100644 --- a/webhook_system.gemspec +++ b/webhook_system.gemspec @@ -37,15 +37,15 @@ Gem::Specification.new do |gem| } gem.required_ruby_version = '> 2.7.0' - gem.add_runtime_dependency 'activesupport', '> 5.0', '< 7.2' - gem.add_runtime_dependency 'activerecord', '> 5.0', '< 7.2' - gem.add_runtime_dependency 'activejob', '> 5.0', '< 7.2' + gem.add_runtime_dependency 'activesupport', '> 5.0', '< 8.0' + gem.add_runtime_dependency 'activerecord', '> 5.0', '< 8.0' + gem.add_runtime_dependency 'activejob', '> 5.0', '< 8.0' gem.add_runtime_dependency 'faraday', '> 0.9' gem.add_runtime_dependency 'faraday-encoding', '>= 0.0.2', '< 1.0' gem.add_runtime_dependency 'ph_model' gem.add_runtime_dependency 'validate_url', '~> 1.0' - gem.add_development_dependency 'bundler', '> 1.17', '< 2.6' + gem.add_development_dependency 'bundler', '> 1.17', '< 2.7' gem.add_development_dependency 'coveralls_reborn', '~> 0.25' gem.add_development_dependency 'simplecov-lcov' gem.add_development_dependency 'rake'