dry-validation 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +8 -0
- data/.rspec +3 -0
- data/.rubocop.yml +16 -0
- data/.rubocop_todo.yml +7 -0
- data/.travis.yml +29 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +11 -0
- data/LICENSE +20 -0
- data/README.md +297 -0
- data/Rakefile +12 -0
- data/config/errors.yml +35 -0
- data/dry-validation.gemspec +25 -0
- data/examples/basic.rb +21 -0
- data/examples/nested.rb +30 -0
- data/examples/rule_ast.rb +33 -0
- data/lib/dry-validation.rb +1 -0
- data/lib/dry/validation.rb +12 -0
- data/lib/dry/validation/error.rb +43 -0
- data/lib/dry/validation/error_compiler.rb +116 -0
- data/lib/dry/validation/messages.rb +71 -0
- data/lib/dry/validation/predicate.rb +39 -0
- data/lib/dry/validation/predicate_set.rb +22 -0
- data/lib/dry/validation/predicates.rb +88 -0
- data/lib/dry/validation/result.rb +64 -0
- data/lib/dry/validation/rule.rb +125 -0
- data/lib/dry/validation/rule_compiler.rb +57 -0
- data/lib/dry/validation/schema.rb +74 -0
- data/lib/dry/validation/schema/definition.rb +15 -0
- data/lib/dry/validation/schema/key.rb +39 -0
- data/lib/dry/validation/schema/rule.rb +28 -0
- data/lib/dry/validation/schema/value.rb +31 -0
- data/lib/dry/validation/version.rb +5 -0
- data/rakelib/rubocop.rake +18 -0
- data/spec/fixtures/errors.yml +4 -0
- data/spec/integration/custom_error_messages_spec.rb +35 -0
- data/spec/integration/custom_predicates_spec.rb +57 -0
- data/spec/integration/validation_spec.rb +118 -0
- data/spec/shared/predicates.rb +31 -0
- data/spec/spec_helper.rb +18 -0
- data/spec/unit/error_compiler_spec.rb +165 -0
- data/spec/unit/predicate_spec.rb +37 -0
- data/spec/unit/predicates/empty_spec.rb +38 -0
- data/spec/unit/predicates/eql_spec.rb +21 -0
- data/spec/unit/predicates/exclusion_spec.rb +35 -0
- data/spec/unit/predicates/filled_spec.rb +38 -0
- data/spec/unit/predicates/format_spec.rb +21 -0
- data/spec/unit/predicates/gt_spec.rb +40 -0
- data/spec/unit/predicates/gteq_spec.rb +40 -0
- data/spec/unit/predicates/inclusion_spec.rb +35 -0
- data/spec/unit/predicates/int_spec.rb +34 -0
- data/spec/unit/predicates/key_spec.rb +29 -0
- data/spec/unit/predicates/lt_spec.rb +40 -0
- data/spec/unit/predicates/lteq_spec.rb +40 -0
- data/spec/unit/predicates/max_size_spec.rb +49 -0
- data/spec/unit/predicates/min_size_spec.rb +49 -0
- data/spec/unit/predicates/nil_spec.rb +28 -0
- data/spec/unit/predicates/size_spec.rb +49 -0
- data/spec/unit/predicates/str_spec.rb +32 -0
- data/spec/unit/rule/each_spec.rb +20 -0
- data/spec/unit/rule/key_spec.rb +27 -0
- data/spec/unit/rule/set_spec.rb +32 -0
- data/spec/unit/rule/value_spec.rb +42 -0
- data/spec/unit/rule_compiler_spec.rb +86 -0
- metadata +230 -0
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'dry/validation/predicates'
|
2
|
+
|
3
|
+
RSpec.describe Dry::Validation::Predicates do
|
4
|
+
describe '#max_size?' do
|
5
|
+
let(:predicate_name) { :max_size? }
|
6
|
+
|
7
|
+
context 'when value size is less than n' do
|
8
|
+
let(:arguments_list) do
|
9
|
+
[
|
10
|
+
[3, [1, 2]],
|
11
|
+
[5, 'Jill'],
|
12
|
+
[3, { 1 => 'st', 2 => 'nd' }],
|
13
|
+
[9, 1],
|
14
|
+
[6, 1..5]
|
15
|
+
]
|
16
|
+
end
|
17
|
+
|
18
|
+
it_behaves_like 'a passing predicate'
|
19
|
+
end
|
20
|
+
|
21
|
+
context 'when value size is equal to n' do
|
22
|
+
let(:arguments_list) do
|
23
|
+
[
|
24
|
+
[2, [1, 2]],
|
25
|
+
[4, 'Jill'],
|
26
|
+
[2, { 1 => 'st', 2 => 'nd' }],
|
27
|
+
[8, 1],
|
28
|
+
[5, 1..5]
|
29
|
+
]
|
30
|
+
end
|
31
|
+
|
32
|
+
it_behaves_like 'a passing predicate'
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'with value size is greater than n' do
|
36
|
+
let(:arguments_list) do
|
37
|
+
[
|
38
|
+
[1, [1, 2]],
|
39
|
+
[3, 'Jill'],
|
40
|
+
[1, { 1 => 'st', 2 => 'nd' }],
|
41
|
+
[7, 1],
|
42
|
+
[4, 1..5]
|
43
|
+
]
|
44
|
+
end
|
45
|
+
|
46
|
+
it_behaves_like 'a failing predicate'
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'dry/validation/predicates'
|
2
|
+
|
3
|
+
RSpec.describe Dry::Validation::Predicates do
|
4
|
+
describe '#min_size?' do
|
5
|
+
let(:predicate_name) { :min_size? }
|
6
|
+
|
7
|
+
context 'when value size is greater than n' do
|
8
|
+
let(:arguments_list) do
|
9
|
+
[
|
10
|
+
[1, [1, 2]],
|
11
|
+
[3, 'Jill'],
|
12
|
+
[1, { 1 => 'st', 2 => 'nd' }],
|
13
|
+
[7, 1],
|
14
|
+
[4, 1..5]
|
15
|
+
]
|
16
|
+
end
|
17
|
+
|
18
|
+
it_behaves_like 'a passing predicate'
|
19
|
+
end
|
20
|
+
|
21
|
+
context 'when value size is equal to n' do
|
22
|
+
let(:arguments_list) do
|
23
|
+
[
|
24
|
+
[2, [1, 2]],
|
25
|
+
[4, 'Jill'],
|
26
|
+
[2, { 1 => 'st', 2 => 'nd' }],
|
27
|
+
[8, 1],
|
28
|
+
[5, 1..5]
|
29
|
+
]
|
30
|
+
end
|
31
|
+
|
32
|
+
it_behaves_like 'a passing predicate'
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'with value size is less than n' do
|
36
|
+
let(:arguments_list) do
|
37
|
+
[
|
38
|
+
[3, [1, 2]],
|
39
|
+
[5, 'Jill'],
|
40
|
+
[3, { 1 => 'st', 2 => 'nd' }],
|
41
|
+
[9, 1],
|
42
|
+
[6, 1..5]
|
43
|
+
]
|
44
|
+
end
|
45
|
+
|
46
|
+
it_behaves_like 'a failing predicate'
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'dry/validation/predicates'
|
2
|
+
|
3
|
+
RSpec.describe Dry::Validation::Predicates do
|
4
|
+
describe '#nil?' do
|
5
|
+
let(:predicate_name) { :nil? }
|
6
|
+
|
7
|
+
context 'when value is nil' do
|
8
|
+
let(:arguments_list) { [[nil]] }
|
9
|
+
it_behaves_like 'a passing predicate'
|
10
|
+
end
|
11
|
+
|
12
|
+
context 'when value is not nil' do
|
13
|
+
let(:arguments_list) do
|
14
|
+
[
|
15
|
+
[''],
|
16
|
+
[true],
|
17
|
+
[false],
|
18
|
+
[0],
|
19
|
+
[:symbol],
|
20
|
+
[[]],
|
21
|
+
[{}],
|
22
|
+
[String]
|
23
|
+
]
|
24
|
+
end
|
25
|
+
it_behaves_like 'a failing predicate'
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'dry/validation/predicates'
|
2
|
+
|
3
|
+
RSpec.describe Dry::Validation::Predicates do
|
4
|
+
describe '#size?' do
|
5
|
+
let(:predicate_name) { :size? }
|
6
|
+
|
7
|
+
context 'when value size is equal to n' do
|
8
|
+
let(:arguments_list) do
|
9
|
+
[
|
10
|
+
[2, [1, 2]],
|
11
|
+
[4, 'Jill'],
|
12
|
+
[2, { 1 => 'st', 2 => 'nd' }],
|
13
|
+
[8, 1],
|
14
|
+
[5, 1..5]
|
15
|
+
]
|
16
|
+
end
|
17
|
+
|
18
|
+
it_behaves_like 'a passing predicate'
|
19
|
+
end
|
20
|
+
|
21
|
+
context 'when value size is less than n' do
|
22
|
+
let(:arguments_list) do
|
23
|
+
[
|
24
|
+
[3, [1, 2]],
|
25
|
+
[5, 'Jill'],
|
26
|
+
[3, { 1 => 'st', 2 => 'nd' }],
|
27
|
+
[9, 1],
|
28
|
+
[6, 1..5]
|
29
|
+
]
|
30
|
+
end
|
31
|
+
|
32
|
+
it_behaves_like 'a failing predicate'
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'with value size is greater than n' do
|
36
|
+
let(:arguments_list) do
|
37
|
+
[
|
38
|
+
[1, [1, 2]],
|
39
|
+
[3, 'Jill'],
|
40
|
+
[1, { 1 => 'st', 2 => 'nd' }],
|
41
|
+
[7, 1],
|
42
|
+
[4, 1..5]
|
43
|
+
]
|
44
|
+
end
|
45
|
+
|
46
|
+
it_behaves_like 'a failing predicate'
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'dry/validation/predicates'
|
2
|
+
|
3
|
+
RSpec.describe Dry::Validation::Predicates do
|
4
|
+
describe '#str?' do
|
5
|
+
let(:predicate_name) { :str? }
|
6
|
+
|
7
|
+
context 'when value is a string' do
|
8
|
+
let(:arguments_list) do
|
9
|
+
[
|
10
|
+
[''],
|
11
|
+
['John']
|
12
|
+
]
|
13
|
+
end
|
14
|
+
|
15
|
+
it_behaves_like 'a passing predicate'
|
16
|
+
end
|
17
|
+
|
18
|
+
context 'with value is not a string' do
|
19
|
+
let(:arguments_list) do
|
20
|
+
[
|
21
|
+
[[]],
|
22
|
+
[{}],
|
23
|
+
[nil],
|
24
|
+
[:symbol],
|
25
|
+
[String]
|
26
|
+
]
|
27
|
+
end
|
28
|
+
|
29
|
+
it_behaves_like 'a failing predicate'
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'dry/validation/rule'
|
2
|
+
|
3
|
+
RSpec.describe Dry::Validation::Rule::Each do
|
4
|
+
include_context 'predicates'
|
5
|
+
|
6
|
+
subject(:address_rule) do
|
7
|
+
Dry::Validation::Rule::Each.new(:name, is_string)
|
8
|
+
end
|
9
|
+
|
10
|
+
let(:is_string) { Dry::Validation::Rule::Value.new(:name, str?) }
|
11
|
+
|
12
|
+
describe '#call' do
|
13
|
+
it 'applies its rules to all elements in the input' do
|
14
|
+
expect(address_rule.(['Address'])).to be_success
|
15
|
+
|
16
|
+
expect(address_rule.([nil, 'Address'])).to be_failure
|
17
|
+
expect(address_rule.([:Address, 'Address'])).to be_failure
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'dry/validation/rule'
|
2
|
+
|
3
|
+
RSpec.describe Dry::Validation::Rule::Key do
|
4
|
+
include_context 'predicates'
|
5
|
+
|
6
|
+
subject(:rule) { Dry::Validation::Rule::Key.new(:name, key?) }
|
7
|
+
|
8
|
+
describe '#call' do
|
9
|
+
it 'applies predicate to the value' do
|
10
|
+
expect(rule.(name: 'Jane')).to be_success
|
11
|
+
expect(rule.({})).to be_failure
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
describe '#and' do
|
16
|
+
let(:other) { Dry::Validation::Rule::Value.new(:name, str?) }
|
17
|
+
|
18
|
+
it 'returns conjunction rule where value is passed to the right' do
|
19
|
+
present_and_string = rule.and(other)
|
20
|
+
|
21
|
+
expect(present_and_string.(name: 'Jane')).to be_success
|
22
|
+
|
23
|
+
expect(present_and_string.({})).to be_failure
|
24
|
+
expect(present_and_string.(name: 1)).to be_failure
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'dry/validation/rule'
|
2
|
+
|
3
|
+
RSpec.describe Dry::Validation::Rule::Set do
|
4
|
+
include_context 'predicates'
|
5
|
+
|
6
|
+
subject(:rule) do
|
7
|
+
Dry::Validation::Rule::Set.new(:address, [is_string, min_size.curry(6)])
|
8
|
+
end
|
9
|
+
|
10
|
+
let(:is_string) { Dry::Validation::Rule::Value.new(:name, str?) }
|
11
|
+
let(:min_size) { Dry::Validation::Rule::Value.new(:name, min_size?) }
|
12
|
+
|
13
|
+
describe '#call' do
|
14
|
+
it 'applies its rules to the input' do
|
15
|
+
expect(rule.('Address')).to be_success
|
16
|
+
expect(rule.('Addr')).to be_failure
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
describe '#to_ary' do
|
21
|
+
it 'returns an array representation' do
|
22
|
+
expect(rule).to match_array([
|
23
|
+
:set, [
|
24
|
+
:address, [
|
25
|
+
[:val, [:name, [:predicate, [:str?, []]]]],
|
26
|
+
[:val, [:name, [:predicate, [:min_size?, [6]]]]]
|
27
|
+
]
|
28
|
+
]
|
29
|
+
])
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'dry/validation/rule'
|
2
|
+
|
3
|
+
RSpec.describe Dry::Validation::Rule::Value do
|
4
|
+
include_context 'predicates'
|
5
|
+
|
6
|
+
let(:is_nil) { Dry::Validation::Rule::Value.new(:name, nil?) }
|
7
|
+
|
8
|
+
let(:is_string) { Dry::Validation::Rule::Value.new(:name, str?) }
|
9
|
+
|
10
|
+
let(:min_size) { Dry::Validation::Rule::Value.new(:name, min_size?) }
|
11
|
+
|
12
|
+
describe '#call' do
|
13
|
+
it 'returns result of a predicate' do
|
14
|
+
expect(is_string.(1)).to be_failure
|
15
|
+
expect(is_string.('1')).to be_success
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
describe '#and' do
|
20
|
+
it 'returns a conjunction' do
|
21
|
+
string_and_min_size = is_string.and(min_size.curry(3))
|
22
|
+
|
23
|
+
expect(string_and_min_size.('abc')).to be_success
|
24
|
+
expect(string_and_min_size.('abcd')).to be_success
|
25
|
+
|
26
|
+
expect(string_and_min_size.(1)).to be_failure
|
27
|
+
expect(string_and_min_size.('ab')).to be_failure
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe '#or' do
|
32
|
+
it 'returns a disjunction' do
|
33
|
+
nil_or_string = is_nil.or(is_string)
|
34
|
+
|
35
|
+
expect(nil_or_string.(nil)).to be_success
|
36
|
+
expect(nil_or_string.('abcd')).to be_success
|
37
|
+
|
38
|
+
expect(nil_or_string.(true)).to be_failure
|
39
|
+
expect(nil_or_string.(1)).to be_failure
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
require 'dry/validation/rule_compiler'
|
2
|
+
|
3
|
+
RSpec.describe Dry::Validation::RuleCompiler, '#call' do
|
4
|
+
subject(:compiler) { RuleCompiler.new(predicates) }
|
5
|
+
|
6
|
+
let(:predicates) {
|
7
|
+
{ key?: predicate, filled?: predicate }
|
8
|
+
}
|
9
|
+
|
10
|
+
let(:predicate) { double(:predicate).as_null_object }
|
11
|
+
|
12
|
+
let(:key_rule) { Rule::Key.new(:email, predicate) }
|
13
|
+
let(:val_rule) { Rule::Value.new(:email, predicate) }
|
14
|
+
let(:and_rule) { key_rule & val_rule }
|
15
|
+
let(:or_rule) { key_rule | val_rule }
|
16
|
+
let(:set_rule) { Rule::Set.new(:email, [val_rule]) }
|
17
|
+
let(:each_rule) { Rule::Each.new(:email, val_rule) }
|
18
|
+
|
19
|
+
it 'compiles key rules' do
|
20
|
+
ast = [[:key, [:email, [:predicate, [:key?, predicate]]]]]
|
21
|
+
|
22
|
+
rules = compiler.(ast)
|
23
|
+
|
24
|
+
expect(rules).to eql([key_rule])
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'compiles conjunction rules' do
|
28
|
+
ast = [
|
29
|
+
[
|
30
|
+
:and, [
|
31
|
+
[:key, [:email, [:predicate, [:key?, predicate]]]],
|
32
|
+
[:val, [:email, [:predicate, [:filled?, predicate]]]]
|
33
|
+
]
|
34
|
+
]
|
35
|
+
]
|
36
|
+
|
37
|
+
rules = compiler.(ast)
|
38
|
+
|
39
|
+
expect(rules).to eql([and_rule])
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'compiles disjunction rules' do
|
43
|
+
ast = [
|
44
|
+
[
|
45
|
+
:or, [
|
46
|
+
[:key, [:email, [:predicate, [:key?, predicate]]]],
|
47
|
+
[:val, [:email, [:predicate, [:filled?, predicate]]]]
|
48
|
+
]
|
49
|
+
]
|
50
|
+
]
|
51
|
+
|
52
|
+
rules = compiler.(ast)
|
53
|
+
|
54
|
+
expect(rules).to eql([or_rule])
|
55
|
+
end
|
56
|
+
|
57
|
+
it 'compiles set rules' do
|
58
|
+
ast = [
|
59
|
+
[
|
60
|
+
:set, [
|
61
|
+
:email, [
|
62
|
+
[:val, [:email, [:predicate, [:filled?, predicate]]]]
|
63
|
+
]
|
64
|
+
]
|
65
|
+
]
|
66
|
+
]
|
67
|
+
|
68
|
+
rules = compiler.(ast)
|
69
|
+
|
70
|
+
expect(rules).to eql([set_rule])
|
71
|
+
end
|
72
|
+
|
73
|
+
it 'compiles each rules' do
|
74
|
+
ast = [
|
75
|
+
[
|
76
|
+
:each, [
|
77
|
+
:email, [:val, [:email, [:predicate, [:filled?, predicate]]]]
|
78
|
+
]
|
79
|
+
]
|
80
|
+
]
|
81
|
+
|
82
|
+
rules = compiler.(ast)
|
83
|
+
|
84
|
+
expect(rules).to eql([each_rule])
|
85
|
+
end
|
86
|
+
end
|
metadata
ADDED
@@ -0,0 +1,230 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dry-validation
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Andy Holland
|
8
|
+
- Piotr Solnica
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2015-11-25 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: dry-configurable
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '0.1'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0.1'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: dry-container
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0.2'
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 0.2.6
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - "~>"
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0.2'
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.2.6
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: dry-equalizer
|
50
|
+
requirement: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.2'
|
55
|
+
type: :runtime
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.2'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: bundler
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
type: :development
|
70
|
+
prerelease: false
|
71
|
+
version_requirements: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
- !ruby/object:Gem::Dependency
|
77
|
+
name: rake
|
78
|
+
requirement: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
type: :development
|
84
|
+
prerelease: false
|
85
|
+
version_requirements: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
- !ruby/object:Gem::Dependency
|
91
|
+
name: rspec
|
92
|
+
requirement: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
type: :development
|
98
|
+
prerelease: false
|
99
|
+
version_requirements: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
description:
|
105
|
+
email:
|
106
|
+
- andyholland1991@aol.com
|
107
|
+
- piotr.solnica@gmail.com
|
108
|
+
executables: []
|
109
|
+
extensions: []
|
110
|
+
extra_rdoc_files: []
|
111
|
+
files:
|
112
|
+
- ".gitignore"
|
113
|
+
- ".rspec"
|
114
|
+
- ".rubocop.yml"
|
115
|
+
- ".rubocop_todo.yml"
|
116
|
+
- ".travis.yml"
|
117
|
+
- CHANGELOG.md
|
118
|
+
- Gemfile
|
119
|
+
- LICENSE
|
120
|
+
- README.md
|
121
|
+
- Rakefile
|
122
|
+
- config/errors.yml
|
123
|
+
- dry-validation.gemspec
|
124
|
+
- examples/basic.rb
|
125
|
+
- examples/nested.rb
|
126
|
+
- examples/rule_ast.rb
|
127
|
+
- lib/dry-validation.rb
|
128
|
+
- lib/dry/validation.rb
|
129
|
+
- lib/dry/validation/error.rb
|
130
|
+
- lib/dry/validation/error_compiler.rb
|
131
|
+
- lib/dry/validation/messages.rb
|
132
|
+
- lib/dry/validation/predicate.rb
|
133
|
+
- lib/dry/validation/predicate_set.rb
|
134
|
+
- lib/dry/validation/predicates.rb
|
135
|
+
- lib/dry/validation/result.rb
|
136
|
+
- lib/dry/validation/rule.rb
|
137
|
+
- lib/dry/validation/rule_compiler.rb
|
138
|
+
- lib/dry/validation/schema.rb
|
139
|
+
- lib/dry/validation/schema/definition.rb
|
140
|
+
- lib/dry/validation/schema/key.rb
|
141
|
+
- lib/dry/validation/schema/rule.rb
|
142
|
+
- lib/dry/validation/schema/value.rb
|
143
|
+
- lib/dry/validation/version.rb
|
144
|
+
- rakelib/rubocop.rake
|
145
|
+
- spec/fixtures/errors.yml
|
146
|
+
- spec/integration/custom_error_messages_spec.rb
|
147
|
+
- spec/integration/custom_predicates_spec.rb
|
148
|
+
- spec/integration/validation_spec.rb
|
149
|
+
- spec/shared/predicates.rb
|
150
|
+
- spec/spec_helper.rb
|
151
|
+
- spec/unit/error_compiler_spec.rb
|
152
|
+
- spec/unit/predicate_spec.rb
|
153
|
+
- spec/unit/predicates/empty_spec.rb
|
154
|
+
- spec/unit/predicates/eql_spec.rb
|
155
|
+
- spec/unit/predicates/exclusion_spec.rb
|
156
|
+
- spec/unit/predicates/filled_spec.rb
|
157
|
+
- spec/unit/predicates/format_spec.rb
|
158
|
+
- spec/unit/predicates/gt_spec.rb
|
159
|
+
- spec/unit/predicates/gteq_spec.rb
|
160
|
+
- spec/unit/predicates/inclusion_spec.rb
|
161
|
+
- spec/unit/predicates/int_spec.rb
|
162
|
+
- spec/unit/predicates/key_spec.rb
|
163
|
+
- spec/unit/predicates/lt_spec.rb
|
164
|
+
- spec/unit/predicates/lteq_spec.rb
|
165
|
+
- spec/unit/predicates/max_size_spec.rb
|
166
|
+
- spec/unit/predicates/min_size_spec.rb
|
167
|
+
- spec/unit/predicates/nil_spec.rb
|
168
|
+
- spec/unit/predicates/size_spec.rb
|
169
|
+
- spec/unit/predicates/str_spec.rb
|
170
|
+
- spec/unit/rule/each_spec.rb
|
171
|
+
- spec/unit/rule/key_spec.rb
|
172
|
+
- spec/unit/rule/set_spec.rb
|
173
|
+
- spec/unit/rule/value_spec.rb
|
174
|
+
- spec/unit/rule_compiler_spec.rb
|
175
|
+
homepage: https://github.com/dryrb/dry-validation
|
176
|
+
licenses:
|
177
|
+
- MIT
|
178
|
+
metadata: {}
|
179
|
+
post_install_message:
|
180
|
+
rdoc_options: []
|
181
|
+
require_paths:
|
182
|
+
- lib
|
183
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
189
|
+
requirements:
|
190
|
+
- - ">="
|
191
|
+
- !ruby/object:Gem::Version
|
192
|
+
version: '0'
|
193
|
+
requirements: []
|
194
|
+
rubyforge_project:
|
195
|
+
rubygems_version: 2.4.5
|
196
|
+
signing_key:
|
197
|
+
specification_version: 4
|
198
|
+
summary: A simple validation library
|
199
|
+
test_files:
|
200
|
+
- spec/fixtures/errors.yml
|
201
|
+
- spec/integration/custom_error_messages_spec.rb
|
202
|
+
- spec/integration/custom_predicates_spec.rb
|
203
|
+
- spec/integration/validation_spec.rb
|
204
|
+
- spec/shared/predicates.rb
|
205
|
+
- spec/spec_helper.rb
|
206
|
+
- spec/unit/error_compiler_spec.rb
|
207
|
+
- spec/unit/predicate_spec.rb
|
208
|
+
- spec/unit/predicates/empty_spec.rb
|
209
|
+
- spec/unit/predicates/eql_spec.rb
|
210
|
+
- spec/unit/predicates/exclusion_spec.rb
|
211
|
+
- spec/unit/predicates/filled_spec.rb
|
212
|
+
- spec/unit/predicates/format_spec.rb
|
213
|
+
- spec/unit/predicates/gt_spec.rb
|
214
|
+
- spec/unit/predicates/gteq_spec.rb
|
215
|
+
- spec/unit/predicates/inclusion_spec.rb
|
216
|
+
- spec/unit/predicates/int_spec.rb
|
217
|
+
- spec/unit/predicates/key_spec.rb
|
218
|
+
- spec/unit/predicates/lt_spec.rb
|
219
|
+
- spec/unit/predicates/lteq_spec.rb
|
220
|
+
- spec/unit/predicates/max_size_spec.rb
|
221
|
+
- spec/unit/predicates/min_size_spec.rb
|
222
|
+
- spec/unit/predicates/nil_spec.rb
|
223
|
+
- spec/unit/predicates/size_spec.rb
|
224
|
+
- spec/unit/predicates/str_spec.rb
|
225
|
+
- spec/unit/rule/each_spec.rb
|
226
|
+
- spec/unit/rule/key_spec.rb
|
227
|
+
- spec/unit/rule/set_spec.rb
|
228
|
+
- spec/unit/rule/value_spec.rb
|
229
|
+
- spec/unit/rule_compiler_spec.rb
|
230
|
+
has_rdoc:
|