clean-architecture 3.0.2 → 4.0.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d843b051d1d07be0b56f84d19b5d0834615f1cddc397fa63d2250509d2099b08
4
- data.tar.gz: 778cc2e59a3e8ab263bce14de8a70da18129b433cf156e17e96406ec33b9b360
3
+ metadata.gz: be4077eaad5d3e5338312a3d01179b20fed0883fe4ea5ae704d7b68edde2354a
4
+ data.tar.gz: e35ac78ba41bbd331092f457794cacfbf64dceba299482fd163c33c2f2a0d206
5
5
  SHA512:
6
- metadata.gz: 58535de6320c01bbd5c6d6aad1090d5cfa17674c601c498872c9af0e3f10ae07205caf8828576b2b2b7e477ab6310b4fea90de49d449b8e859523a7f128aab13
7
- data.tar.gz: a2249e59427fbb15f18ea9de9b6d462eb68a3893b80421286f115a001426c6e57d493e542f35f1f5572a471f06d6732cb9a35ec7d1fad8ec31991e59905aa610
6
+ metadata.gz: 64a30a1b47e4b03350d5003598c0c2a54df04c5837a264c53a889883938132b8b9c8e118f8855c3d347381e10a1b8cf6839e180580d079884adb7044af1e4c8c
7
+ data.tar.gz: 6f3c961a6173becaf70e2862766574670c3f20690fb1f6c2ed6f1082f19941f1034770cb981209a1f187bc488d8848c358f6e88f02bdfa57bc5e44f3f62636ac
@@ -1,3 +1,8 @@
1
+ 4.0.0
2
+
3
+ * Stop trying to be JSON API compliant - we never were and we never will be
4
+ * Use a proc to generate success payload, so that it can be lazily generated
5
+
1
6
  3.0.1-3.0.2
2
7
 
3
8
  * Add new failure code - unprocessable_entity
@@ -6,7 +6,6 @@
6
6
  require 'clean_architecture/interfaces/authorization_parameters'
7
7
  require 'clean_architecture/interfaces/base_parameters'
8
8
  require 'clean_architecture/interfaces/jsonable'
9
- require 'clean_architecture/interfaces/success_payload'
10
9
  require 'clean_architecture/interfaces/targeted_parameters'
11
10
  require 'clean_architecture/interfaces/use_case'
12
11
  require 'clean_architecture/interfaces/use_case_actor'
@@ -5,5 +5,3 @@
5
5
 
6
6
  require 'clean_architecture/serializers/html_response_from_result'
7
7
  require 'clean_architecture/serializers/json_response_from_result'
8
- require 'clean_architecture/serializers/success_collection_payload'
9
- require 'clean_architecture/serializers/success_payload'
@@ -1,20 +1,25 @@
1
- # typed: true
1
+ # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require 'clean_architecture/entities/failure_details'
5
5
  require 'clean_architecture/matchers/use_case_result'
6
6
  require 'clean_architecture/queries/http_failure_code'
7
7
  require 'clean_architecture/queries/http_success_code'
8
+ require 'sorbet-runtime'
8
9
 
9
10
  module CleanArchitecture
10
11
  module Serializers
11
12
  class JsonResponseFromResult
12
- def initialize(result, http_method, success_payload)
13
- @result = result
14
- @http_method = http_method
15
- @success_payload = success_payload
13
+ extend T::Sig
14
+
15
+ sig { params(result: Dry::Monads::Result, http_method: String, success_payload_proc: T.proc.returns(T::Hash[T.untyped, T.untyped])).void }
16
+ def initialize(result, http_method, success_payload_proc)
17
+ @result = T.let(result, Dry::Monads::Result)
18
+ @http_method = T.let(http_method, String)
19
+ @success_payload_proc = T.let(success_payload_proc, T.proc.returns(T::Hash[T.untyped, T.untyped]))
16
20
  end
17
21
 
22
+ sig { returns(T::Hash[Symbol, T.untyped]) }
18
23
  def to_h
19
24
  {
20
25
  status: http_status_code,
@@ -24,6 +29,7 @@ module CleanArchitecture
24
29
 
25
30
  private
26
31
 
32
+ sig { returns(Symbol) }
27
33
  def http_status_code
28
34
  Matchers::UseCaseResult.call(@result) do |matcher|
29
35
  matcher.success { Queries::HttpSuccessCode.new(@http_method).to_sym }
@@ -33,25 +39,22 @@ module CleanArchitecture
33
39
  end
34
40
  end
35
41
 
42
+ sig { returns(T::Hash[Symbol, T.untyped]) }
36
43
  def json
37
44
  Matchers::UseCaseResult.call(@result) do |matcher|
38
- matcher.success { success_payload }
45
+ matcher.success { success_payload_data }
39
46
  matcher.failure do |failure_details|
40
- { jsonapi: json_api_version_hash, errors: [failure_details.message] }
47
+ { errors: [failure_details.message] }
41
48
  end
42
49
  end
43
50
  end
44
51
 
45
- def success_payload
52
+ sig {returns(T::Hash[Symbol, T::Hash[T.untyped, T.untyped]])}
53
+ def success_payload_data
46
54
  {
47
- jsonapi: json_api_version_hash,
48
- data: @success_payload.data
55
+ data: @success_payload_proc.call
49
56
  }
50
57
  end
51
-
52
- def json_api_version_hash
53
- { version: @success_payload.version }
54
- end
55
58
  end
56
59
  end
57
60
  end
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module CleanArchitecture
5
- VERSION = '3.0.2'
5
+ VERSION = '4.0.0'
6
6
  end
@@ -7,7 +7,7 @@
7
7
  #
8
8
  # https://github.com/sorbet/sorbet-typed/new/master?filename=lib/dry-configurable/all/dry-configurable.rbi
9
9
  #
10
- # dry-configurable-0.11.2
10
+ # dry-configurable-0.11.3
11
11
 
12
12
  module Dry
13
13
  end
@@ -7,7 +7,7 @@
7
7
  #
8
8
  # https://github.com/sorbet/sorbet-typed/new/master?filename=lib/parser/all/parser.rbi
9
9
  #
10
- # parser-2.7.0.2
10
+ # parser-2.7.0.3
11
11
 
12
12
  module Parser
13
13
  end
@@ -55,6 +55,7 @@ class Parser::AST::Processor < AST::Processor
55
55
  def on_dstr(node); end
56
56
  def on_dsym(node); end
57
57
  def on_eflipflop(node); end
58
+ def on_empty_else(node); end
58
59
  def on_ensure(node); end
59
60
  def on_erange(node); end
60
61
  def on_for(node); end
@@ -303,7 +304,7 @@ class Parser::Source::TreeRewriter::Action
303
304
  def insertion?; end
304
305
  def merge(action); end
305
306
  def ordered_replacements; end
306
- def place_in_hierachy(action); end
307
+ def place_in_hierarchy(action); end
307
308
  def range; end
308
309
  def relationship_with(action); end
309
310
  def replacement; end
@@ -814,134 +814,3 @@ module RSpec::Mocks::Matchers
814
814
  end
815
815
  module RSpec::Mocks::Matchers::Matcher
816
816
  end
817
- module RSpec::Mocks::AnyInstance
818
- def self.error_generator; end
819
- end
820
- class RSpec::Mocks::AnyInstance::Chain
821
- def constrained_to_any_of?(*constraints); end
822
- def expectation_fulfilled!; end
823
- def initialize(recorder, *args, &block); end
824
- def last_message; end
825
- def matches_args?(*args); end
826
- def messages; end
827
- def negated?; end
828
- def never; end
829
- def playback!(instance); end
830
- def record(rspec_method_name, *args, &block); end
831
- def with(*args, &block); end
832
- include RSpec::Mocks::AnyInstance::Chain::Customizations
833
- end
834
- module RSpec::Mocks::AnyInstance::Chain::Customizations
835
- def and_call_original(*args, &block); end
836
- def and_raise(*args, &block); end
837
- def and_return(*args, &block); end
838
- def and_throw(*args, &block); end
839
- def and_wrap_original(*args, &block); end
840
- def and_yield(*args, &block); end
841
- def at_least(*args, &block); end
842
- def at_most(*args, &block); end
843
- def exactly(*args, &block); end
844
- def never(*args, &block); end
845
- def once(*args, &block); end
846
- def self.record(method_name); end
847
- def thrice(*args, &block); end
848
- def time(*args, &block); end
849
- def times(*args, &block); end
850
- def twice(*args, &block); end
851
- def with(*args, &block); end
852
- end
853
- class RSpec::Mocks::AnyInstance::ErrorGenerator < RSpec::Mocks::ErrorGenerator
854
- def raise_does_not_implement_error(klass, method_name); end
855
- def raise_message_already_received_by_other_instance_error(method_name, object_inspect, invoked_instance); end
856
- def raise_not_supported_with_prepend_error(method_name, problem_mod); end
857
- def raise_second_instance_received_message_error(unfulfilled_expectations); end
858
- end
859
- class RSpec::Mocks::AnyInstance::StubChain < RSpec::Mocks::AnyInstance::Chain
860
- def create_message_expectation_on(instance); end
861
- def expectation_fulfilled?; end
862
- def invocation_order; end
863
- def verify_invocation_order(rspec_method_name, *_args, &_block); end
864
- end
865
- class RSpec::Mocks::AnyInstance::StubChainChain < RSpec::Mocks::AnyInstance::StubChain
866
- def create_message_expectation_on(instance); end
867
- def initialize(*args); end
868
- def invocation_order; end
869
- end
870
- class RSpec::Mocks::AnyInstance::ExpectChainChain < RSpec::Mocks::AnyInstance::StubChain
871
- def create_message_expectation_on(instance); end
872
- def expectation_fulfilled?; end
873
- def initialize(*args); end
874
- def invocation_order; end
875
- def playback!(instance); end
876
- end
877
- class RSpec::Mocks::AnyInstance::ExpectationChain < RSpec::Mocks::AnyInstance::Chain
878
- def expectation_fulfilled?; end
879
- def initialize(*args, &block); end
880
- def verify_invocation_order(_rspec_method_name, *_args, &_block); end
881
- end
882
- class RSpec::Mocks::AnyInstance::PositiveExpectationChain < RSpec::Mocks::AnyInstance::ExpectationChain
883
- def create_message_expectation_on(instance); end
884
- def invocation_order; end
885
- end
886
- class RSpec::Mocks::AnyInstance::MessageChains
887
- def [](method_name); end
888
- def add(method_name, chain); end
889
- def all_expectations_fulfilled?; end
890
- def each_unfulfilled_expectation_matching(method_name, *args); end
891
- def has_expectation?(method_name); end
892
- def initialize; end
893
- def playback!(instance, method_name); end
894
- def raise_if_second_instance_to_receive_message(instance); end
895
- def received_expected_message!(method_name); end
896
- def remove_stub_chains_for!(method_name); end
897
- def unfulfilled_expectations; end
898
- end
899
- class RSpec::Mocks::AnyInstance::Recorder
900
- def allow_no_prepended_module_definition_of(method_name); end
901
- def already_observing?(method_name); end
902
- def ancestor_is_an_observer?(method_name); end
903
- def backup_method!(method_name); end
904
- def build_alias_method_name(method_name); end
905
- def expect_chain(*method_names_and_optional_return_values, &block); end
906
- def initialize(klass); end
907
- def instance_that_received(method_name); end
908
- def klass; end
909
- def mark_invoked!(method_name); end
910
- def message_chains; end
911
- def normalize_chain(*args); end
912
- def notify_received_message(_object, message, args, _blk); end
913
- def observe!(method_name); end
914
- def playback!(instance, method_name); end
915
- def public_protected_or_private_method_defined?(method_name); end
916
- def received_expected_message!(method_name); end
917
- def remove_dummy_method!(method_name); end
918
- def restore_method!(method_name); end
919
- def restore_original_method!(method_name); end
920
- def should_not_receive(method_name, &block); end
921
- def should_receive(method_name, &block); end
922
- def stop_all_observation!; end
923
- def stop_observing!(method_name); end
924
- def stub(method_name, &block); end
925
- def stub_chain(*method_names_and_optional_return_values, &block); end
926
- def stubs; end
927
- def super_class_observers_for(method_name); end
928
- def super_class_observing?(method_name); end
929
- def unstub(method_name); end
930
- def verify; end
931
- end
932
- class RSpec::Mocks::AnyInstance::Proxy
933
- def expect_chain(*chain, &block); end
934
- def initialize(recorder, target_proxies); end
935
- def klass; end
936
- def perform_proxying(method_name, args, block, &target_proxy_block); end
937
- def should_not_receive(method_name, &block); end
938
- def should_receive(method_name, &block); end
939
- def stub(method_name_or_method_map, &block); end
940
- def stub_chain(*chain, &block); end
941
- def unstub(method_name); end
942
- end
943
- class RSpec::Mocks::AnyInstance::FluentInterfaceProxy
944
- def initialize(targets); end
945
- def method_missing(*args, &block); end
946
- def respond_to_missing?(method_name, include_private = nil); end
947
- end
@@ -217,6 +217,7 @@ class RuboCop::AST::Node < Parser::AST::Node
217
217
  def each_descendant(*types, &block); end
218
218
  def each_node(*types, &block); end
219
219
  def eflipflop_type?; end
220
+ def empty_else_type?; end
220
221
  def empty_source?; end
221
222
  def ensure_type?; end
222
223
  def equals_asgn?; end
@@ -7,7 +7,7 @@
7
7
  #
8
8
  # https://github.com/sorbet/sorbet-typed/new/master?filename=lib/simplecov-html/all/simplecov-html.rbi
9
9
  #
10
- # simplecov-html-0.12.0
10
+ # simplecov-html-0.12.2
11
11
 
12
12
  module SimpleCov
13
13
  end
@@ -7,15 +7,19 @@
7
7
  #
8
8
  # https://github.com/sorbet/sorbet-typed/new/master?filename=lib/simplecov/all/simplecov.rbi
9
9
  #
10
- # simplecov-0.18.2
10
+ # simplecov-0.18.5
11
11
 
12
12
  module SimpleCov
13
13
  def self.adapt_coverage_result; end
14
14
  def self.add_not_loaded_files(result); end
15
+ def self.at_exit_behavior; end
15
16
  def self.clear_result; end
16
17
  def self.collate(result_filenames, profile = nil, &block); end
17
18
  def self.exit_exception; end
18
19
  def self.exit_status_from_exception; end
20
+ def self.external_at_exit; end
21
+ def self.external_at_exit=(arg0); end
22
+ def self.external_at_exit?; end
19
23
  def self.filtered(files); end
20
24
  def self.final_result_process?; end
21
25
  def self.grouped(files); end
@@ -135,6 +139,7 @@ class SimpleCov::SourceFile
135
139
  def covered_lines; end
136
140
  def covered_percent; end
137
141
  def covered_strength; end
142
+ def ensure_remove_undefs(file_lines); end
138
143
  def filename; end
139
144
  def initialize(filename, coverage_data); end
140
145
  def line(number); end
@@ -143,6 +148,7 @@ class SimpleCov::SourceFile
143
148
  def lines; end
144
149
  def lines_of_code; end
145
150
  def lines_strength; end
151
+ def load_source; end
146
152
  def missed_branches; end
147
153
  def missed_lines; end
148
154
  def never_lines; end
@@ -152,8 +158,11 @@ class SimpleCov::SourceFile
152
158
  def process_skipped_branches(branches); end
153
159
  def process_skipped_lines(lines); end
154
160
  def project_filename; end
161
+ def read_lines(file, lines, current_line); end
155
162
  def relevant_lines; end
156
163
  def restore_ruby_data_structure(structure); end
164
+ def set_encoding_based_on_magic_comment(file, line); end
165
+ def shebang?(line); end
157
166
  def skipped_lines; end
158
167
  def source; end
159
168
  def source_lines; end
@@ -195,7 +195,7 @@
195
195
  # wrong constant name define_attribute_method
196
196
  # wrong constant name define_attribute_methods
197
197
  # wrong constant name undefine_attribute_methods
198
- # undefined method `initialize<defaultArg>1' for class `#<Class:0x00007fe79b108c88>'
198
+ # undefined method `initialize<defaultArg>1' for class `#<Class:0x00007ff444bf9218>'
199
199
  # wrong constant name <Class:AttributeMethodMatch>
200
200
  # wrong constant name initialize<defaultArg>1
201
201
  # wrong constant name initialize
@@ -4227,7 +4227,6 @@
4227
4227
  # wrong constant name itself
4228
4228
  # wrong constant name object_id
4229
4229
  # wrong constant name pretty_inspect
4230
- # wrong constant name respond_to?
4231
4230
  # wrong constant name then
4232
4231
  # wrong constant name yield_self
4233
4232
  # wrong constant name at_exit
@@ -5770,10 +5769,110 @@
5770
5769
  # wrong constant name does_not_match?
5771
5770
  # wrong constant name matches?
5772
5771
  # wrong constant name <static-init>
5772
+ # wrong constant name <Class:AnyInstance>
5773
5773
  # wrong constant name <Class:ExpectChain>
5774
5774
  # wrong constant name <Class:MarshalExtension>
5775
5775
  # wrong constant name <Class:MessageChain>
5776
5776
  # wrong constant name <Class:StubChain>
5777
+ # wrong constant name <Class:Chain>
5778
+ # wrong constant name <Class:ErrorGenerator>
5779
+ # wrong constant name <Class:ExpectChainChain>
5780
+ # wrong constant name <Class:ExpectationChain>
5781
+ # wrong constant name <Class:FluentInterfaceProxy>
5782
+ # wrong constant name <Class:MessageChains>
5783
+ # wrong constant name <Class:PositiveExpectationChain>
5784
+ # wrong constant name <Class:Proxy>
5785
+ # wrong constant name <Class:Recorder>
5786
+ # wrong constant name <Class:StubChain>
5787
+ # wrong constant name <Class:StubChainChain>
5788
+ # wrong constant name <Class:Customizations>
5789
+ # wrong constant name constrained_to_any_of?
5790
+ # wrong constant name expectation_fulfilled!
5791
+ # wrong constant name initialize
5792
+ # wrong constant name matches_args?
5793
+ # wrong constant name never
5794
+ # wrong constant name playback!
5795
+ # wrong constant name and_call_original
5796
+ # wrong constant name and_raise
5797
+ # wrong constant name and_return
5798
+ # wrong constant name and_throw
5799
+ # wrong constant name and_wrap_original
5800
+ # wrong constant name and_yield
5801
+ # wrong constant name at_least
5802
+ # wrong constant name at_most
5803
+ # wrong constant name exactly
5804
+ # wrong constant name never
5805
+ # wrong constant name once
5806
+ # wrong constant name thrice
5807
+ # wrong constant name time
5808
+ # wrong constant name times
5809
+ # wrong constant name twice
5810
+ # wrong constant name with
5811
+ # wrong constant name <static-init>
5812
+ # wrong constant name record
5813
+ # wrong constant name <static-init>
5814
+ # wrong constant name raise_does_not_implement_error
5815
+ # wrong constant name raise_message_already_received_by_other_instance_error
5816
+ # wrong constant name raise_not_supported_with_prepend_error
5817
+ # wrong constant name raise_second_instance_received_message_error
5818
+ # wrong constant name <static-init>
5819
+ # uninitialized constant RSpec::Mocks::AnyInstance::ExpectChainChain::EmptyInvocationOrder
5820
+ # uninitialized constant RSpec::Mocks::AnyInstance::ExpectChainChain::InvocationOrder
5821
+ # wrong constant name initialize
5822
+ # wrong constant name <static-init>
5823
+ # wrong constant name expectation_fulfilled?
5824
+ # wrong constant name initialize
5825
+ # wrong constant name <static-init>
5826
+ # wrong constant name initialize
5827
+ # wrong constant name method_missing
5828
+ # wrong constant name <static-init>
5829
+ # wrong constant name []
5830
+ # wrong constant name add
5831
+ # wrong constant name all_expectations_fulfilled?
5832
+ # wrong constant name each_unfulfilled_expectation_matching
5833
+ # wrong constant name has_expectation?
5834
+ # wrong constant name playback!
5835
+ # wrong constant name received_expected_message!
5836
+ # wrong constant name remove_stub_chains_for!
5837
+ # wrong constant name unfulfilled_expectations
5838
+ # wrong constant name <static-init>
5839
+ # wrong constant name <static-init>
5840
+ # wrong constant name expect_chain
5841
+ # wrong constant name initialize
5842
+ # wrong constant name klass
5843
+ # wrong constant name should_not_receive
5844
+ # wrong constant name should_receive
5845
+ # wrong constant name stub
5846
+ # wrong constant name stub_chain
5847
+ # wrong constant name unstub
5848
+ # wrong constant name <static-init>
5849
+ # wrong constant name already_observing?
5850
+ # wrong constant name build_alias_method_name
5851
+ # wrong constant name expect_chain
5852
+ # wrong constant name initialize
5853
+ # wrong constant name instance_that_received
5854
+ # wrong constant name klass
5855
+ # wrong constant name message_chains
5856
+ # wrong constant name notify_received_message
5857
+ # wrong constant name playback!
5858
+ # wrong constant name should_not_receive
5859
+ # wrong constant name should_receive
5860
+ # wrong constant name stop_all_observation!
5861
+ # wrong constant name stop_observing!
5862
+ # wrong constant name stub
5863
+ # wrong constant name stub_chain
5864
+ # wrong constant name stubs
5865
+ # wrong constant name unstub
5866
+ # wrong constant name verify
5867
+ # wrong constant name <static-init>
5868
+ # wrong constant name expectation_fulfilled?
5869
+ # wrong constant name <static-init>
5870
+ # uninitialized constant RSpec::Mocks::AnyInstance::StubChainChain::EmptyInvocationOrder
5871
+ # uninitialized constant RSpec::Mocks::AnyInstance::StubChainChain::InvocationOrder
5872
+ # wrong constant name initialize
5873
+ # wrong constant name <static-init>
5874
+ # wrong constant name <static-init>
5875
+ # wrong constant name error_generator
5777
5876
  # wrong constant name <static-init>
5778
5877
  # wrong constant name expect_chain_on
5779
5878
  # wrong constant name <static-init>
@@ -6029,7 +6128,6 @@
6029
6128
  # uninitialized constant Readline::UpCase
6030
6129
  # uninitialized constant Readline::VISIBLE_BELL
6031
6130
  # uninitialized constant Readline::XOK
6032
- # wrong constant name match?
6033
6131
  # wrong constant name <Class:Config>
6034
6132
  # wrong constant name <Class:Label>
6035
6133
  # wrong constant name <Class:Message>
@@ -4181,20 +4181,9 @@ class CleanArchitecture::Entities::UntargetedParameters
4181
4181
  extend ::Duckface::ImplementationMethods
4182
4182
  end
4183
4183
 
4184
- class CleanArchitecture::Serializers::SuccessCollectionPayload
4185
- include ::CleanArchitecture::Interfaces::SuccessPayload
4186
- end
4187
-
4188
- class CleanArchitecture::Serializers::SuccessCollectionPayload
4189
- extend ::Duckface::ImplementationMethods
4190
- end
4191
-
4192
- class CleanArchitecture::Serializers::SuccessPayload
4193
- include ::CleanArchitecture::Interfaces::SuccessPayload
4194
- end
4195
-
4196
- class CleanArchitecture::Serializers::SuccessPayload
4197
- extend ::Duckface::ImplementationMethods
4184
+ class CleanArchitecture::Serializers::JsonResponseFromResult
4185
+ extend ::T::Private::Methods::MethodHooks
4186
+ extend ::T::Private::Methods::SingletonMethodHooks
4198
4187
  end
4199
4188
 
4200
4189
  class CleanArchitecture::UseCases::Errors
@@ -7389,8 +7378,6 @@ module Kernel
7389
7378
 
7390
7379
  def pretty_inspect(); end
7391
7380
 
7392
- def respond_to?(*_); end
7393
-
7394
7381
  def then(); end
7395
7382
 
7396
7383
  def yield_self(); end
@@ -7675,14 +7662,6 @@ class Minitest::Test
7675
7662
  def self.test_order(); end
7676
7663
  end
7677
7664
 
7678
- class MockUseCaseTarget
7679
- include ::CleanArchitecture::Interfaces::UseCaseTarget
7680
- end
7681
-
7682
- class MockUseCaseTarget
7683
- extend ::Duckface::ImplementationMethods
7684
- end
7685
-
7686
7665
  class Module
7687
7666
  include ::ActiveSupport::Dependencies::ModuleConstMissing
7688
7667
  def alias_attribute(new_name, old_name); end
@@ -10604,19 +10583,215 @@ module RSpec::Mocks
10604
10583
  IGNORED_BACKTRACE_LINE = ::T.let(nil, ::T.untyped)
10605
10584
  end
10606
10585
 
10586
+ module RSpec::Mocks::AnyInstance
10587
+ end
10588
+
10589
+ class RSpec::Mocks::AnyInstance::Chain
10590
+ include ::RSpec::Mocks::AnyInstance::Chain::Customizations
10591
+ def constrained_to_any_of?(*constraints); end
10592
+
10593
+ def expectation_fulfilled!(); end
10594
+
10595
+ def initialize(recorder, *args, &block); end
10596
+
10597
+ def matches_args?(*args); end
10598
+
10599
+ def never(); end
10600
+
10601
+ def playback!(instance); end
10602
+ end
10603
+
10604
+ module RSpec::Mocks::AnyInstance::Chain::Customizations
10605
+ def and_call_original(*args, &block); end
10606
+
10607
+ def and_raise(*args, &block); end
10608
+
10609
+ def and_return(*args, &block); end
10610
+
10611
+ def and_throw(*args, &block); end
10612
+
10613
+ def and_wrap_original(*args, &block); end
10614
+
10615
+ def and_yield(*args, &block); end
10616
+
10617
+ def at_least(*args, &block); end
10618
+
10619
+ def at_most(*args, &block); end
10620
+
10621
+ def exactly(*args, &block); end
10622
+
10623
+ def never(*args, &block); end
10624
+
10625
+ def once(*args, &block); end
10626
+
10627
+ def thrice(*args, &block); end
10628
+
10629
+ def time(*args, &block); end
10630
+
10631
+ def times(*args, &block); end
10632
+
10633
+ def twice(*args, &block); end
10634
+
10635
+ def with(*args, &block); end
10636
+ end
10637
+
10638
+ module RSpec::Mocks::AnyInstance::Chain::Customizations
10639
+ def self.record(method_name); end
10640
+ end
10641
+
10642
+ class RSpec::Mocks::AnyInstance::Chain
10643
+ end
10644
+
10645
+ class RSpec::Mocks::AnyInstance::ErrorGenerator
10646
+ def raise_does_not_implement_error(klass, method_name); end
10647
+
10648
+ def raise_message_already_received_by_other_instance_error(method_name, object_inspect, invoked_instance); end
10649
+
10650
+ def raise_not_supported_with_prepend_error(method_name, problem_mod); end
10651
+
10652
+ def raise_second_instance_received_message_error(unfulfilled_expectations); end
10653
+ end
10654
+
10655
+ class RSpec::Mocks::AnyInstance::ErrorGenerator
10656
+ end
10657
+
10658
+ class RSpec::Mocks::AnyInstance::ExpectChainChain
10659
+ def initialize(*args); end
10660
+ end
10661
+
10662
+ class RSpec::Mocks::AnyInstance::ExpectChainChain
10663
+ end
10664
+
10665
+ class RSpec::Mocks::AnyInstance::ExpectationChain
10666
+ def expectation_fulfilled?(); end
10667
+
10668
+ def initialize(*args, &block); end
10669
+ end
10670
+
10671
+ class RSpec::Mocks::AnyInstance::ExpectationChain
10672
+ end
10673
+
10674
+ class RSpec::Mocks::AnyInstance::FluentInterfaceProxy
10675
+ def initialize(targets); end
10676
+
10677
+ def method_missing(*args, &block); end
10678
+ end
10679
+
10680
+ class RSpec::Mocks::AnyInstance::FluentInterfaceProxy
10681
+ end
10682
+
10683
+ class RSpec::Mocks::AnyInstance::MessageChains
10684
+ def [](method_name); end
10685
+
10686
+ def add(method_name, chain); end
10687
+
10688
+ def all_expectations_fulfilled?(); end
10689
+
10690
+ def each_unfulfilled_expectation_matching(method_name, *args); end
10691
+
10692
+ def has_expectation?(method_name); end
10693
+
10694
+ def playback!(instance, method_name); end
10695
+
10696
+ def received_expected_message!(method_name); end
10697
+
10698
+ def remove_stub_chains_for!(method_name); end
10699
+
10700
+ def unfulfilled_expectations(); end
10701
+ end
10702
+
10703
+ class RSpec::Mocks::AnyInstance::MessageChains
10704
+ end
10705
+
10607
10706
  class RSpec::Mocks::AnyInstance::PositiveExpectationChain
10608
10707
  ExpectationInvocationOrder = ::T.let(nil, ::T.untyped)
10609
10708
  end
10610
10709
 
10710
+ class RSpec::Mocks::AnyInstance::PositiveExpectationChain
10711
+ end
10712
+
10713
+ class RSpec::Mocks::AnyInstance::Proxy
10714
+ def expect_chain(*chain, &block); end
10715
+
10716
+ def initialize(recorder, target_proxies); end
10717
+
10718
+ def klass(); end
10719
+
10720
+ def should_not_receive(method_name, &block); end
10721
+
10722
+ def should_receive(method_name, &block); end
10723
+
10724
+ def stub(method_name_or_method_map, &block); end
10725
+
10726
+ def stub_chain(*chain, &block); end
10727
+
10728
+ def unstub(method_name); end
10729
+ end
10730
+
10731
+ class RSpec::Mocks::AnyInstance::Proxy
10732
+ end
10733
+
10734
+ class RSpec::Mocks::AnyInstance::Recorder
10735
+ def already_observing?(method_name); end
10736
+
10737
+ def build_alias_method_name(method_name); end
10738
+
10739
+ def expect_chain(*method_names_and_optional_return_values, &block); end
10740
+
10741
+ def initialize(klass); end
10742
+
10743
+ def instance_that_received(method_name); end
10744
+
10745
+ def klass(); end
10746
+
10747
+ def message_chains(); end
10748
+
10749
+ def notify_received_message(_object, message, args, _blk); end
10750
+
10751
+ def playback!(instance, method_name); end
10752
+
10753
+ def should_not_receive(method_name, &block); end
10754
+
10755
+ def should_receive(method_name, &block); end
10756
+
10757
+ def stop_all_observation!(); end
10758
+
10759
+ def stop_observing!(method_name); end
10760
+
10761
+ def stub(method_name, &block); end
10762
+
10763
+ def stub_chain(*method_names_and_optional_return_values, &block); end
10764
+
10765
+ def stubs(); end
10766
+
10767
+ def unstub(method_name); end
10768
+
10769
+ def verify(); end
10770
+ end
10771
+
10611
10772
  class RSpec::Mocks::AnyInstance::Recorder
10612
- include ::T::CompatibilityPatches::RecorderExtensions
10613
10773
  end
10614
10774
 
10615
10775
  class RSpec::Mocks::AnyInstance::StubChain
10776
+ def expectation_fulfilled?(); end
10616
10777
  EmptyInvocationOrder = ::T.let(nil, ::T.untyped)
10617
10778
  InvocationOrder = ::T.let(nil, ::T.untyped)
10618
10779
  end
10619
10780
 
10781
+ class RSpec::Mocks::AnyInstance::StubChain
10782
+ end
10783
+
10784
+ class RSpec::Mocks::AnyInstance::StubChainChain
10785
+ def initialize(*args); end
10786
+ end
10787
+
10788
+ class RSpec::Mocks::AnyInstance::StubChainChain
10789
+ end
10790
+
10791
+ module RSpec::Mocks::AnyInstance
10792
+ def self.error_generator(); end
10793
+ end
10794
+
10620
10795
  class RSpec::Mocks::ArgumentListMatcher
10621
10796
  MATCH_ALL = ::T.let(nil, ::T.untyped)
10622
10797
  end
@@ -11178,10 +11353,6 @@ Readline::HISTORY = Readline::History
11178
11353
 
11179
11354
  Readline::USERNAME_COMPLETION_PROC = Readline::Ucomp
11180
11355
 
11181
- class Regexp
11182
- def match?(*_); end
11183
- end
11184
-
11185
11356
  class Resolv::DNS
11186
11357
  def extract_resources(msg, name, typeclass); end
11187
11358
 
@@ -15338,6 +15509,11 @@ class SimpleCov::LinesClassifier
15338
15509
  WHITESPACE_OR_COMMENT_LINE = ::T.let(nil, ::T.untyped)
15339
15510
  end
15340
15511
 
15512
+ class SimpleCov::SourceFile
15513
+ RUBY_FILE_ENCODING_MAGIC_COMMENT_REGEX = ::T.let(nil, ::T.untyped)
15514
+ SHEBANG_REGEX = ::T.let(nil, ::T.untyped)
15515
+ end
15516
+
15341
15517
  module SimpleCov::UselessResultsRemover
15342
15518
  ROOT_REGX = ::T.let(nil, ::T.untyped)
15343
15519
  end
@@ -3,7 +3,8 @@
3
3
 
4
4
  # typed: strong
5
5
  module ActiveSupport::ActionController::Base; end
6
- module T::CompatibilityPatches::RecorderExtensions; end
6
+ module T::Private::Methods::MethodHooks; end
7
+ module T::Private::Methods::SingletonMethodHooks; end
7
8
  module Types::Strict::Hash; end
8
9
  module Types::Strict::Integer; end
9
10
  module Types::Strict::String; end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clean-architecture
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bellroy Tech Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-21 00:00:00.000000000 Z
11
+ date: 2020-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -216,7 +216,6 @@ files:
216
216
  - lib/clean_architecture/interfaces/authorization_parameters.rb
217
217
  - lib/clean_architecture/interfaces/base_parameters.rb
218
218
  - lib/clean_architecture/interfaces/jsonable.rb
219
- - lib/clean_architecture/interfaces/success_payload.rb
220
219
  - lib/clean_architecture/interfaces/targeted_parameters.rb
221
220
  - lib/clean_architecture/interfaces/use_case.rb
222
221
  - lib/clean_architecture/interfaces/use_case_actor.rb
@@ -229,8 +228,6 @@ files:
229
228
  - lib/clean_architecture/serializers/all.rb
230
229
  - lib/clean_architecture/serializers/html_response_from_result.rb
231
230
  - lib/clean_architecture/serializers/json_response_from_result.rb
232
- - lib/clean_architecture/serializers/success_collection_payload.rb
233
- - lib/clean_architecture/serializers/success_payload.rb
234
231
  - lib/clean_architecture/types.rb
235
232
  - lib/clean_architecture/use_cases/abstract_use_case.rb
236
233
  - lib/clean_architecture/use_cases/all.rb
@@ -1,20 +0,0 @@
1
- # typed: false
2
- # frozen_string_literal: true
3
-
4
- require 'duckface'
5
-
6
- module CleanArchitecture
7
- module Interfaces
8
- module SuccessPayload
9
- extend Duckface::ActsAsInterface
10
-
11
- def data
12
- raise NotImplementedError
13
- end
14
-
15
- def version
16
- raise NotImplementedError
17
- end
18
- end
19
- end
20
- end
@@ -1,29 +0,0 @@
1
- # typed: true
2
- # frozen_string_literal: true
3
-
4
- require 'duckface'
5
- require 'clean_architecture/interfaces/success_payload'
6
- require 'clean_architecture/serializers/success_payload'
7
-
8
- module CleanArchitecture
9
- module Serializers
10
- class SuccessCollectionPayload
11
- implements_interface CleanArchitecture::Interfaces::SuccessPayload
12
-
13
- def initialize(collection, use_case_target_class)
14
- @collection = collection
15
- @use_case_target_class = use_case_target_class
16
- end
17
-
18
- def data
19
- @collection.map do |object|
20
- SuccessPayload.new(@use_case_target_class.new(object)).data
21
- end
22
- end
23
-
24
- def version
25
- '1.0'
26
- end
27
- end
28
- end
29
- end
@@ -1,29 +0,0 @@
1
- # typed: true
2
- # frozen_string_literal: true
3
-
4
- require 'duckface'
5
- require 'clean_architecture/interfaces/success_payload'
6
-
7
- module CleanArchitecture
8
- module Serializers
9
- class SuccessPayload
10
- implements_interface CleanArchitecture::Interfaces::SuccessPayload
11
-
12
- def initialize(use_case_target)
13
- @use_case_target = use_case_target
14
- end
15
-
16
- def data
17
- {
18
- type: @use_case_target.type_name,
19
- id: @use_case_target.identifier,
20
- attributes: @use_case_target.attribute_hash
21
- }.compact
22
- end
23
-
24
- def version
25
- '1.0'
26
- end
27
- end
28
- end
29
- end