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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ee06454f2b8cc9eb84b6399068b6cbae7f0c4ab30a96f2ce0247e992f459a020
4
- data.tar.gz: b357c634e70488b51dc5316e910b76cd6eff4d3ef5e8f2fb6c3e74461efbca55
3
+ metadata.gz: a3790be8c0204bd073491450d7e0542ec41fecc7d5aa8e9e6d8819750d75d397
4
+ data.tar.gz: 4057ef5f728f62a6176b6955c9e34c10feced824fd326d2f660241eeacfa4e6f
5
5
  SHA512:
6
- metadata.gz: d3d0ccc9ec32f7574a099d26e5805b32dba7dd7e4b457d7f1bb50169723bf986b203832d2aa1838ddb1b8a7fb474db9c55554c4cabff6712fcafc8d47878400b
7
- data.tar.gz: 90164987ec62d7f417cad4685aae497f399ce9d191b40c8139f2f25a825eb08a4de03ca8fe10dbad3508d4fb0c45ec1a63f7b8d75169ce45b40fa8420ec1f899
6
+ metadata.gz: 13da3df4c72ffefd76d0b9dcb64901454a769e9757d0205cd86a9c9a8dc7ac880a0382e58dcd3449efb8593bd44606ad1d82f598e2af5e07294564407ea58dc2
7
+ data.tar.gz: '03599f702957b993ac241da1e8f262a6523a04fd0774522bddb02177fa0a470dfc07c7286df09af2fe78d826274506aa7c3fa492275f192bb98422576ba2a27c'
data/Gemfile CHANGED
@@ -2,7 +2,3 @@ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in neon_postgres.gemspec
4
4
  gemspec
5
-
6
- gem "rake", "~> 12.0"
7
- gem "rspec", "~> 3.0"
8
- gem "standard"
data/Gemfile.lock CHANGED
@@ -1,33 +1,49 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- neon_operations (0.0.1)
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.10.0)
19
- rspec-core (~> 3.10.0)
20
- rspec-expectations (~> 3.10.0)
21
- rspec-mocks (~> 3.10.0)
22
- rspec-core (3.10.1)
23
- rspec-support (~> 3.10.0)
24
- rspec-expectations (3.10.1)
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.10.0)
27
- rspec-mocks (3.10.2)
28
- diff-lcs (>= 1.2.0, < 2.0)
29
- rspec-support (~> 3.10.0)
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
- rake (~> 12.0)
57
- rspec (~> 3.0)
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
@@ -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
- def self.call(input:)
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.validate(input)
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
@@ -1,3 +1,3 @@
1
1
  module NeonOperations
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -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.1
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-06-29 00:00:00.000000000 Z
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