Skip to content

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronLasseigne committed Nov 21, 2024
1 parent 6297466 commit 5f30226
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ RSpec/ContextWording:
Enabled: false
RSpec/ExampleLength:
Enabled: false
RSpec/FilePath:
Enabled: false
RSpec/LeakyConstantDeclaration:
Enabled: false
RSpec/MultipleDescribes:
Expand All @@ -63,3 +61,5 @@ RSpec/NotToNot:
EnforcedStyle: to_not
RSpec/ScatteredSetup:
Enabled: false
RSpec/SpecFilePathFormat:
Enabled: false
9 changes: 4 additions & 5 deletions active_interaction.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require_relative 'lib/active_interaction/version'

Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
Gem::Specification.new do |spec|
spec.name = 'active_interaction'
spec.version = ActiveInteraction::VERSION
spec.license = 'MIT'
Expand All @@ -16,7 +16,7 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
end

spec.summary = 'Manage application specific business logic.'
spec.description = <<~'TEXT'
spec.description = <<~TEXT
ActiveInteraction manages application-specific business logic. It is an
implementation of what are called service objects, interactors, or the
command pattern. No matter what you call it, its built to work seamlessly
Expand All @@ -34,7 +34,6 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
%w[CHANGELOG.md CONTRIBUTING.md LICENSE.md README.md] +
Dir.glob(File.join('lib', '**', '*.rb')) +
Dir.glob(File.join('lib', 'active_interaction', 'locale', '*.yml'))
spec.test_files = Dir.glob(File.join('spec', '**', '*.rb'))

spec.add_dependency 'activemodel', '>= 5.2', '< 9'
spec.add_dependency 'activesupport', '>= 5.2', '< 9'
Expand All @@ -45,9 +44,9 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
'kramdown' => ['~> 2.1'],
'rake' => ['~> 13.0'],
'rspec' => ['~> 3.5'],
'rubocop' => ['~> 1.26.1'],
'rubocop' => ['~> 1.68.0'],
'rubocop-rake' => ['~> 0.6.0'],
'rubocop-rspec' => ['~> 2.9.0'],
'rubocop-rspec' => ['~> 3.2.0'],
'sqlite3' => [],
'yard' => ['~> 0.9']
}.each do |name, versions|
Expand Down
2 changes: 1 addition & 1 deletion lib/active_interaction/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def merge_detail!(attribute, detail, message)
options = detail.dup
error = options.delete(:error)

add(attribute, error, **options.merge(message: message)) unless added?(attribute, error, **options)
add(attribute, error, **options, message: message) unless added?(attribute, error, **options)
else
merge_message!(attribute, detail, message)
end
Expand Down
6 changes: 3 additions & 3 deletions spec/active_interaction/array_input_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
context 'with children with errors' do
let(:child_filter) { ActiveInteraction::IntegerFilter.new(:'') }
let(:child_error) { ActiveInteraction::Filter::Error.new(child_filter, :invalid_type) }
let(:child1) { ActiveInteraction::Input.new(child_filter, value: 'a', error: child_error) }
let(:child2) { ActiveInteraction::Input.new(child_filter, value: 'b', error: child_error) }
let(:children) { [child1, child2] }
let(:child_a) { ActiveInteraction::Input.new(child_filter, value: 'a', error: child_error) }
let(:child_b) { ActiveInteraction::Input.new(child_filter, value: 'b', error: child_error) }
let(:children) { [child_a, child_b] }

context 'with an error on the array' do
let(:error) { ActiveInteraction::Filter::Error.new(filter, :invalid_type) }
Expand Down
6 changes: 3 additions & 3 deletions spec/active_interaction/concerns/active_modelable_spec.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
RSpec.shared_examples_for 'ActiveModel' do
it 'includes ActiveModel::Conversion' do
expect(subject).to be_a_kind_of ActiveModel::Conversion
expect(subject).to be_a ActiveModel::Conversion
end

it 'includes ActiveModel::Validations' do
expect(subject).to be_a_kind_of ActiveModel::Validations
expect(subject).to be_a ActiveModel::Validations
end

it 'extends ActiveModel::Naming' do
expect(subject.class).to be_a_kind_of ActiveModel::Naming
expect(subject.class).to be_a ActiveModel::Naming
end
end

Expand Down
6 changes: 3 additions & 3 deletions spec/active_interaction/concerns/missable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@

it 'yields' do
expect do |b|
instance.public_send(:boolean, *names, &b)
instance.boolean(*names, &b)
end.to yield_with_args(filter, names, {})
end
end
Expand All @@ -77,7 +77,7 @@

it 'yields' do
expect do |b|
instance.public_send(:boolean, options, &b)
instance.boolean(options, &b)
end.to yield_with_args(filter, [], options)
end
end
Expand All @@ -88,7 +88,7 @@

it 'yields' do
expect do |b|
instance.public_send(:boolean, *names, options, &b)
instance.boolean(*names, options, &b)
end.to yield_with_args(filter, names, options)
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/active_interaction/filters/array_filter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def to_ary

context 'with a nested interface type' do
context 'with the methods option set' do
let(:block) { proc { public_send(:interface, methods: %i[to_s]) } }
let(:block) { proc { interface(methods: %i[to_s]) } }

it 'has a filter with the right option' do
expect(filter.filters[:'0'].options).to have_key(:methods)
Expand All @@ -227,7 +227,7 @@ def to_ary
end

context 'with another option set' do
let(:block) { proc { public_send(:object, converter: :new) } }
let(:block) { proc { object(converter: :new) } }
let(:name) { :objects }

it 'has a filter with the right options' do
Expand Down
6 changes: 3 additions & 3 deletions spec/active_interaction/filters/object_filter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ObjectThings; end # rubocop:disable Lint/EmptyClass
it 'handles reconstantizing' do
expect(result.value).to eql value

Object.send(:remove_const, :ObjectThing)
Object.send(:remove_const, :ObjectThing) # rubocop:disable RSpec/RemoveConst
ObjectThing = BackupObjectThing # rubocop:disable Lint/ConstantDefinitionInBlock
value = ObjectThing.new

Expand All @@ -50,7 +50,7 @@ class ObjectThings; end # rubocop:disable Lint/EmptyClass
it 'handles reconstantizing subclasses' do
filter

Object.send(:remove_const, :ObjectThing)
Object.send(:remove_const, :ObjectThing) # rubocop:disable RSpec/RemoveConst
ObjectThing = BackupObjectThing # rubocop:disable Lint/ConstantDefinitionInBlock
class SubObjectThing < ObjectThing; end # rubocop:disable Lint/ConstantDefinitionInBlock
value = SubObjectThing.new
Expand All @@ -59,7 +59,7 @@ class SubObjectThing < ObjectThing; end # rubocop:disable Lint/ConstantDefinitio
end

context 'without the class available' do
before { Object.send(:remove_const, :ObjectThing) }
before { Object.send(:remove_const, :ObjectThing) } # rubocop:disable RSpec/RemoveConst

after { ObjectThing = BackupObjectThing } # rubocop:disable Lint/ConstantDefinitionInBlock

Expand Down
6 changes: 3 additions & 3 deletions spec/active_interaction/filters/record_filter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class RecordThings; end # rubocop:disable Lint/EmptyClass
it 'handles reconstantizing' do
expect(result.value).to eql value

Object.send(:remove_const, :RecordThing)
Object.send(:remove_const, :RecordThing) # rubocop:disable RSpec/RemoveConst
RecordThing = BackupRecordThing # rubocop:disable Lint/ConstantDefinitionInBlock
value = RecordThing.new

Expand All @@ -58,7 +58,7 @@ class RecordThings; end # rubocop:disable Lint/EmptyClass
it 'handles reconstantizing subclasses' do
filter

Object.send(:remove_const, :RecordThing)
Object.send(:remove_const, :RecordThing) # rubocop:disable RSpec/RemoveConst
RecordThing = BackupRecordThing # rubocop:disable Lint/ConstantDefinitionInBlock
class SubRecordThing < RecordThing; end # rubocop:disable Lint/ConstantDefinitionInBlock
value = SubRecordThing.new
Expand All @@ -67,7 +67,7 @@ class SubRecordThing < RecordThing; end # rubocop:disable Lint/ConstantDefinitio
end

context 'without the class available' do
before { Object.send(:remove_const, :RecordThing) }
before { Object.send(:remove_const, :RecordThing) } # rubocop:disable RSpec/RemoveConst

after { RecordThing = BackupRecordThing } # rubocop:disable Lint/ConstantDefinitionInBlock

Expand Down
6 changes: 4 additions & 2 deletions spec/active_interaction/filters/time_filter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@
klass = double
allow(klass).to receive(:parse).with(value).and_return(nil)

allow(filter).to receive(:matches?).and_return(false)
allow(filter).to receive(:klass).and_return(klass)
allow(filter).to receive_messages(
matches?: false,
klass: klass
)
end

it 'indicates an error the string is not parsable' do
Expand Down
2 changes: 1 addition & 1 deletion spec/active_interaction/inputs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
end

context 'with ActionController::Parameters inputs' do
let(:args) { ::ActionController::Parameters.new }
let(:args) { ActionController::Parameters.new }

it 'does not raise an error' do
expect { result }.to_not raise_error
Expand Down
2 changes: 2 additions & 0 deletions spec/active_interaction/integration/array_interaction_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ class Element < ActiveRecord::Base
RSpec.describe ArrayInteraction do
include_context 'interactions'
it_behaves_like 'an interaction', :array, -> { [] }
# rubocop:disable Style/SymbolProc
it_behaves_like 'an interaction', :array, -> { Element.where('1 = 1') }, ->(result) { result.to_a }
it_behaves_like 'an interaction', :array, -> { List.create!.elements }, ->(result) { result.to_a }
# rubocop:enable Style/SymbolProc

context 'with inputs[:a]' do
let(:a) { [[]] }
Expand Down
File renamed without changes.

0 comments on commit 5f30226

Please sign in to comment.