gate 0.7.2 → 0.8.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: 764942a00c33c244c8aefe5ad380fbdfa21d71c1fd8709c96c242b9ce23080a6
4
- data.tar.gz: e9bbca7a93185da11b814a9de05d23882da41aa1e0ccc0100f5897a3e42a1cdb
3
+ metadata.gz: 31bc2ddaaad2763723a6461081c9af24bf28638bf1a65508ee78c161fc59ea8b
4
+ data.tar.gz: 2d1996e71c376ce3b20798c57bbeaf158144cbeced2823f34ba3864906ffa0b9
5
5
  SHA512:
6
- metadata.gz: c0f64707d6a9b9bc1267849b3f3a41a0c59f2a7c8424dfd11f084db65c15292c57915b360aa2a203fdfa738214d13b4b878a7a7d1b1f03c70a8bfabb055d91be
7
- data.tar.gz: 1588d4cbdbdbdcc420b776e84e47436bd33e1c7d5dae8df5a74cdf5c4152566ea7f2a041a568d985c87576ae858afe52217f6d3c7560ebaf970d3c0a209e4e17
6
+ metadata.gz: 1ceccd09976e8a763273033318bc5b6db8a740155d4d75f3badc06793f51fe9f37a955baed090f96b7e229b2d3fc46b39d32e6ee9ba9fc76636d61184fc6bbf5
7
+ data.tar.gz: 4a578fb794d00e413e4114eb7463f14307313d73f286cd644d6308b388e7fc5a38c7407be7ac03498a43c9402c00730ad542524a0209342592047778e9b59d18
@@ -1,29 +1,30 @@
1
- # coding: utf-8
2
- lib = File.expand_path("../lib", __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path("lib", __dir__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require "gate/version"
5
6
 
6
7
  Gem::Specification.new do |spec|
7
- spec.name = "gate"
8
- spec.version = Gate::VERSION
9
- spec.authors = ["Jan Dudulski"]
10
- spec.email = ["jan@dudulski.pl"]
8
+ spec.name = "gate"
9
+ spec.version = Gate::VERSION
10
+ spec.authors = ["Jan Dudulski"]
11
+ spec.email = ["jan@dudulski.pl"]
11
12
 
12
- spec.summary = "CQRS Command"
13
- spec.description = "Validate and coerce user input against defined structure."
14
- spec.homepage = "https://github.com/monterail/gate"
15
- spec.license = "MIT"
13
+ spec.summary = "CQRS Command"
14
+ spec.description = "Validate and coerce user input against defined structure."
15
+ spec.homepage = "https://github.com/monterail/gate"
16
+ spec.license = "MIT"
16
17
 
17
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^test/}) }
18
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^test/}) }
18
19
  spec.require_paths = ["lib"]
19
20
 
20
21
  spec.metadata["allowed_push_host"] = "https://rubygems.org"
21
22
 
22
- spec.add_runtime_dependency "dry-validation", "~> 0.11"
23
+ spec.add_runtime_dependency "dry-validation", "~> 0.12"
23
24
 
24
25
  spec.add_development_dependency "bundler", "~> 1.16"
25
- spec.add_development_dependency "rake", "~> 12.0"
26
- spec.add_development_dependency "pry", "~> 0.11"
27
- spec.add_development_dependency "minitest", "~> 5.11"
28
26
  spec.add_development_dependency "codeclimate-test-reporter", "~> 1.0"
27
+ spec.add_development_dependency "minitest", "~> 5.11"
28
+ spec.add_development_dependency "pry", "~> 0.11"
29
+ spec.add_development_dependency "rake", "~> 12.0"
29
30
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "forwardable"
2
4
 
3
5
  module Gate
@@ -33,10 +35,11 @@ module Gate
33
35
  end
34
36
 
35
37
  module ClassMethods
38
+ # rubocop:disable Metrics/MethodLength
36
39
  def schema(&block)
37
40
  if block_given?
38
41
  raise SchemaAlreadyRegistered if instance_variable_defined?(:@schema)
39
- @schema = Dry::Validation.Form(&block)
42
+ @schema = Dry::Validation.Params(&block)
40
43
  @schema.rules.keys.each do |name|
41
44
  define_method(name) do
42
45
  result[name]
@@ -47,9 +50,10 @@ module Gate
47
50
  @schema
48
51
  end
49
52
  end
53
+ # rubocop:enable Metrics/MethodLength
50
54
 
51
55
  def with(input)
52
- result = schema.(input)
56
+ result = schema.call(input)
53
57
  raise InvalidCommand, result.messages(full: true) if result.failure?
54
58
  new result.output
55
59
  end
@@ -1,3 +1,3 @@
1
1
  module Gate
2
- VERSION = "0.7.2"
2
+ VERSION = "0.8.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Dudulski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-20 00:00:00.000000000 Z
11
+ date: 2018-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-validation
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.11'
19
+ version: '0.12'
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: '0.11'
26
+ version: '0.12'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -39,61 +39,61 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.16'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rake
42
+ name: codeclimate-test-reporter
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '12.0'
47
+ version: '1.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '12.0'
54
+ version: '1.0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: pry
56
+ name: minitest
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0.11'
61
+ version: '5.11'
62
62
  type: :development
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: '0.11'
68
+ version: '5.11'
69
69
  - !ruby/object:Gem::Dependency
70
- name: minitest
70
+ name: pry
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '5.11'
75
+ version: '0.11'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '5.11'
82
+ version: '0.11'
83
83
  - !ruby/object:Gem::Dependency
84
- name: codeclimate-test-reporter
84
+ name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '1.0'
89
+ version: '12.0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '1.0'
96
+ version: '12.0'
97
97
  description: Validate and coerce user input against defined structure.
98
98
  email:
99
99
  - jan@dudulski.pl
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  version: '0'
139
139
  requirements: []
140
140
  rubyforge_project:
141
- rubygems_version: 2.7.6
141
+ rubygems_version: 2.7.7
142
142
  signing_key:
143
143
  specification_version: 4
144
144
  summary: CQRS Command