neon_operations 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -4
- data/Gemfile.lock +34 -17
- data/lib/neon_operations.rb +7 -4
- data/lib/neon_operations/version.rb +1 -1
- data/neon_operations.gemspec +7 -0
- metadata +73 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3790be8c0204bd073491450d7e0542ec41fecc7d5aa8e9e6d8819750d75d397
|
4
|
+
data.tar.gz: 4057ef5f728f62a6176b6955c9e34c10feced824fd326d2f660241eeacfa4e6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13da3df4c72ffefd76d0b9dcb64901454a769e9757d0205cd86a9c9a8dc7ac880a0382e58dcd3449efb8593bd44606ad1d82f598e2af5e07294564407ea58dc2
|
7
|
+
data.tar.gz: '03599f702957b993ac241da1e8f262a6523a04fd0774522bddb02177fa0a470dfc07c7286df09af2fe78d826274506aa7c3fa492275f192bb98422576ba2a27c'
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,33 +1,49 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
neon_operations (0.0.
|
4
|
+
neon_operations (0.0.2)
|
5
|
+
dry-monads (~> 1.3)
|
5
6
|
|
6
7
|
GEM
|
7
8
|
remote: https://rubygems.org/
|
8
9
|
specs:
|
9
10
|
ast (2.4.2)
|
11
|
+
coderay (1.1.3)
|
12
|
+
concurrent-ruby (1.1.9)
|
10
13
|
diff-lcs (1.4.4)
|
14
|
+
dry-core (0.6.0)
|
15
|
+
concurrent-ruby (~> 1.0)
|
16
|
+
dry-equalizer (0.3.0)
|
17
|
+
dry-monads (1.3.5)
|
18
|
+
concurrent-ruby (~> 1.0)
|
19
|
+
dry-core (~> 0.4, >= 0.4.4)
|
20
|
+
dry-equalizer
|
21
|
+
faker (2.17.0)
|
22
|
+
i18n (>= 1.6, < 2)
|
23
|
+
i18n (1.8.10)
|
24
|
+
concurrent-ruby (~> 1.0)
|
25
|
+
method_source (1.0.0)
|
11
26
|
parallel (1.20.1)
|
12
27
|
parser (3.0.1.0)
|
13
28
|
ast (~> 2.4.1)
|
29
|
+
pry (0.14.1)
|
30
|
+
coderay (~> 1.1)
|
31
|
+
method_source (~> 1.0)
|
14
32
|
rainbow (3.0.0)
|
15
|
-
rake (12.3.3)
|
16
33
|
regexp_parser (2.1.1)
|
17
34
|
rexml (3.2.5)
|
18
|
-
rspec (3.
|
19
|
-
rspec-core (~> 3.
|
20
|
-
rspec-expectations (~> 3.
|
21
|
-
rspec-mocks (~> 3.
|
22
|
-
rspec-core (3.
|
23
|
-
rspec-support (~> 3.
|
24
|
-
rspec-expectations (3.
|
35
|
+
rspec (3.0.0)
|
36
|
+
rspec-core (~> 3.0.0)
|
37
|
+
rspec-expectations (~> 3.0.0)
|
38
|
+
rspec-mocks (~> 3.0.0)
|
39
|
+
rspec-core (3.0.4)
|
40
|
+
rspec-support (~> 3.0.0)
|
41
|
+
rspec-expectations (3.0.4)
|
25
42
|
diff-lcs (>= 1.2.0, < 2.0)
|
26
|
-
rspec-support (~> 3.
|
27
|
-
rspec-mocks (3.
|
28
|
-
|
29
|
-
|
30
|
-
rspec-support (3.10.2)
|
43
|
+
rspec-support (~> 3.0.0)
|
44
|
+
rspec-mocks (3.0.4)
|
45
|
+
rspec-support (~> 3.0.0)
|
46
|
+
rspec-support (3.0.4)
|
31
47
|
rubocop (1.12.1)
|
32
48
|
parallel (~> 1.10)
|
33
49
|
parser (>= 3.0.0.0)
|
@@ -52,10 +68,11 @@ PLATFORMS
|
|
52
68
|
ruby
|
53
69
|
|
54
70
|
DEPENDENCIES
|
71
|
+
faker (= 2.17)
|
55
72
|
neon_operations!
|
56
|
-
|
57
|
-
rspec (
|
58
|
-
standard
|
73
|
+
pry (= 0.14.1)
|
74
|
+
rspec (= 3.0)
|
75
|
+
standard (= 1.0.5)
|
59
76
|
|
60
77
|
BUNDLED WITH
|
61
78
|
2.1.4
|
data/lib/neon_operations.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require "dry/monads"
|
1
2
|
require "neon_operations/version"
|
2
3
|
|
3
4
|
module NeonOperations
|
@@ -14,9 +15,7 @@ module NeonOperations
|
|
14
15
|
end
|
15
16
|
|
16
17
|
class Operation
|
17
|
-
|
18
|
-
new(input: input).call
|
19
|
-
end
|
18
|
+
include Dry::Monads[:maybe, :result]
|
20
19
|
|
21
20
|
def initialize(input:, schema_contract: nil)
|
22
21
|
@input = input
|
@@ -32,7 +31,11 @@ module NeonOperations
|
|
32
31
|
attr_reader :input, :schema_contract
|
33
32
|
|
34
33
|
def validate_input
|
35
|
-
schema_contract.
|
34
|
+
validation_result = schema_contract.call(input)
|
35
|
+
|
36
|
+
return Failure(validation_result) if validation_result.errors.any?
|
37
|
+
|
38
|
+
Success(validate_input)
|
36
39
|
end
|
37
40
|
end
|
38
41
|
end
|
data/neon_operations.gemspec
CHANGED
@@ -21,4 +21,11 @@ Gem::Specification.new do |spec|
|
|
21
21
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
22
22
|
end
|
23
23
|
spec.require_paths = ["lib"]
|
24
|
+
|
25
|
+
spec.add_runtime_dependency "dry-monads", "~> 1.3"
|
26
|
+
|
27
|
+
spec.add_development_dependency "pry", "0.14.1"
|
28
|
+
spec.add_development_dependency "rspec", "3.0"
|
29
|
+
spec.add_development_dependency "standard", "1.0.5"
|
30
|
+
spec.add_development_dependency "faker", "2.17"
|
24
31
|
end
|
metadata
CHANGED
@@ -1,15 +1,85 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neon_operations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Neon Law
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
12
|
-
dependencies:
|
11
|
+
date: 2021-07-04 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: dry-monads
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pry
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.14.1
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.14.1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: standard
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.0.5
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 1.0.5
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: faker
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '2.17'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '2.17'
|
13
83
|
description: A gem to standardize our use of Dry-RB
|
14
84
|
email:
|
15
85
|
- support@neonlaw.com
|