use_cases 3.0.0 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -0
- data/Gemfile +7 -8
- data/Gemfile.lock +49 -49
- data/lib/use_cases/module_optins/validated.rb +1 -0
- data/lib/use_cases/result.rb +12 -2
- data/lib/use_cases/version.rb +1 -1
- data/use_cases.gemspec +2 -2
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85052ba74b76415cee8c9450c1705bc4b23d695f74625bd20ecb72a034bc34c5
|
4
|
+
data.tar.gz: 4bcae2e34010a1e321e366066c79add5565a6805a38962e6a1478aa032f5869c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 158ffaaf8361d65b2747a7cc7f7349f84aefcb36a86b4fda5b45435bbb998e042b8d48bc4f305d52bcaca7072245bfce01e9befc1a47820e85920939059a917c
|
7
|
+
data.tar.gz: 6ed08ac0933e1e39d3249eaf637079e5c72d790770953a9d29aa2d3dd186474041a8119a1e2949ffa23537828dd3575001d06e163c303257dac5b35ecde25322
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.0.5
|
data/Gemfile
CHANGED
@@ -5,16 +5,15 @@ source "https://rubygems.org"
|
|
5
5
|
# Specify your gem's dependencies in use_cases.gemspec
|
6
6
|
gemspec
|
7
7
|
|
8
|
-
gem "activesupport"
|
9
|
-
gem "dry-
|
10
|
-
gem "dry-
|
11
|
-
gem "dry-
|
12
|
-
gem "dry-validation"
|
8
|
+
gem "activesupport", "~> 6.1.7"
|
9
|
+
gem "dry-matcher", "~> 0.8.1"
|
10
|
+
gem "dry-monads", "~> 1.0.0"
|
11
|
+
gem "dry-validation", "~> 1.8.1"
|
13
12
|
|
14
13
|
group :development, :test do
|
15
14
|
gem "pry-byebug"
|
16
15
|
gem "rake", "~> 13.0"
|
17
|
-
gem "rspec", "~> 3.0"
|
18
|
-
gem "rubocop", "~> 1.
|
19
|
-
gem "simplecov", require: false
|
16
|
+
gem "rspec", "~> 3.12.0"
|
17
|
+
gem "rubocop", "~> 1.41.1"
|
18
|
+
gem "simplecov", "~> 0.22.0", require: false
|
20
19
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
use_cases (
|
5
|
-
activesupport (>=
|
4
|
+
use_cases (3.0.1)
|
5
|
+
activesupport (>= 6.1.7)
|
6
6
|
dry-matcher (>= 0.8.1)
|
7
7
|
dry-monads (>= 1.0.0)
|
8
|
-
dry-validation (>=
|
8
|
+
dry-validation (>= 1.8.1)
|
9
9
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
activesupport (6.1.
|
13
|
+
activesupport (6.1.7)
|
14
14
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
15
15
|
i18n (>= 1.6, < 2)
|
16
16
|
minitest (>= 5.1)
|
@@ -20,7 +20,7 @@ GEM
|
|
20
20
|
byebug (11.1.3)
|
21
21
|
coderay (1.1.3)
|
22
22
|
concurrent-ruby (1.1.9)
|
23
|
-
diff-lcs (1.
|
23
|
+
diff-lcs (1.5.0)
|
24
24
|
docile (1.4.0)
|
25
25
|
dry-configurable (0.13.0)
|
26
26
|
concurrent-ruby (~> 1.0)
|
@@ -30,19 +30,18 @@ GEM
|
|
30
30
|
dry-configurable (~> 0.13, >= 0.13.0)
|
31
31
|
dry-core (0.7.1)
|
32
32
|
concurrent-ruby (~> 1.0)
|
33
|
-
dry-
|
34
|
-
concurrent-ruby (~> 1.0)
|
35
|
-
dry-core (~> 0.5, >= 0.5)
|
33
|
+
dry-equalizer (0.3.0)
|
36
34
|
dry-inflector (0.2.1)
|
37
35
|
dry-initializer (3.0.4)
|
38
36
|
dry-logic (1.2.0)
|
39
37
|
concurrent-ruby (~> 1.0)
|
40
38
|
dry-core (~> 0.5, >= 0.5)
|
41
|
-
dry-matcher (0.
|
42
|
-
dry-core (
|
43
|
-
dry-monads (1.
|
39
|
+
dry-matcher (0.8.3)
|
40
|
+
dry-core (>= 0.4.8)
|
41
|
+
dry-monads (1.0.1)
|
44
42
|
concurrent-ruby (~> 1.0)
|
45
|
-
dry-core (~> 0.
|
43
|
+
dry-core (~> 0.4, >= 0.4.4)
|
44
|
+
dry-equalizer
|
46
45
|
dry-schema (1.8.0)
|
47
46
|
concurrent-ruby (~> 1.0)
|
48
47
|
dry-configurable (~> 0.13, >= 0.13.0)
|
@@ -56,18 +55,19 @@ GEM
|
|
56
55
|
dry-core (~> 0.5, >= 0.5)
|
57
56
|
dry-inflector (~> 0.1, >= 0.1.2)
|
58
57
|
dry-logic (~> 1.0, >= 1.0.2)
|
59
|
-
dry-validation (1.
|
58
|
+
dry-validation (1.8.1)
|
60
59
|
concurrent-ruby (~> 1.0)
|
61
60
|
dry-container (~> 0.7, >= 0.7.1)
|
62
61
|
dry-core (~> 0.5, >= 0.5)
|
63
62
|
dry-initializer (~> 3.0)
|
64
63
|
dry-schema (~> 1.8, >= 1.8.0)
|
65
|
-
i18n (1.
|
64
|
+
i18n (1.12.0)
|
66
65
|
concurrent-ruby (~> 1.0)
|
66
|
+
json (2.6.3)
|
67
67
|
method_source (1.0.0)
|
68
|
-
minitest (5.
|
69
|
-
parallel (1.
|
70
|
-
parser (3.
|
68
|
+
minitest (5.17.0)
|
69
|
+
parallel (1.22.1)
|
70
|
+
parser (3.2.0.0)
|
71
71
|
ast (~> 2.4.1)
|
72
72
|
pry (0.14.1)
|
73
73
|
coderay (~> 1.1)
|
@@ -75,45 +75,46 @@ GEM
|
|
75
75
|
pry-byebug (3.10.1)
|
76
76
|
byebug (~> 11.0)
|
77
77
|
pry (>= 0.13, < 0.15)
|
78
|
-
rainbow (3.
|
78
|
+
rainbow (3.1.1)
|
79
79
|
rake (13.0.6)
|
80
|
-
regexp_parser (2.
|
80
|
+
regexp_parser (2.6.1)
|
81
81
|
rexml (3.2.5)
|
82
|
-
rspec (3.
|
83
|
-
rspec-core (~> 3.
|
84
|
-
rspec-expectations (~> 3.
|
85
|
-
rspec-mocks (~> 3.
|
86
|
-
rspec-core (3.
|
87
|
-
rspec-support (~> 3.
|
88
|
-
rspec-expectations (3.
|
82
|
+
rspec (3.12.0)
|
83
|
+
rspec-core (~> 3.12.0)
|
84
|
+
rspec-expectations (~> 3.12.0)
|
85
|
+
rspec-mocks (~> 3.12.0)
|
86
|
+
rspec-core (3.12.0)
|
87
|
+
rspec-support (~> 3.12.0)
|
88
|
+
rspec-expectations (3.12.1)
|
89
89
|
diff-lcs (>= 1.2.0, < 2.0)
|
90
|
-
rspec-support (~> 3.
|
91
|
-
rspec-mocks (3.
|
90
|
+
rspec-support (~> 3.12.0)
|
91
|
+
rspec-mocks (3.12.1)
|
92
92
|
diff-lcs (>= 1.2.0, < 2.0)
|
93
|
-
rspec-support (~> 3.
|
94
|
-
rspec-support (3.
|
95
|
-
rubocop (1.
|
93
|
+
rspec-support (~> 3.12.0)
|
94
|
+
rspec-support (3.12.0)
|
95
|
+
rubocop (1.41.1)
|
96
|
+
json (~> 2.3)
|
96
97
|
parallel (~> 1.10)
|
97
|
-
parser (>= 3.
|
98
|
+
parser (>= 3.1.2.1)
|
98
99
|
rainbow (>= 2.2.2, < 4.0)
|
99
100
|
regexp_parser (>= 1.8, < 3.0)
|
100
|
-
rexml
|
101
|
-
rubocop-ast (>= 1.
|
101
|
+
rexml (>= 3.2.5, < 4.0)
|
102
|
+
rubocop-ast (>= 1.23.0, < 2.0)
|
102
103
|
ruby-progressbar (~> 1.7)
|
103
104
|
unicode-display_width (>= 1.4.0, < 3.0)
|
104
|
-
rubocop-ast (1.
|
105
|
-
parser (>= 3.
|
105
|
+
rubocop-ast (1.24.1)
|
106
|
+
parser (>= 3.1.1.0)
|
106
107
|
ruby-progressbar (1.11.0)
|
107
|
-
simplecov (0.
|
108
|
+
simplecov (0.22.0)
|
108
109
|
docile (~> 1.1)
|
109
110
|
simplecov-html (~> 0.11)
|
110
111
|
simplecov_json_formatter (~> 0.1)
|
111
112
|
simplecov-html (0.12.3)
|
112
|
-
simplecov_json_formatter (0.1.
|
113
|
-
tzinfo (2.0.
|
113
|
+
simplecov_json_formatter (0.1.4)
|
114
|
+
tzinfo (2.0.5)
|
114
115
|
concurrent-ruby (~> 1.0)
|
115
|
-
unicode-display_width (2.
|
116
|
-
zeitwerk (2.
|
116
|
+
unicode-display_width (2.4.2)
|
117
|
+
zeitwerk (2.6.6)
|
117
118
|
|
118
119
|
PLATFORMS
|
119
120
|
x86_64-darwin-20
|
@@ -121,17 +122,16 @@ PLATFORMS
|
|
121
122
|
x86_64-linux
|
122
123
|
|
123
124
|
DEPENDENCIES
|
124
|
-
activesupport
|
125
|
+
activesupport (~> 6.1.7)
|
125
126
|
byebug
|
126
|
-
dry-
|
127
|
-
dry-
|
128
|
-
dry-
|
129
|
-
dry-validation
|
127
|
+
dry-matcher (~> 0.8.1)
|
128
|
+
dry-monads (~> 1.0.0)
|
129
|
+
dry-validation (~> 1.8.1)
|
130
130
|
pry-byebug
|
131
131
|
rake (~> 13.0)
|
132
|
-
rspec (~> 3.0)
|
133
|
-
rubocop (~> 1.
|
134
|
-
simplecov
|
132
|
+
rspec (~> 3.12.0)
|
133
|
+
rubocop (~> 1.41.1)
|
134
|
+
simplecov (~> 0.22.0)
|
135
135
|
use_cases!
|
136
136
|
|
137
137
|
BUNDLED WITH
|
data/lib/use_cases/result.rb
CHANGED
@@ -10,9 +10,19 @@ module UseCases
|
|
10
10
|
@result = result
|
11
11
|
end
|
12
12
|
|
13
|
+
def method_missing(method, *args, &block)
|
14
|
+
return result.send(method, *args, &block) if result.respond_to?(method)
|
15
|
+
|
16
|
+
super
|
17
|
+
end
|
18
|
+
|
19
|
+
def respond_to_missing?(method, include_private = false)
|
20
|
+
result.respond_to?(method, include_private) || super
|
21
|
+
end
|
22
|
+
|
13
23
|
def value
|
14
24
|
return result if result_not_monad?
|
15
|
-
return
|
25
|
+
return if result_empty?
|
16
26
|
|
17
27
|
result.success? ? result.value! : result.failure
|
18
28
|
end
|
@@ -39,7 +49,7 @@ module UseCases
|
|
39
49
|
end
|
40
50
|
|
41
51
|
def to_result
|
42
|
-
|
52
|
+
result
|
43
53
|
end
|
44
54
|
|
45
55
|
def result_empty?
|
data/lib/use_cases/version.rb
CHANGED
data/use_cases.gemspec
CHANGED
@@ -30,10 +30,10 @@ Gem::Specification.new do |spec|
|
|
30
30
|
# For more information and examples about making a new gem, checkout our
|
31
31
|
# guide at: https://bundler.io/guides/creating_gem.html
|
32
32
|
|
33
|
-
spec.add_dependency "activesupport", ">=
|
33
|
+
spec.add_dependency "activesupport", ">= 6.1.7"
|
34
34
|
spec.add_dependency "dry-matcher", ">= 0.8.1"
|
35
35
|
spec.add_dependency "dry-monads", ">= 1.0.0"
|
36
|
-
spec.add_dependency "dry-validation", ">=
|
36
|
+
spec.add_dependency "dry-validation", ">= 1.8.1"
|
37
37
|
|
38
38
|
spec.add_development_dependency "byebug"
|
39
39
|
spec.add_development_dependency "rake"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: use_cases
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ring Twice
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 6.1.7
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 6.1.7
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: dry-matcher
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 1.8.1
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 1.8.1
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: byebug
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -135,6 +135,7 @@ files:
|
|
135
135
|
- ".rspec"
|
136
136
|
- ".rubocop.yml"
|
137
137
|
- ".rubocop_todo.yml"
|
138
|
+
- ".ruby-version"
|
138
139
|
- CHANGELOG.md
|
139
140
|
- CODE_OF_CONDUCT.md
|
140
141
|
- Gemfile
|