active_interaction 3.8.3 → 4.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +193 -0
  3. data/README.md +97 -116
  4. data/lib/active_interaction.rb +2 -7
  5. data/lib/active_interaction/base.rb +44 -67
  6. data/lib/active_interaction/concerns/active_modelable.rb +1 -3
  7. data/lib/active_interaction/concerns/active_recordable.rb +1 -6
  8. data/lib/active_interaction/concerns/hashable.rb +0 -1
  9. data/lib/active_interaction/concerns/missable.rb +0 -1
  10. data/lib/active_interaction/concerns/runnable.rb +6 -12
  11. data/lib/active_interaction/errors.rb +4 -19
  12. data/lib/active_interaction/filter.rb +66 -37
  13. data/lib/active_interaction/filter_column.rb +0 -3
  14. data/lib/active_interaction/filters/abstract_date_time_filter.rb +38 -36
  15. data/lib/active_interaction/filters/abstract_numeric_filter.rb +27 -17
  16. data/lib/active_interaction/filters/array_filter.rb +59 -36
  17. data/lib/active_interaction/filters/boolean_filter.rb +26 -12
  18. data/lib/active_interaction/filters/date_filter.rb +1 -2
  19. data/lib/active_interaction/filters/date_time_filter.rb +1 -2
  20. data/lib/active_interaction/filters/decimal_filter.rb +10 -28
  21. data/lib/active_interaction/filters/file_filter.rb +6 -5
  22. data/lib/active_interaction/filters/float_filter.rb +1 -2
  23. data/lib/active_interaction/filters/hash_filter.rb +37 -27
  24. data/lib/active_interaction/filters/integer_filter.rb +7 -8
  25. data/lib/active_interaction/filters/interface_filter.rb +48 -14
  26. data/lib/active_interaction/filters/object_filter.rb +23 -50
  27. data/lib/active_interaction/filters/record_filter.rb +10 -35
  28. data/lib/active_interaction/filters/string_filter.rb +21 -12
  29. data/lib/active_interaction/filters/symbol_filter.rb +13 -7
  30. data/lib/active_interaction/filters/time_filter.rb +24 -19
  31. data/lib/active_interaction/grouped_input.rb +0 -3
  32. data/lib/active_interaction/inputs.rb +120 -0
  33. data/lib/active_interaction/modules/validation.rb +9 -21
  34. data/lib/active_interaction/version.rb +1 -3
  35. data/spec/active_interaction/base_spec.rb +38 -99
  36. data/spec/active_interaction/concerns/active_modelable_spec.rb +0 -2
  37. data/spec/active_interaction/concerns/active_recordable_spec.rb +0 -2
  38. data/spec/active_interaction/concerns/hashable_spec.rb +0 -2
  39. data/spec/active_interaction/concerns/missable_spec.rb +0 -2
  40. data/spec/active_interaction/concerns/runnable_spec.rb +9 -13
  41. data/spec/active_interaction/errors_spec.rb +4 -25
  42. data/spec/active_interaction/filter_column_spec.rb +0 -2
  43. data/spec/active_interaction/filter_spec.rb +0 -2
  44. data/spec/active_interaction/filters/abstract_date_time_filter_spec.rb +1 -3
  45. data/spec/active_interaction/filters/abstract_numeric_filter_spec.rb +1 -3
  46. data/spec/active_interaction/filters/array_filter_spec.rb +62 -13
  47. data/spec/active_interaction/filters/boolean_filter_spec.rb +58 -4
  48. data/spec/active_interaction/filters/date_filter_spec.rb +43 -3
  49. data/spec/active_interaction/filters/date_time_filter_spec.rb +43 -3
  50. data/spec/active_interaction/filters/decimal_filter_spec.rb +57 -3
  51. data/spec/active_interaction/filters/file_filter_spec.rb +1 -3
  52. data/spec/active_interaction/filters/float_filter_spec.rb +60 -4
  53. data/spec/active_interaction/filters/hash_filter_spec.rb +19 -9
  54. data/spec/active_interaction/filters/integer_filter_spec.rb +49 -7
  55. data/spec/active_interaction/filters/interface_filter_spec.rb +397 -24
  56. data/spec/active_interaction/filters/object_filter_spec.rb +23 -59
  57. data/spec/active_interaction/filters/record_filter_spec.rb +23 -49
  58. data/spec/active_interaction/filters/string_filter_spec.rb +15 -3
  59. data/spec/active_interaction/filters/symbol_filter_spec.rb +15 -3
  60. data/spec/active_interaction/filters/time_filter_spec.rb +65 -3
  61. data/spec/active_interaction/grouped_input_spec.rb +0 -2
  62. data/spec/active_interaction/i18n_spec.rb +3 -7
  63. data/spec/active_interaction/{modules/input_processor_spec.rb → inputs_spec.rb} +35 -5
  64. data/spec/active_interaction/integration/array_interaction_spec.rb +18 -22
  65. data/spec/active_interaction/integration/boolean_interaction_spec.rb +0 -2
  66. data/spec/active_interaction/integration/date_interaction_spec.rb +0 -2
  67. data/spec/active_interaction/integration/date_time_interaction_spec.rb +0 -2
  68. data/spec/active_interaction/integration/file_interaction_spec.rb +0 -2
  69. data/spec/active_interaction/integration/float_interaction_spec.rb +0 -2
  70. data/spec/active_interaction/integration/hash_interaction_spec.rb +1 -3
  71. data/spec/active_interaction/integration/integer_interaction_spec.rb +0 -2
  72. data/spec/active_interaction/integration/interface_interaction_spec.rb +1 -3
  73. data/spec/active_interaction/integration/object_interaction_spec.rb +0 -2
  74. data/spec/active_interaction/integration/string_interaction_spec.rb +0 -2
  75. data/spec/active_interaction/integration/symbol_interaction_spec.rb +0 -2
  76. data/spec/active_interaction/integration/time_interaction_spec.rb +14 -18
  77. data/spec/active_interaction/modules/validation_spec.rb +1 -3
  78. data/spec/spec_helper.rb +2 -12
  79. data/spec/support/concerns.rb +0 -2
  80. data/spec/support/filters.rb +13 -9
  81. data/spec/support/interactions.rb +22 -14
  82. metadata +92 -62
  83. data/lib/active_interaction/backports.rb +0 -59
  84. data/lib/active_interaction/filters/abstract_filter.rb +0 -19
  85. data/lib/active_interaction/modules/input_processor.rb +0 -52
  86. data/spec/active_interaction/filters/abstract_filter_spec.rb +0 -8
@@ -1,14 +1,13 @@
1
- # coding: utf-8
2
-
3
1
  require 'spec_helper'
4
2
 
5
- describe ActiveInteraction::InputProcessor do
3
+ describe ActiveInteraction::Inputs do
4
+ subject(:inputs) { described_class.new }
5
+
6
6
  describe '.reserved?(name)' do
7
7
  it 'returns true for anything starting with "_interaction_"' do
8
8
  expect(described_class.reserved?('_interaction_')).to be_truthy
9
9
  end
10
10
 
11
- # rubocop:disable Metrics/LineLength
12
11
  it 'returns true for existing instance methods' do
13
12
  (
14
13
  (ActiveInteraction::Base.instance_methods - Object.instance_methods) +
@@ -17,7 +16,6 @@ describe ActiveInteraction::InputProcessor do
17
16
  expect(described_class.reserved?(method)).to be_truthy
18
17
  end
19
18
  end
20
- # rubocop:enable Metrics/LineLength
21
19
 
22
20
  it 'returns false for anything else' do
23
21
  expect(described_class.reserved?(SecureRandom.hex)).to be_falsey
@@ -28,6 +26,38 @@ describe ActiveInteraction::InputProcessor do
28
26
  let(:inputs) { {} }
29
27
  let(:result) { described_class.process(inputs) }
30
28
 
29
+ context 'with invalid inputs' do
30
+ let(:inputs) { nil }
31
+
32
+ it 'raises an error' do
33
+ expect { result }.to raise_error ArgumentError
34
+ end
35
+ end
36
+
37
+ context 'with non-hash inputs' do
38
+ let(:inputs) { [%i[k v]] }
39
+
40
+ it 'raises an error' do
41
+ expect { result }.to raise_error ArgumentError
42
+ end
43
+ end
44
+
45
+ context 'with ActionController::Parameters inputs' do
46
+ let(:inputs) { ActionController::Parameters.new }
47
+
48
+ it 'does not raise an error' do
49
+ expect { result }.to_not raise_error
50
+ end
51
+ end
52
+
53
+ context 'with Inputs inputs' do
54
+ let(:inputs) { ActiveInteraction::Inputs.new }
55
+
56
+ it 'does not raise an error' do
57
+ expect { result }.to_not raise_error
58
+ end
59
+ end
60
+
31
61
  context 'with simple inputs' do
32
62
  before { inputs[:key] = :value }
33
63
 
@@ -1,29 +1,27 @@
1
- # coding: utf-8
2
-
3
1
  require 'spec_helper'
4
2
  require 'active_record'
5
- unless defined?(JRUBY_VERSION) # rubocop:disable Style/IfUnlessModifier
3
+ if defined?(JRUBY_VERSION)
4
+ require 'activerecord-jdbcsqlite3-adapter'
5
+ else
6
6
  require 'sqlite3'
7
7
  end
8
8
 
9
- unless defined?(JRUBY_VERSION)
10
- ActiveRecord::Base.establish_connection(
11
- adapter: 'sqlite3',
12
- database: ':memory:'
13
- )
9
+ ActiveRecord::Base.establish_connection(
10
+ adapter: 'sqlite3',
11
+ database: ':memory:'
12
+ )
14
13
 
15
- ActiveRecord::Schema.define do
16
- create_table(:lists)
17
- create_table(:elements) { |t| t.column(:list_id, :integer) }
18
- end
14
+ ActiveRecord::Schema.define do
15
+ create_table(:lists)
16
+ create_table(:elements) { |t| t.column(:list_id, :integer) }
17
+ end
19
18
 
20
- class List < ActiveRecord::Base
21
- has_many :elements
22
- end
19
+ class List < ActiveRecord::Base
20
+ has_many :elements
21
+ end
23
22
 
24
- class Element < ActiveRecord::Base
25
- belongs_to :list
26
- end
23
+ class Element < ActiveRecord::Base
24
+ belongs_to :list
27
25
  end
28
26
 
29
27
  ArrayInteraction = Class.new(TestInteraction) do
@@ -38,10 +36,8 @@ end
38
36
  describe ArrayInteraction do
39
37
  include_context 'interactions'
40
38
  it_behaves_like 'an interaction', :array, -> { [] }
41
- unless defined?(JRUBY_VERSION)
42
- it_behaves_like 'an interaction', :array, -> { Element.where('1 = 1') }
43
- it_behaves_like 'an interaction', :array, -> { List.create!.elements }
44
- end
39
+ it_behaves_like 'an interaction', :array, -> { Element.where('1 = 1') }
40
+ it_behaves_like 'an interaction', :array, -> { List.create!.elements }
45
41
 
46
42
  context 'with inputs[:a]' do
47
43
  let(:a) { [[]] }
@@ -1,5 +1,3 @@
1
- # coding: utf-8
2
-
3
1
  require 'spec_helper'
4
2
 
5
3
  describe 'BooleanInteraction' do
@@ -1,5 +1,3 @@
1
- # coding: utf-8
2
-
3
1
  require 'spec_helper'
4
2
 
5
3
  describe 'DateInteraction' do
@@ -1,5 +1,3 @@
1
- # coding: utf-8
2
-
3
1
  require 'spec_helper'
4
2
 
5
3
  describe 'DateTimeInteraction' do
@@ -1,5 +1,3 @@
1
- # coding: utf-8
2
-
3
1
  require 'spec_helper'
4
2
  require 'action_dispatch'
5
3
 
@@ -1,5 +1,3 @@
1
- # coding: utf-8
2
-
3
1
  require 'spec_helper'
4
2
 
5
3
  describe 'FloatInteraction' do
@@ -1,5 +1,3 @@
1
- # coding: utf-8
2
-
3
1
  require 'spec_helper'
4
2
 
5
3
  HashInteraction = Class.new(TestInteraction) do
@@ -21,7 +19,7 @@ describe HashInteraction do
21
19
  before { inputs[:a] = a }
22
20
 
23
21
  it 'returns the correct value for :a' do
24
- expect(result[:a]).to eql a.with_indifferent_access
22
+ expect(result[:a]).to eql ActiveSupport::HashWithIndifferentAccess.new(a)
25
23
  end
26
24
 
27
25
  it 'returns the correct value for :b' do
@@ -1,5 +1,3 @@
1
- # coding: utf-8
2
-
3
1
  require 'spec_helper'
4
2
 
5
3
  describe 'IntegerInteraction' do
@@ -1,11 +1,9 @@
1
- # coding: utf-8
2
-
3
1
  require 'spec_helper'
4
2
  require 'json'
5
3
  require 'yaml'
6
4
 
7
5
  InterfaceInteraction = Class.new(TestInteraction) do
8
- interface :anything
6
+ interface :anything, methods: []
9
7
  end
10
8
 
11
9
  describe InterfaceInteraction do
@@ -1,5 +1,3 @@
1
- # coding: utf-8
2
-
3
1
  require 'spec_helper'
4
2
 
5
3
  ObjectInteraction = Class.new(TestInteraction) do
@@ -1,5 +1,3 @@
1
- # coding: utf-8
2
-
3
1
  require 'spec_helper'
4
2
 
5
3
  describe 'StringInteraction' do
@@ -1,5 +1,3 @@
1
- # coding: utf-8
2
-
3
1
  require 'spec_helper'
4
2
 
5
3
  describe 'SymbolInteraction' do
@@ -1,19 +1,5 @@
1
- # coding: utf-8
2
-
3
1
  require 'spec_helper'
4
2
 
5
- TimeZone = Class.new do
6
- def self.at(*args)
7
- TimeWithZone.new(Time.at(*args))
8
- end
9
-
10
- def self.parse(*args)
11
- TimeWithZone.new(Time.parse(*args))
12
- rescue ArgumentError
13
- nil
14
- end
15
- end
16
-
17
3
  TimeWithZone = Class.new do
18
4
  attr_reader :time
19
5
 
@@ -22,7 +8,17 @@ TimeWithZone = Class.new do
22
8
  end
23
9
 
24
10
  def ==(other)
25
- time == other.time
11
+ !other.nil? && time == other.time
12
+ end
13
+
14
+ def at(*args)
15
+ TimeWithZone.new(Time.at(*args) + 1)
16
+ end
17
+
18
+ def parse(*args)
19
+ TimeWithZone.new(Time.parse(*args) + 1)
20
+ rescue ArgumentError
21
+ nil
26
22
  end
27
23
  end
28
24
 
@@ -40,14 +36,14 @@ describe TimeInteraction do
40
36
  before do
41
37
  inputs[:a] = a
42
38
 
43
- allow(Time).to receive(:zone).and_return(TimeZone)
39
+ allow(Time).to receive(:zone).and_return(TimeWithZone.new(0))
44
40
  end
45
41
 
46
42
  context 'with an integer' do
47
43
  let(:a) { rand(1 << 16) }
48
44
 
49
45
  it 'returns the correct value' do
50
- expect(result[:a]).to eq TimeZone.at(a)
46
+ expect(result[:a]).to eq TimeWithZone.new(0).at(a)
51
47
  end
52
48
  end
53
49
 
@@ -55,7 +51,7 @@ describe TimeInteraction do
55
51
  let(:a) { '2011-12-13T14:15:16Z' }
56
52
 
57
53
  it 'returns the correct value' do
58
- expect(result[:a]).to eq TimeZone.parse(a)
54
+ expect(result[:a]).to eq TimeWithZone.new(0).parse(a)
59
55
  end
60
56
  end
61
57
 
@@ -1,5 +1,3 @@
1
- # coding: utf-8
2
-
3
1
  require 'spec_helper'
4
2
 
5
3
  describe ActiveInteraction::Validation do
@@ -50,7 +48,7 @@ describe ActiveInteraction::Validation do
50
48
  "#{ActiveInteraction::Base.i18n_scope}.types.#{filter.class.slug}"
51
49
  )
52
50
 
53
- expect(result).to eql [[filter.name, :invalid_type, type: type]]
51
+ expect(result).to eql [[filter.name, :invalid_type, { type: type }]]
54
52
  end
55
53
  end
56
54
 
data/spec/spec_helper.rb CHANGED
@@ -1,19 +1,9 @@
1
- # coding: utf-8
2
-
3
- # Disable code coverage for JRuby because it always reports 0% coverage.
4
- if RUBY_ENGINE != 'jruby'
5
- require 'coveralls'
6
- Coveralls.wear!
7
- end
8
-
9
1
  require 'i18n'
10
- if I18n.config.respond_to?(:enforce_available_locales)
11
- I18n.config.enforce_available_locales = true
12
- end
2
+ I18n.config.enforce_available_locales = true if I18n.config.respond_to?(:enforce_available_locales)
13
3
 
14
4
  require 'active_interaction'
15
5
 
16
- Dir['./spec/support/**/*.rb'].each { |f| require f }
6
+ Dir['./spec/support/**/*.rb'].sort.each { |f| require f }
17
7
 
18
8
  RSpec.configure do |config|
19
9
  config.run_all_when_everything_filtered = true
@@ -1,5 +1,3 @@
1
- # coding: utf-8
2
-
3
1
  shared_context 'concerns' do |concern|
4
2
  let(:klass) do
5
3
  Class.new do
@@ -1,5 +1,3 @@
1
- # coding: utf-8
2
-
3
1
  shared_context 'filters' do
4
2
  let(:block) { nil }
5
3
  let(:name) { SecureRandom.hex.to_sym }
@@ -49,12 +47,13 @@ shared_examples_for 'a filter' do
49
47
 
50
48
  describe '#cast' do
51
49
  let(:value) { nil }
50
+ let(:result) { filter.send(:cast, value, nil) }
52
51
 
53
52
  context 'optional' do
54
53
  include_context 'optional'
55
54
 
56
55
  it 'returns nil' do
57
- expect(filter.cast(value, nil)).to be_nil
56
+ expect(result).to be_nil
58
57
  end
59
58
  end
60
59
 
@@ -62,21 +61,26 @@ shared_examples_for 'a filter' do
62
61
  include_context 'required'
63
62
 
64
63
  it 'raises an error' do
65
- expect do
66
- filter.cast(value, nil)
67
- end.to raise_error ActiveInteraction::MissingValueError
64
+ expect { result }.to raise_error ActiveInteraction::MissingValueError
68
65
  end
69
66
 
70
67
  context 'with an invalid default' do
71
68
  let(:value) { Object.new }
72
69
 
73
70
  it 'raises an error' do
74
- expect do
75
- filter.cast(value, nil)
76
- end.to raise_error ActiveInteraction::InvalidValueError
71
+ expect { result }.to raise_error ActiveInteraction::InvalidValueError
77
72
  end
78
73
  end
79
74
  end
75
+
76
+ # BasicObject is missing a lot of methods
77
+ context 'with a BasicObject' do
78
+ let(:value) { BasicObject.new }
79
+
80
+ it 'raises an error' do
81
+ expect { result }.to raise_error ActiveInteraction::InvalidValueError
82
+ end
83
+ end
80
84
  end
81
85
 
82
86
  describe '#clean' do
@@ -1,5 +1,3 @@
1
- # coding: utf-8
2
-
3
1
  TestInteraction = Class.new(ActiveInteraction::Base) do
4
2
  def self.name
5
3
  SecureRandom.hex
@@ -22,15 +20,25 @@ shared_examples_for 'an interaction' do |type, generator, filter_options = {}|
22
20
  let(:described_class) do
23
21
  Class.new(TestInteraction) do
24
22
  public_send(type, :required, filter_options)
25
- public_send(type, :optional, filter_options.merge(default: nil))
23
+ public_send(type, :optional,
24
+ filter_options.merge(
25
+ default: nil
26
+ )
27
+ )
26
28
  public_send(type, :default,
27
- filter_options.merge(default: generator.call)
29
+ filter_options.merge(
30
+ default: generator.call
31
+ )
28
32
  )
29
- public_send(type, :defaults_1, :defaults_2,
30
- filter_options.merge(default: generator.call)
33
+ public_send(type, :defaults1, :defaults2,
34
+ filter_options.merge(
35
+ default: generator.call
36
+ )
31
37
  )
32
- public_send(type, :defaults_3,
33
- filter_options.merge(default: -> { required })
38
+ public_send(type, :defaults3,
39
+ filter_options.merge(
40
+ default: -> { required }
41
+ )
34
42
  )
35
43
  end
36
44
  end
@@ -81,16 +89,16 @@ shared_examples_for 'an interaction' do |type, generator, filter_options = {}|
81
89
  expect(result[:default]).to_not be_nil
82
90
  end
83
91
 
84
- it 'does not return nil for :defaults_1' do
85
- expect(result[:defaults_1]).to_not be_nil
92
+ it 'does not return nil for :defaults1' do
93
+ expect(result[:defaults1]).to_not be_nil
86
94
  end
87
95
 
88
- it 'does not return nil for :defaults_2' do
89
- expect(result[:defaults_2]).to_not be_nil
96
+ it 'does not return nil for :defaults2' do
97
+ expect(result[:defaults2]).to_not be_nil
90
98
  end
91
99
 
92
- it 'evaluates :defaults_3 in the interaction binding' do
93
- expect(result[:defaults_3]).to eql result[:required]
100
+ it 'evaluates :defaults3 in the interaction binding' do
101
+ expect(result[:defaults3]).to eql result[:required]
94
102
  end
95
103
 
96
104
  context 'with inputs[:optional]' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_interaction
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.3
4
+ version: 4.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Lasseigne
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-08-23 00:00:00.000000000 Z
12
+ date: 2021-07-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel
@@ -17,7 +17,7 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: '4'
20
+ version: '5'
21
21
  - - "<"
22
22
  - !ruby/object:Gem::Version
23
23
  version: '7'
@@ -27,7 +27,27 @@ dependencies:
27
27
  requirements:
28
28
  - - ">="
29
29
  - !ruby/object:Gem::Version
30
- version: '4'
30
+ version: '5'
31
+ - - "<"
32
+ - !ruby/object:Gem::Version
33
+ version: '7'
34
+ - !ruby/object:Gem::Dependency
35
+ name: activesupport
36
+ requirement: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '5'
41
+ - - "<"
42
+ - !ruby/object:Gem::Version
43
+ version: '7'
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: '5'
31
51
  - - "<"
32
52
  - !ruby/object:Gem::Version
33
53
  version: '7'
@@ -74,75 +94,89 @@ dependencies:
74
94
  - !ruby/object:Gem::Version
75
95
  version: '2.7'
76
96
  - !ruby/object:Gem::Dependency
77
- name: coveralls
97
+ name: kramdown
78
98
  requirement: !ruby/object:Gem::Requirement
79
99
  requirements:
80
100
  - - "~>"
81
101
  - !ruby/object:Gem::Version
82
- version: '0.8'
102
+ version: '2.1'
83
103
  type: :development
84
104
  prerelease: false
85
105
  version_requirements: !ruby/object:Gem::Requirement
86
106
  requirements:
87
107
  - - "~>"
88
108
  - !ruby/object:Gem::Version
89
- version: '0.8'
109
+ version: '2.1'
90
110
  - !ruby/object:Gem::Dependency
91
- name: kramdown
111
+ name: rake
92
112
  requirement: !ruby/object:Gem::Requirement
93
113
  requirements:
94
114
  - - "~>"
95
115
  - !ruby/object:Gem::Version
96
- version: '1.12'
116
+ version: '13.0'
97
117
  type: :development
98
118
  prerelease: false
99
119
  version_requirements: !ruby/object:Gem::Requirement
100
120
  requirements:
101
121
  - - "~>"
102
122
  - !ruby/object:Gem::Version
103
- version: '1.12'
123
+ version: '13.0'
104
124
  - !ruby/object:Gem::Dependency
105
- name: rake
125
+ name: rspec
106
126
  requirement: !ruby/object:Gem::Requirement
107
127
  requirements:
108
128
  - - "~>"
109
129
  - !ruby/object:Gem::Version
110
- version: '11.3'
130
+ version: '3.5'
111
131
  type: :development
112
132
  prerelease: false
113
133
  version_requirements: !ruby/object:Gem::Requirement
114
134
  requirements:
115
135
  - - "~>"
116
136
  - !ruby/object:Gem::Version
117
- version: '11.3'
137
+ version: '3.5'
118
138
  - !ruby/object:Gem::Dependency
119
- name: rspec
139
+ name: rubocop
120
140
  requirement: !ruby/object:Gem::Requirement
121
141
  requirements:
122
142
  - - "~>"
123
143
  - !ruby/object:Gem::Version
124
- version: '3.5'
144
+ version: 1.17.0
125
145
  type: :development
126
146
  prerelease: false
127
147
  version_requirements: !ruby/object:Gem::Requirement
128
148
  requirements:
129
149
  - - "~>"
130
150
  - !ruby/object:Gem::Version
131
- version: '3.5'
151
+ version: 1.17.0
132
152
  - !ruby/object:Gem::Dependency
133
- name: rubocop
153
+ name: rubocop-rake
154
+ requirement: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - "~>"
157
+ - !ruby/object:Gem::Version
158
+ version: 0.5.1
159
+ type: :development
160
+ prerelease: false
161
+ version_requirements: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - "~>"
164
+ - !ruby/object:Gem::Version
165
+ version: 0.5.1
166
+ - !ruby/object:Gem::Dependency
167
+ name: rubocop-rspec
134
168
  requirement: !ruby/object:Gem::Requirement
135
169
  requirements:
136
170
  - - "~>"
137
171
  - !ruby/object:Gem::Version
138
- version: 0.44.0
172
+ version: '2.1'
139
173
  type: :development
140
174
  prerelease: false
141
175
  version_requirements: !ruby/object:Gem::Requirement
142
176
  requirements:
143
177
  - - "~>"
144
178
  - !ruby/object:Gem::Version
145
- version: 0.44.0
179
+ version: '2.1'
146
180
  - !ruby/object:Gem::Dependency
147
181
  name: yard
148
182
  requirement: !ruby/object:Gem::Requirement
@@ -161,16 +195,16 @@ dependencies:
161
195
  name: sqlite3
162
196
  requirement: !ruby/object:Gem::Requirement
163
197
  requirements:
164
- - - '='
198
+ - - ">="
165
199
  - !ruby/object:Gem::Version
166
- version: 1.4.2
200
+ version: '0'
167
201
  type: :development
168
202
  prerelease: false
169
203
  version_requirements: !ruby/object:Gem::Requirement
170
204
  requirements:
171
- - - '='
205
+ - - ">="
172
206
  - !ruby/object:Gem::Version
173
- version: 1.4.2
207
+ version: '0'
174
208
  description: |2
175
209
  ActiveInteraction manages application-specific business logic. It is an
176
210
  implementation of the command pattern in Ruby.
@@ -186,7 +220,6 @@ files:
186
220
  - LICENSE.md
187
221
  - README.md
188
222
  - lib/active_interaction.rb
189
- - lib/active_interaction/backports.rb
190
223
  - lib/active_interaction/base.rb
191
224
  - lib/active_interaction/concerns/active_modelable.rb
192
225
  - lib/active_interaction/concerns/active_recordable.rb
@@ -197,7 +230,6 @@ files:
197
230
  - lib/active_interaction/filter.rb
198
231
  - lib/active_interaction/filter_column.rb
199
232
  - lib/active_interaction/filters/abstract_date_time_filter.rb
200
- - lib/active_interaction/filters/abstract_filter.rb
201
233
  - lib/active_interaction/filters/abstract_numeric_filter.rb
202
234
  - lib/active_interaction/filters/array_filter.rb
203
235
  - lib/active_interaction/filters/boolean_filter.rb
@@ -215,12 +247,12 @@ files:
215
247
  - lib/active_interaction/filters/symbol_filter.rb
216
248
  - lib/active_interaction/filters/time_filter.rb
217
249
  - lib/active_interaction/grouped_input.rb
250
+ - lib/active_interaction/inputs.rb
218
251
  - lib/active_interaction/locale/en.yml
219
252
  - lib/active_interaction/locale/fr.yml
220
253
  - lib/active_interaction/locale/it.yml
221
254
  - lib/active_interaction/locale/ja.yml
222
255
  - lib/active_interaction/locale/pt-BR.yml
223
- - lib/active_interaction/modules/input_processor.rb
224
256
  - lib/active_interaction/modules/validation.rb
225
257
  - lib/active_interaction/version.rb
226
258
  - spec/active_interaction/base_spec.rb
@@ -233,7 +265,6 @@ files:
233
265
  - spec/active_interaction/filter_column_spec.rb
234
266
  - spec/active_interaction/filter_spec.rb
235
267
  - spec/active_interaction/filters/abstract_date_time_filter_spec.rb
236
- - spec/active_interaction/filters/abstract_filter_spec.rb
237
268
  - spec/active_interaction/filters/abstract_numeric_filter_spec.rb
238
269
  - spec/active_interaction/filters/array_filter_spec.rb
239
270
  - spec/active_interaction/filters/boolean_filter_spec.rb
@@ -252,6 +283,7 @@ files:
252
283
  - spec/active_interaction/filters/time_filter_spec.rb
253
284
  - spec/active_interaction/grouped_input_spec.rb
254
285
  - spec/active_interaction/i18n_spec.rb
286
+ - spec/active_interaction/inputs_spec.rb
255
287
  - spec/active_interaction/integration/array_interaction_spec.rb
256
288
  - spec/active_interaction/integration/boolean_interaction_spec.rb
257
289
  - spec/active_interaction/integration/date_interaction_spec.rb
@@ -265,7 +297,6 @@ files:
265
297
  - spec/active_interaction/integration/string_interaction_spec.rb
266
298
  - spec/active_interaction/integration/symbol_interaction_spec.rb
267
299
  - spec/active_interaction/integration/time_interaction_spec.rb
268
- - spec/active_interaction/modules/input_processor_spec.rb
269
300
  - spec/active_interaction/modules/validation_spec.rb
270
301
  - spec/spec_helper.rb
271
302
  - spec/support/concerns.rb
@@ -286,63 +317,62 @@ required_ruby_version: !ruby/object:Gem::Requirement
286
317
  requirements:
287
318
  - - ">="
288
319
  - !ruby/object:Gem::Version
289
- version: '2'
320
+ version: '2.5'
290
321
  required_rubygems_version: !ruby/object:Gem::Requirement
291
322
  requirements:
292
323
  - - ">="
293
324
  - !ruby/object:Gem::Version
294
325
  version: '0'
295
326
  requirements: []
296
- rubygems_version: 3.1.2
327
+ rubygems_version: 3.2.3
297
328
  signing_key:
298
329
  specification_version: 4
299
330
  summary: Manage application specific business logic.
300
331
  test_files:
301
- - spec/spec_helper.rb
302
- - spec/active_interaction/grouped_input_spec.rb
303
- - spec/active_interaction/filters/hash_filter_spec.rb
332
+ - spec/active_interaction/base_spec.rb
333
+ - spec/active_interaction/concerns/active_modelable_spec.rb
334
+ - spec/active_interaction/concerns/active_recordable_spec.rb
335
+ - spec/active_interaction/concerns/hashable_spec.rb
336
+ - spec/active_interaction/concerns/missable_spec.rb
337
+ - spec/active_interaction/concerns/runnable_spec.rb
338
+ - spec/active_interaction/errors_spec.rb
339
+ - spec/active_interaction/filter_column_spec.rb
340
+ - spec/active_interaction/filter_spec.rb
304
341
  - spec/active_interaction/filters/abstract_date_time_filter_spec.rb
305
- - spec/active_interaction/filters/boolean_filter_spec.rb
342
+ - spec/active_interaction/filters/abstract_numeric_filter_spec.rb
306
343
  - spec/active_interaction/filters/array_filter_spec.rb
307
- - spec/active_interaction/filters/time_filter_spec.rb
308
- - spec/active_interaction/filters/abstract_filter_spec.rb
309
- - spec/active_interaction/filters/float_filter_spec.rb
344
+ - spec/active_interaction/filters/boolean_filter_spec.rb
310
345
  - spec/active_interaction/filters/date_filter_spec.rb
311
- - spec/active_interaction/filters/integer_filter_spec.rb
312
- - spec/active_interaction/filters/object_filter_spec.rb
313
- - spec/active_interaction/filters/symbol_filter_spec.rb
314
- - spec/active_interaction/filters/string_filter_spec.rb
315
- - spec/active_interaction/filters/abstract_numeric_filter_spec.rb
346
+ - spec/active_interaction/filters/date_time_filter_spec.rb
316
347
  - spec/active_interaction/filters/decimal_filter_spec.rb
317
348
  - spec/active_interaction/filters/file_filter_spec.rb
349
+ - spec/active_interaction/filters/float_filter_spec.rb
350
+ - spec/active_interaction/filters/hash_filter_spec.rb
351
+ - spec/active_interaction/filters/integer_filter_spec.rb
318
352
  - spec/active_interaction/filters/interface_filter_spec.rb
353
+ - spec/active_interaction/filters/object_filter_spec.rb
319
354
  - spec/active_interaction/filters/record_filter_spec.rb
320
- - spec/active_interaction/filters/date_time_filter_spec.rb
355
+ - spec/active_interaction/filters/string_filter_spec.rb
356
+ - spec/active_interaction/filters/symbol_filter_spec.rb
357
+ - spec/active_interaction/filters/time_filter_spec.rb
358
+ - spec/active_interaction/grouped_input_spec.rb
321
359
  - spec/active_interaction/i18n_spec.rb
360
+ - spec/active_interaction/inputs_spec.rb
361
+ - spec/active_interaction/integration/array_interaction_spec.rb
322
362
  - spec/active_interaction/integration/boolean_interaction_spec.rb
323
363
  - spec/active_interaction/integration/date_interaction_spec.rb
324
- - spec/active_interaction/integration/symbol_interaction_spec.rb
325
- - spec/active_interaction/integration/interface_interaction_spec.rb
326
- - spec/active_interaction/integration/time_interaction_spec.rb
327
- - spec/active_interaction/integration/float_interaction_spec.rb
328
- - spec/active_interaction/integration/integer_interaction_spec.rb
329
- - spec/active_interaction/integration/string_interaction_spec.rb
330
- - spec/active_interaction/integration/array_interaction_spec.rb
331
- - spec/active_interaction/integration/hash_interaction_spec.rb
332
364
  - spec/active_interaction/integration/date_time_interaction_spec.rb
333
365
  - spec/active_interaction/integration/file_interaction_spec.rb
366
+ - spec/active_interaction/integration/float_interaction_spec.rb
367
+ - spec/active_interaction/integration/hash_interaction_spec.rb
368
+ - spec/active_interaction/integration/integer_interaction_spec.rb
369
+ - spec/active_interaction/integration/interface_interaction_spec.rb
334
370
  - spec/active_interaction/integration/object_interaction_spec.rb
335
- - spec/active_interaction/filter_column_spec.rb
336
- - spec/active_interaction/errors_spec.rb
371
+ - spec/active_interaction/integration/string_interaction_spec.rb
372
+ - spec/active_interaction/integration/symbol_interaction_spec.rb
373
+ - spec/active_interaction/integration/time_interaction_spec.rb
337
374
  - spec/active_interaction/modules/validation_spec.rb
338
- - spec/active_interaction/modules/input_processor_spec.rb
339
- - spec/active_interaction/filter_spec.rb
340
- - spec/active_interaction/base_spec.rb
341
- - spec/active_interaction/concerns/active_modelable_spec.rb
342
- - spec/active_interaction/concerns/hashable_spec.rb
343
- - spec/active_interaction/concerns/active_recordable_spec.rb
344
- - spec/active_interaction/concerns/missable_spec.rb
345
- - spec/active_interaction/concerns/runnable_spec.rb
375
+ - spec/spec_helper.rb
376
+ - spec/support/concerns.rb
346
377
  - spec/support/filters.rb
347
378
  - spec/support/interactions.rb
348
- - spec/support/concerns.rb