solid-result 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rubocop.yml +98 -0
- data/.rubocop_todo.yml +12 -0
- data/CHANGELOG.md +600 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/LICENSE.txt +21 -0
- data/README.md +2691 -0
- data/Rakefile +28 -0
- data/Steepfile +31 -0
- data/examples/multiple_listeners/Rakefile +55 -0
- data/examples/multiple_listeners/app/models/account/member.rb +10 -0
- data/examples/multiple_listeners/app/models/account/owner_creation.rb +62 -0
- data/examples/multiple_listeners/app/models/account.rb +11 -0
- data/examples/multiple_listeners/app/models/user/creation.rb +67 -0
- data/examples/multiple_listeners/app/models/user/token/creation.rb +51 -0
- data/examples/multiple_listeners/app/models/user/token.rb +7 -0
- data/examples/multiple_listeners/app/models/user.rb +15 -0
- data/examples/multiple_listeners/config/boot.rb +16 -0
- data/examples/multiple_listeners/config/initializers/solid_result.rb +9 -0
- data/examples/multiple_listeners/config.rb +27 -0
- data/examples/multiple_listeners/db/setup.rb +60 -0
- data/examples/multiple_listeners/lib/event_logs_listener/stdout.rb +60 -0
- data/examples/multiple_listeners/lib/runtime_breaker.rb +11 -0
- data/examples/multiple_listeners/lib/solid/result/event_logs_record.rb +27 -0
- data/examples/multiple_listeners/lib/solid/result/rollback_on_failure.rb +15 -0
- data/examples/service_objects/Rakefile +36 -0
- data/examples/service_objects/app/models/account/member.rb +10 -0
- data/examples/service_objects/app/models/account.rb +11 -0
- data/examples/service_objects/app/models/user/token.rb +7 -0
- data/examples/service_objects/app/models/user.rb +15 -0
- data/examples/service_objects/app/services/account/owner_creation.rb +47 -0
- data/examples/service_objects/app/services/application_service.rb +79 -0
- data/examples/service_objects/app/services/user/creation.rb +56 -0
- data/examples/service_objects/app/services/user/token/creation.rb +37 -0
- data/examples/service_objects/config/boot.rb +17 -0
- data/examples/service_objects/config/initializers/solid_result.rb +9 -0
- data/examples/service_objects/config.rb +20 -0
- data/examples/service_objects/db/setup.rb +49 -0
- data/examples/single_listener/Rakefile +92 -0
- data/examples/single_listener/app/models/account/member.rb +10 -0
- data/examples/single_listener/app/models/account/owner_creation.rb +62 -0
- data/examples/single_listener/app/models/account.rb +11 -0
- data/examples/single_listener/app/models/user/creation.rb +67 -0
- data/examples/single_listener/app/models/user/token/creation.rb +51 -0
- data/examples/single_listener/app/models/user/token.rb +7 -0
- data/examples/single_listener/app/models/user.rb +15 -0
- data/examples/single_listener/config/boot.rb +16 -0
- data/examples/single_listener/config/initializers/solid_result.rb +9 -0
- data/examples/single_listener/config.rb +23 -0
- data/examples/single_listener/db/setup.rb +49 -0
- data/examples/single_listener/lib/runtime_breaker.rb +11 -0
- data/examples/single_listener/lib/single_event_logs_listener.rb +117 -0
- data/examples/single_listener/lib/solid/result/rollback_on_failure.rb +15 -0
- data/lib/solid/failure.rb +23 -0
- data/lib/solid/output/callable_and_then.rb +40 -0
- data/lib/solid/output/expectations/mixin.rb +31 -0
- data/lib/solid/output/expectations.rb +25 -0
- data/lib/solid/output/failure.rb +9 -0
- data/lib/solid/output/mixin.rb +57 -0
- data/lib/solid/output/success.rb +37 -0
- data/lib/solid/output.rb +115 -0
- data/lib/solid/result/_self.rb +198 -0
- data/lib/solid/result/callable_and_then/caller.rb +49 -0
- data/lib/solid/result/callable_and_then/config.rb +15 -0
- data/lib/solid/result/callable_and_then/error.rb +11 -0
- data/lib/solid/result/callable_and_then.rb +9 -0
- data/lib/solid/result/config/options.rb +27 -0
- data/lib/solid/result/config/switcher.rb +82 -0
- data/lib/solid/result/config/switchers/addons.rb +25 -0
- data/lib/solid/result/config/switchers/constant_aliases.rb +33 -0
- data/lib/solid/result/config/switchers/features.rb +32 -0
- data/lib/solid/result/config/switchers/pattern_matching.rb +20 -0
- data/lib/solid/result/config.rb +64 -0
- data/lib/solid/result/contract/disabled.rb +25 -0
- data/lib/solid/result/contract/error.rb +17 -0
- data/lib/solid/result/contract/evaluator.rb +45 -0
- data/lib/solid/result/contract/for_types.rb +29 -0
- data/lib/solid/result/contract/for_types_and_values.rb +46 -0
- data/lib/solid/result/contract/interface.rb +21 -0
- data/lib/solid/result/contract/type_checker.rb +37 -0
- data/lib/solid/result/contract.rb +33 -0
- data/lib/solid/result/data.rb +33 -0
- data/lib/solid/result/error.rb +59 -0
- data/lib/solid/result/event_logs/config.rb +28 -0
- data/lib/solid/result/event_logs/listener.rb +51 -0
- data/lib/solid/result/event_logs/listeners.rb +87 -0
- data/lib/solid/result/event_logs/tracking/disabled.rb +15 -0
- data/lib/solid/result/event_logs/tracking/enabled.rb +161 -0
- data/lib/solid/result/event_logs/tracking.rb +26 -0
- data/lib/solid/result/event_logs/tree.rb +141 -0
- data/lib/solid/result/event_logs.rb +27 -0
- data/lib/solid/result/expectations/mixin.rb +58 -0
- data/lib/solid/result/expectations.rb +75 -0
- data/lib/solid/result/failure.rb +11 -0
- data/lib/solid/result/handler/allowed_types.rb +45 -0
- data/lib/solid/result/handler.rb +57 -0
- data/lib/solid/result/ignored_types.rb +14 -0
- data/lib/solid/result/mixin.rb +72 -0
- data/lib/solid/result/success.rb +11 -0
- data/lib/solid/result/version.rb +7 -0
- data/lib/solid/result.rb +27 -0
- data/lib/solid/success.rb +23 -0
- data/lib/solid-result.rb +3 -0
- data/sig/solid/failure.rbs +13 -0
- data/sig/solid/output.rbs +175 -0
- data/sig/solid/result/callable_and_then.rbs +60 -0
- data/sig/solid/result/config.rbs +102 -0
- data/sig/solid/result/contract.rbs +120 -0
- data/sig/solid/result/data.rbs +16 -0
- data/sig/solid/result/error.rbs +34 -0
- data/sig/solid/result/event_logs.rbs +189 -0
- data/sig/solid/result/expectations.rbs +71 -0
- data/sig/solid/result/handler.rbs +47 -0
- data/sig/solid/result/ignored_types.rbs +9 -0
- data/sig/solid/result/mixin.rbs +45 -0
- data/sig/solid/result/version.rbs +5 -0
- data/sig/solid/result.rbs +85 -0
- data/sig/solid/success.rbs +13 -0
- metadata +167 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 334ba2f20e61337d95baab4e3cc08ccaf627b5fa92ef7ca0c80e2e058e23f9e3
|
4
|
+
data.tar.gz: dbf13c9dc81cd38be65d01aead37f61801a9cc045a6a7886f025835b9d188267
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f4d222b456936f53b8a5d219f48a6d632e42950f19b9c8d8f30633a9101961ac16d43e394f6f64f28effcf5dbc4ff8e0c3cd4fd645696864879c89ad72495dc9
|
7
|
+
data.tar.gz: 3f001145ac4865c95ddf1b60f29edf095a5629ba09ed5f806ba92f590b66297d2e285936c17805b4985d3fe10198b0e3a8b9dc9b41aadea5ba112aab27076468
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
2
|
+
|
3
|
+
require:
|
4
|
+
- rubocop-performance
|
5
|
+
- rubocop-minitest
|
6
|
+
- rubocop-rake
|
7
|
+
|
8
|
+
AllCops:
|
9
|
+
NewCops: enable
|
10
|
+
TargetRubyVersion: 2.7
|
11
|
+
Exclude:
|
12
|
+
- 'examples/**/*'
|
13
|
+
- 'vendor/**/*'
|
14
|
+
- 'spec/fixtures/**/*'
|
15
|
+
- 'tmp/**/*'
|
16
|
+
- '.git/**/*'
|
17
|
+
- 'bin/*'
|
18
|
+
|
19
|
+
Lint/RescueException:
|
20
|
+
Exclude:
|
21
|
+
- lib/solid/result/event_logs/tracking/enabled.rb
|
22
|
+
|
23
|
+
Layout/LineLength:
|
24
|
+
Max: 120
|
25
|
+
|
26
|
+
Layout/ExtraSpacing:
|
27
|
+
AllowBeforeTrailingComments: true
|
28
|
+
|
29
|
+
Layout/MultilineMethodCallIndentation:
|
30
|
+
Enabled: false
|
31
|
+
|
32
|
+
Lint/UnderscorePrefixedVariableName:
|
33
|
+
Enabled: false
|
34
|
+
|
35
|
+
Lint/UnusedMethodArgument:
|
36
|
+
Exclude:
|
37
|
+
- lib/solid/result/event_logs/listener.rb
|
38
|
+
|
39
|
+
Style/AccessModifierDeclarations:
|
40
|
+
Enabled: false
|
41
|
+
|
42
|
+
Style/CaseEquality:
|
43
|
+
Enabled: false
|
44
|
+
|
45
|
+
Style/ClassAndModuleChildren:
|
46
|
+
Enabled: false
|
47
|
+
|
48
|
+
Style/Lambda:
|
49
|
+
EnforcedStyle: literal
|
50
|
+
|
51
|
+
Style/ParallelAssignment:
|
52
|
+
Enabled: false
|
53
|
+
|
54
|
+
Style/SingleLineMethods:
|
55
|
+
Enabled: false
|
56
|
+
|
57
|
+
Style/MapToSet:
|
58
|
+
Enabled: false
|
59
|
+
|
60
|
+
Style/MixinGrouping:
|
61
|
+
Enabled: false
|
62
|
+
|
63
|
+
Naming/MethodName:
|
64
|
+
Enabled: false
|
65
|
+
|
66
|
+
Naming/VariableName:
|
67
|
+
Enabled: false
|
68
|
+
|
69
|
+
Metrics/BlockLength:
|
70
|
+
Exclude:
|
71
|
+
- solid-result.gemspec
|
72
|
+
- test/**/*.rb
|
73
|
+
|
74
|
+
Metrics/ClassLength:
|
75
|
+
Exclude:
|
76
|
+
- lib/solid/result/_self.rb
|
77
|
+
- test/**/*.rb
|
78
|
+
|
79
|
+
Metrics/AbcSize:
|
80
|
+
Exclude:
|
81
|
+
- lib/solid/result/event_logs/tracking/enabled.rb
|
82
|
+
|
83
|
+
Minitest/MultipleAssertions:
|
84
|
+
Enabled: false
|
85
|
+
|
86
|
+
Minitest/AssertEmptyLiteral:
|
87
|
+
Enabled: false
|
88
|
+
|
89
|
+
Minitest/AssertOperator:
|
90
|
+
Enabled: false
|
91
|
+
|
92
|
+
Minitest/AssertWithExpectedArgument:
|
93
|
+
Exclude:
|
94
|
+
- test/test_helper.rb
|
95
|
+
|
96
|
+
Naming/FileName:
|
97
|
+
Exclude:
|
98
|
+
- lib/solid-result.rb
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2023-10-02 02:37:50 UTC using RuboCop version 1.56.3.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 24
|
10
|
+
# Configuration parameters: AllowedConstants.
|
11
|
+
Style/Documentation:
|
12
|
+
Enabled: false
|