Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require:
plugins:
- rubocop-rails
- rubocop-rspec
- rubocop-performance
Expand Down
44 changes: 4 additions & 40 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,18 @@
# 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.
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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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'
Expand All @@ -156,20 +133,13 @@ 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:
Exclude:
- '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).
Expand All @@ -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:
Expand All @@ -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.
Expand Down
9 changes: 9 additions & 0 deletions gemfiles/rails_7.2.gemfile
Original file line number Diff line number Diff line change
@@ -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: "../"
1 change: 1 addition & 0 deletions lib/webhook_system.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# frozen_string_literal: true

require 'logger'
require 'active_support/all'
require 'active_record'
require 'active_job'
Expand Down
4 changes: 2 additions & 2 deletions lib/webhook_system/event_log.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion lib/webhook_system/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module WebhookSystem
VERSION = '2.4.1'
VERSION = '2.4.2'
end
1 change: 1 addition & 0 deletions spec/support/rails_seven_one.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

module ActiveSupport
module Testing
# :nodoc:
module Assertions
# Assertion that the block should not raise an exception.
#
Expand Down
8 changes: 4 additions & 4 deletions webhook_system.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down