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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07d294fcea47d8694b1242dc9c1dc00a61590268
4
- data.tar.gz: 4a628d9c60ed7f21d14a0e33f47b0241501c449a
3
+ metadata.gz: 55f7d098c0e7f1b2293bb85b33102f7d4aadf132
4
+ data.tar.gz: 35449e6ecc446ebf5b6499b89e400bbc58eb580b
5
5
  SHA512:
6
- metadata.gz: 5a26671c40e6032c262610da5ffb237b326331d3197e88ee965947f00139ff5777160d3b56bc4f2de997bcd131bd97d0349ff0b875ee38f52f15b6f59701bf44
7
- data.tar.gz: 8833bc240213995861d89b43e532c0b86664a05dc1e205bc90aaab12d55778496c6042553c9bdf06479cf78a33dad3f7c38b9ee08da55a373f65287fc9c89aa6
6
+ metadata.gz: 85b2822d64941baeb0858c657c9c81b7aad4aed571f24832b90298e8ec5d6949ecca79eec9db26dd90a718723a2756eea8671a69c390c4d589b9d1bdcd6f641c
7
+ data.tar.gz: c1f2e509425b88609215c94dbcb022c6be47b77305bbdf8053a567913e4c5aab6eaf21f9cb1a50e9cadbe829aa548a0233771799d6e8da6ed54a531119340d9c
data/CHANGELOG.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Hanami::Validations
2
2
  Validations mixin for Ruby objects
3
3
 
4
+ ## v1.1.0.beta1 - 2017-08-11
5
+
4
6
  ## v1.0.0 - 2017-04-06
5
7
 
6
8
  ## v1.0.0.rc1 - 2017-03-31
@@ -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', '~> 1.0'
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', '~> 1.6'
27
- spec.add_development_dependency 'minitest', '~> 5'
28
- spec.add_development_dependency 'rake', '~> 10'
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
  #
@@ -52,7 +52,7 @@ module Hanami
52
52
  # @since 0.6.0
53
53
  # @api private
54
54
  def underscored_name
55
- Utils::String.new(name_without_suffix).underscore
55
+ Utils::String.underscore(name_without_suffix)
56
56
  end
57
57
 
58
58
  # @since 0.6.0
@@ -1,6 +1,6 @@
1
1
  module Hanami
2
2
  module Validations
3
3
  # @since 0.1.0
4
- VERSION = '1.0.0'.freeze
4
+ VERSION = '1.1.0.beta1'.freeze
5
5
  end
6
6
  end
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.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-04-06 00:00:00.000000000 Z
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: '1.0'
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: '1.0'
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: minitest
56
+ name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '5'
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: '5'
68
+ version: '10'
69
69
  - !ruby/object:Gem::Dependency
70
- name: rake
70
+ name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '10'
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: '10'
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: '0'
118
+ version: 1.3.1
119
119
  requirements: []
120
120
  rubyforge_project:
121
121
  rubygems_version: 2.6.11