active_interaction 3.8.2 → 4.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +192 -0
  3. data/README.md +93 -107
  4. data/lib/active_interaction.rb +1 -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 +7 -14
  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 -12
  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 +26 -12
  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 +51 -14
  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 +0 -2
  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 -6
  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 +81 -57
  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
@@ -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,5 +1,3 @@
1
- # coding: utf-8
2
-
3
1
  # Disable code coverage for JRuby because it always reports 0% coverage.
4
2
  if RUBY_ENGINE != 'jruby'
5
3
  require 'coveralls'
@@ -7,13 +5,11 @@ if RUBY_ENGINE != 'jruby'
7
5
  end
8
6
 
9
7
  require 'i18n'
10
- if I18n.config.respond_to?(:enforce_available_locales)
11
- I18n.config.enforce_available_locales = true
12
- end
8
+ I18n.config.enforce_available_locales = true if I18n.config.respond_to?(:enforce_available_locales)
13
9
 
14
10
  require 'active_interaction'
15
11
 
16
- Dir['./spec/support/**/*.rb'].each { |f| require f }
12
+ Dir['./spec/support/**/*.rb'].sort.each { |f| require f }
17
13
 
18
14
  RSpec.configure do |config|
19
15
  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,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_interaction
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.2
4
+ version: 4.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Lasseigne
8
8
  - Taylor Fausak
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-04-22 00:00:00.000000000 Z
12
+ date: 2021-06-25 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,7 @@ dependencies:
27
27
  requirements:
28
28
  - - ">="
29
29
  - !ruby/object:Gem::Version
30
- version: '4'
30
+ version: '5'
31
31
  - - "<"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '7'
@@ -93,28 +93,28 @@ dependencies:
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '1.12'
96
+ version: '2.1'
97
97
  type: :development
98
98
  prerelease: false
99
99
  version_requirements: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '1.12'
103
+ version: '2.1'
104
104
  - !ruby/object:Gem::Dependency
105
105
  name: rake
106
106
  requirement: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '11.3'
110
+ version: '13.0'
111
111
  type: :development
112
112
  prerelease: false
113
113
  version_requirements: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '11.3'
117
+ version: '13.0'
118
118
  - !ruby/object:Gem::Dependency
119
119
  name: rspec
120
120
  requirement: !ruby/object:Gem::Requirement
@@ -135,14 +135,42 @@ dependencies:
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 0.44.0
138
+ version: 1.17.0
139
139
  type: :development
140
140
  prerelease: false
141
141
  version_requirements: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 0.44.0
145
+ version: 1.17.0
146
+ - !ruby/object:Gem::Dependency
147
+ name: rubocop-rake
148
+ requirement: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 0.5.1
153
+ type: :development
154
+ prerelease: false
155
+ version_requirements: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: 0.5.1
160
+ - !ruby/object:Gem::Dependency
161
+ name: rubocop-rspec
162
+ requirement: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '2.1'
167
+ type: :development
168
+ prerelease: false
169
+ version_requirements: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '2.1'
146
174
  - !ruby/object:Gem::Dependency
147
175
  name: yard
148
176
  requirement: !ruby/object:Gem::Requirement
@@ -161,16 +189,16 @@ dependencies:
161
189
  name: sqlite3
162
190
  requirement: !ruby/object:Gem::Requirement
163
191
  requirements:
164
- - - '='
192
+ - - ">="
165
193
  - !ruby/object:Gem::Version
166
- version: 1.4.2
194
+ version: '0'
167
195
  type: :development
168
196
  prerelease: false
169
197
  version_requirements: !ruby/object:Gem::Requirement
170
198
  requirements:
171
- - - '='
199
+ - - ">="
172
200
  - !ruby/object:Gem::Version
173
- version: 1.4.2
201
+ version: '0'
174
202
  description: |2
175
203
  ActiveInteraction manages application-specific business logic. It is an
176
204
  implementation of the command pattern in Ruby.
@@ -186,7 +214,6 @@ files:
186
214
  - LICENSE.md
187
215
  - README.md
188
216
  - lib/active_interaction.rb
189
- - lib/active_interaction/backports.rb
190
217
  - lib/active_interaction/base.rb
191
218
  - lib/active_interaction/concerns/active_modelable.rb
192
219
  - lib/active_interaction/concerns/active_recordable.rb
@@ -197,7 +224,6 @@ files:
197
224
  - lib/active_interaction/filter.rb
198
225
  - lib/active_interaction/filter_column.rb
199
226
  - lib/active_interaction/filters/abstract_date_time_filter.rb
200
- - lib/active_interaction/filters/abstract_filter.rb
201
227
  - lib/active_interaction/filters/abstract_numeric_filter.rb
202
228
  - lib/active_interaction/filters/array_filter.rb
203
229
  - lib/active_interaction/filters/boolean_filter.rb
@@ -215,12 +241,12 @@ files:
215
241
  - lib/active_interaction/filters/symbol_filter.rb
216
242
  - lib/active_interaction/filters/time_filter.rb
217
243
  - lib/active_interaction/grouped_input.rb
244
+ - lib/active_interaction/inputs.rb
218
245
  - lib/active_interaction/locale/en.yml
219
246
  - lib/active_interaction/locale/fr.yml
220
247
  - lib/active_interaction/locale/it.yml
221
248
  - lib/active_interaction/locale/ja.yml
222
249
  - lib/active_interaction/locale/pt-BR.yml
223
- - lib/active_interaction/modules/input_processor.rb
224
250
  - lib/active_interaction/modules/validation.rb
225
251
  - lib/active_interaction/version.rb
226
252
  - spec/active_interaction/base_spec.rb
@@ -233,7 +259,6 @@ files:
233
259
  - spec/active_interaction/filter_column_spec.rb
234
260
  - spec/active_interaction/filter_spec.rb
235
261
  - spec/active_interaction/filters/abstract_date_time_filter_spec.rb
236
- - spec/active_interaction/filters/abstract_filter_spec.rb
237
262
  - spec/active_interaction/filters/abstract_numeric_filter_spec.rb
238
263
  - spec/active_interaction/filters/array_filter_spec.rb
239
264
  - spec/active_interaction/filters/boolean_filter_spec.rb
@@ -252,6 +277,7 @@ files:
252
277
  - spec/active_interaction/filters/time_filter_spec.rb
253
278
  - spec/active_interaction/grouped_input_spec.rb
254
279
  - spec/active_interaction/i18n_spec.rb
280
+ - spec/active_interaction/inputs_spec.rb
255
281
  - spec/active_interaction/integration/array_interaction_spec.rb
256
282
  - spec/active_interaction/integration/boolean_interaction_spec.rb
257
283
  - spec/active_interaction/integration/date_interaction_spec.rb
@@ -265,20 +291,19 @@ files:
265
291
  - spec/active_interaction/integration/string_interaction_spec.rb
266
292
  - spec/active_interaction/integration/symbol_interaction_spec.rb
267
293
  - spec/active_interaction/integration/time_interaction_spec.rb
268
- - spec/active_interaction/modules/input_processor_spec.rb
269
294
  - spec/active_interaction/modules/validation_spec.rb
270
295
  - spec/spec_helper.rb
271
296
  - spec/support/concerns.rb
272
297
  - spec/support/filters.rb
273
298
  - spec/support/interactions.rb
274
- homepage:
299
+ homepage:
275
300
  licenses:
276
301
  - MIT
277
302
  metadata:
278
303
  homepage_uri: https://github.com/AaronLasseigne/active_interaction
279
304
  source_code_uri: https://github.com/AaronLasseigne/active_interaction
280
305
  changelog_uri: https://github.com/AaronLasseigne/active_interaction/blob/master/CHANGELOG.md
281
- post_install_message:
306
+ post_install_message:
282
307
  rdoc_options: []
283
308
  require_paths:
284
309
  - lib
@@ -286,63 +311,62 @@ required_ruby_version: !ruby/object:Gem::Requirement
286
311
  requirements:
287
312
  - - ">="
288
313
  - !ruby/object:Gem::Version
289
- version: '2'
314
+ version: '2.5'
290
315
  required_rubygems_version: !ruby/object:Gem::Requirement
291
316
  requirements:
292
317
  - - ">="
293
318
  - !ruby/object:Gem::Version
294
319
  version: '0'
295
320
  requirements: []
296
- rubygems_version: 3.1.2
297
- signing_key:
321
+ rubygems_version: 3.2.3
322
+ signing_key:
298
323
  specification_version: 4
299
324
  summary: Manage application specific business logic.
300
325
  test_files:
301
- - spec/spec_helper.rb
302
- - spec/active_interaction/grouped_input_spec.rb
303
- - spec/active_interaction/filters/hash_filter_spec.rb
326
+ - spec/active_interaction/base_spec.rb
327
+ - spec/active_interaction/concerns/active_modelable_spec.rb
328
+ - spec/active_interaction/concerns/active_recordable_spec.rb
329
+ - spec/active_interaction/concerns/hashable_spec.rb
330
+ - spec/active_interaction/concerns/missable_spec.rb
331
+ - spec/active_interaction/concerns/runnable_spec.rb
332
+ - spec/active_interaction/errors_spec.rb
333
+ - spec/active_interaction/filter_column_spec.rb
334
+ - spec/active_interaction/filter_spec.rb
304
335
  - spec/active_interaction/filters/abstract_date_time_filter_spec.rb
305
- - spec/active_interaction/filters/boolean_filter_spec.rb
336
+ - spec/active_interaction/filters/abstract_numeric_filter_spec.rb
306
337
  - 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
338
+ - spec/active_interaction/filters/boolean_filter_spec.rb
310
339
  - 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
340
+ - spec/active_interaction/filters/date_time_filter_spec.rb
316
341
  - spec/active_interaction/filters/decimal_filter_spec.rb
317
342
  - spec/active_interaction/filters/file_filter_spec.rb
343
+ - spec/active_interaction/filters/float_filter_spec.rb
344
+ - spec/active_interaction/filters/hash_filter_spec.rb
345
+ - spec/active_interaction/filters/integer_filter_spec.rb
318
346
  - spec/active_interaction/filters/interface_filter_spec.rb
347
+ - spec/active_interaction/filters/object_filter_spec.rb
319
348
  - spec/active_interaction/filters/record_filter_spec.rb
320
- - spec/active_interaction/filters/date_time_filter_spec.rb
349
+ - spec/active_interaction/filters/string_filter_spec.rb
350
+ - spec/active_interaction/filters/symbol_filter_spec.rb
351
+ - spec/active_interaction/filters/time_filter_spec.rb
352
+ - spec/active_interaction/grouped_input_spec.rb
321
353
  - spec/active_interaction/i18n_spec.rb
354
+ - spec/active_interaction/inputs_spec.rb
355
+ - spec/active_interaction/integration/array_interaction_spec.rb
322
356
  - spec/active_interaction/integration/boolean_interaction_spec.rb
323
357
  - 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
358
  - spec/active_interaction/integration/date_time_interaction_spec.rb
333
359
  - spec/active_interaction/integration/file_interaction_spec.rb
360
+ - spec/active_interaction/integration/float_interaction_spec.rb
361
+ - spec/active_interaction/integration/hash_interaction_spec.rb
362
+ - spec/active_interaction/integration/integer_interaction_spec.rb
363
+ - spec/active_interaction/integration/interface_interaction_spec.rb
334
364
  - spec/active_interaction/integration/object_interaction_spec.rb
335
- - spec/active_interaction/filter_column_spec.rb
336
- - spec/active_interaction/errors_spec.rb
365
+ - spec/active_interaction/integration/string_interaction_spec.rb
366
+ - spec/active_interaction/integration/symbol_interaction_spec.rb
367
+ - spec/active_interaction/integration/time_interaction_spec.rb
337
368
  - 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
369
+ - spec/spec_helper.rb
370
+ - spec/support/concerns.rb
346
371
  - spec/support/filters.rb
347
372
  - spec/support/interactions.rb
348
- - spec/support/concerns.rb