hanami-validations 1.0.0 → 1.1.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/hanami-validations.gemspec +4 -4
- data/lib/hanami/validations/form.rb +21 -0
- data/lib/hanami/validations/namespace.rb +1 -1
- data/lib/hanami/validations/version.rb +1 -1
- metadata +14 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55f7d098c0e7f1b2293bb85b33102f7d4aadf132
|
4
|
+
data.tar.gz: 35449e6ecc446ebf5b6499b89e400bbc58eb580b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85b2822d64941baeb0858c657c9c81b7aad4aed571f24832b90298e8ec5d6949ecca79eec9db26dd90a718723a2756eea8671a69c390c4d589b9d1bdcd6f641c
|
7
|
+
data.tar.gz: c1f2e509425b88609215c94dbcb022c6be47b77305bbdf8053a567913e4c5aab6eaf21f9cb1a50e9cadbe829aa548a0233771799d6e8da6ed54a531119340d9c
|
data/CHANGELOG.md
CHANGED
data/hanami-validations.gemspec
CHANGED
@@ -20,10 +20,10 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.require_paths = ['lib']
|
21
21
|
spec.required_ruby_version = '>= 2.3.0'
|
22
22
|
|
23
|
-
spec.add_dependency 'hanami-utils', '
|
23
|
+
spec.add_dependency 'hanami-utils', '1.1.0.beta1'
|
24
24
|
spec.add_dependency 'dry-validation', '~> 0.10'
|
25
25
|
|
26
|
-
spec.add_development_dependency 'bundler',
|
27
|
-
spec.add_development_dependency '
|
28
|
-
spec.add_development_dependency '
|
26
|
+
spec.add_development_dependency 'bundler', '~> 1.6'
|
27
|
+
spec.add_development_dependency 'rake', '~> 10'
|
28
|
+
spec.add_development_dependency 'rspec', '~> 3.6'
|
29
29
|
end
|
@@ -14,7 +14,28 @@ module Hanami
|
|
14
14
|
#
|
15
15
|
# class Signup
|
16
16
|
# include Hanami::Validations::Form
|
17
|
+
#
|
18
|
+
# validations do
|
19
|
+
# required(:name).filled(:str?)
|
20
|
+
# optional(:location).filled(:str?)
|
21
|
+
# end
|
17
22
|
# end
|
23
|
+
#
|
24
|
+
# result = Signup.new('location' => 'Rome').validate
|
25
|
+
# result.success? # => false
|
26
|
+
#
|
27
|
+
# result = Signup.new('name' => 'Luca').validate
|
28
|
+
# result.success? # => true
|
29
|
+
#
|
30
|
+
# # it works with symbol keys too
|
31
|
+
# result = Signup.new(location: 'Rome').validate
|
32
|
+
# result.success? # => false
|
33
|
+
#
|
34
|
+
# result = Signup.new(name: 'Luca').validate
|
35
|
+
# result.success? # => true
|
36
|
+
#
|
37
|
+
# result = Signup.new(name: 'Luca', location: 'Rome').validate
|
38
|
+
# result.success? # => true
|
18
39
|
module Form
|
19
40
|
# Override Ruby's hook for modules.
|
20
41
|
#
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hanami-validations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.1.0.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luca Guidi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hanami-utils
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.1.0.beta1
|
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:
|
26
|
+
version: 1.1.0.beta1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: dry-validation
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,33 +53,33 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.6'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '10'
|
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: '
|
68
|
+
version: '10'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '3.6'
|
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: '
|
82
|
+
version: '3.6'
|
83
83
|
description: Validations mixin for Ruby objects and support for Hanami
|
84
84
|
email:
|
85
85
|
- me@lucaguidi.com
|
@@ -113,9 +113,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
113
113
|
version: 2.3.0
|
114
114
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
|
-
- - "
|
116
|
+
- - ">"
|
117
117
|
- !ruby/object:Gem::Version
|
118
|
-
version:
|
118
|
+
version: 1.3.1
|
119
119
|
requirements: []
|
120
120
|
rubyforge_project:
|
121
121
|
rubygems_version: 2.6.11
|