clean-architecture 6.0.0 → 6.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 965f8cb51724ae428566763a1e147a628894aca145a0bd8606f4afd914782216
4
- data.tar.gz: a0568d6bf58da6241614e6dc233743401a016f68d0bbe941fbc3c67d4573ab95
3
+ metadata.gz: c35339a5f4a1b29b2d14cbeeda0a093c7a3d484e960dc87f8d66c631368ba6a3
4
+ data.tar.gz: 40ca69149815161a14b1e4405c25711be8ed86c48c3d6713a8b227e3944ff3fe
5
5
  SHA512:
6
- metadata.gz: 585f429567c611b024cec33b918eb9010d8e2db9b2183a4b71865377077918e686eee89ba22e18f7a11afb43ab097ebcf5e8d6d881c6406b156ddba7e57997e9
7
- data.tar.gz: 7f35db919f5a5cc12abc64079fbc9fc5e41cf2d362753cb69b6e7273a471798e6a3858d08b856f6242ad14ffb98e265c7e7c5aa047b0da2d138f17f3e2ddc4e6
6
+ metadata.gz: f46c9d37e7681bae1b605e5ecc9611d7847cb0e9319202de6db29cef3eeeaaee2ed4117b985faa96de803dfbfa30a007ba2dd120cf87dea11731eed1255c1846
7
+ data.tar.gz: 2a8312ffba474756ecd37693ba03b72f47ca9dcd6bb3a2161f2e5770434141234e9f23df6b5feef8dac51f08b4aad4bdd57eab9a143e778a098a3f4f5d50da83
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ 6.1.0
2
+
3
+ * Stop letting types be forgiving
4
+
1
5
  6.0.0
2
6
 
3
7
  * Tear out everything non-essential
@@ -10,7 +10,7 @@ module CleanArchitecture
10
10
  class UseCaseResult
11
11
  extend T::Sig
12
12
 
13
- sig { params(result: Dry::Monads::Result[T.any(T::Array[Object], String, Entities::FailureDetails), T.untyped], block: T.untyped).returns(T.untyped) }
13
+ sig { params(result: Dry::Monads::Result[Entities::FailureDetails, T.untyped], block: T.untyped).returns(T.untyped) }
14
14
  def self.call(result, &block)
15
15
  new.matcher.call(result, &block)
16
16
  end
@@ -34,24 +34,9 @@ module CleanArchitecture
34
34
  def failure_case
35
35
  Dry::Matcher::Case.new(
36
36
  match: ->(value) { value.is_a?(Dry::Monads::Failure) },
37
- resolve: ->(value) { resolve_failure_value(value) }
37
+ resolve: ->(value) { value.failure }
38
38
  )
39
39
  end
40
-
41
- sig { params(value: Dry::Monads::Result[T.any(T::Array[Object], String, Entities::FailureDetails), T.untyped]).returns(Entities::FailureDetails) }
42
- def resolve_failure_value(value)
43
- failure = value.failure
44
- case failure
45
- when Array
46
- Entities::FailureDetails.from_array(failure)
47
- when String
48
- Entities::FailureDetails.from_string(failure)
49
- when Entities::FailureDetails
50
- failure
51
- else
52
- T.absurd(failure)
53
- end
54
- end
55
40
  end
56
41
  end
57
42
  end
@@ -11,7 +11,7 @@ module CleanArchitecture
11
11
  class HtmlResponseFromResult
12
12
  extend T::Sig
13
13
 
14
- sig { params(result: Dry::Monads::Result[T.any(T::Array[Object], String, Entities::FailureDetails), T.untyped], http_method: String).void }
14
+ sig { params(result: Dry::Monads::Result[Entities::FailureDetails, T.untyped], http_method: String).void }
15
15
  def initialize(result, http_method)
16
16
  @result = result
17
17
  @http_method = http_method
@@ -12,7 +12,7 @@ module CleanArchitecture
12
12
  class JsonResponseFromResult
13
13
  extend T::Sig
14
14
 
15
- sig { params(result: Dry::Monads::Result[T.any(T::Array[Object], String, Entities::FailureDetails), T.untyped], http_method: String, success_payload_proc: T.proc.params(success_value: T.untyped).returns(T::Hash[T.untyped, T.untyped])).void }
15
+ sig { params(result: Dry::Monads::Result[Entities::FailureDetails, T.untyped], http_method: String, success_payload_proc: T.proc.params(success_value: T.untyped).returns(T::Hash[T.untyped, T.untyped])).void }
16
16
  def initialize(result, http_method, success_payload_proc)
17
17
  @result = result
18
18
  @http_method = http_method
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module CleanArchitecture
5
- VERSION = '6.0.0'
5
+ VERSION = '6.1.0'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clean-architecture
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0
4
+ version: 6.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bellroy Tech Team