hash_validator 0.7.0 → 0.7.1

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: 6d59a9fcf0e3e3d923d612488af9ff65634ec245
4
- data.tar.gz: 5930e9f250b9782b934bb96911af050fcf298caf
3
+ metadata.gz: 2e9643ea0272321ae3212a9c811044f18fcbf3a2
4
+ data.tar.gz: eedaa6b41b8e3c812fa9cc49c9282d7ac59cac07
5
5
  SHA512:
6
- metadata.gz: d027e7bb81c1cd5c5da47d8d50a3c5f5e7fc6d580f28e6e4726d8c6f83d179330a5b7a2826c1d99e383b61d33d1de4a88322de13e124b32cc9a59da2d672e59b
7
- data.tar.gz: 8f282ee2705a7fd84f63675c1ce186984325a52a5552b4cc449ff04a5fd32514d9a8941452358845570496742d9f8b6fd33308b188d4816a49522b2531b4517b
6
+ metadata.gz: 603d75b24833ba30bc6b9a8a6b730fd90b88ca00515c1cdaa157290b42424c801c7fc4fd84ea8ce8f992fb44ddbcdf4d8004399c5c193c48b899b89fbb55acbb
7
+ data.tar.gz: 52e365ac0b3e587c38519634db61e84737bf75526836f56aadbf7a9a2b7430adda18851de718a00bc4c31509ab3ae63c8cb803cef0674ff0c77f41dddb20d554
data/.travis.yml CHANGED
@@ -4,3 +4,4 @@ rvm:
4
4
  - 2.1.0
5
5
  - 2.2.0
6
6
  - 2.3.0
7
+ - 2.4.0
data/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # Hash Validator
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/hash_validator.svg)](http://badge.fury.io/rb/hash_validator)
4
- [![Build Status](https://travis-ci.org/jamesbrooks/hash_validator.svg)](https://travis-ci.org/jamesbrooks/hash_validator)
5
- [![Coverage Status](https://coveralls.io/repos/jamesbrooks/hash_validator/badge.svg?branch=master)](https://coveralls.io/r/jamesbrooks/hash_validator)
6
- [![Code Climate](https://codeclimate.com/github/JamesBrooks/hash_validator.svg)](https://codeclimate.com/github/JamesBrooks/hash_validator)
7
- [![Dependency Status](https://gemnasium.com/badges/github.com/JamesBrooks/hash_validator.svg)](https://gemnasium.com/github.com/JamesBrooks/hash_validator)
3
+ [![Gem](https://img.shields.io/gem/v/hash_validator.svg)]()
4
+ [![Travis](https://travis-ci.org/jamesbrooks/hash_validator.svg)](https://travis-ci.org/jamesbrooks/hash_validator)
5
+ [![Coveralls](https://img.shields.io/coveralls/jamesbrooks/hash_validator.svg)](https://coveralls.io/r/jamesbrooks/hash_validator)
6
+ [![Code Climate](https://img.shields.io/codeclimate/github/JamesBrooks/hash_validator.svg)](https://codeclimate.com/github/JamesBrooks/hash_validator)
7
+ [![Gemnasium](https://img.shields.io/gemnasium/jamesbrooks/hash_validator.svg)](https://gemnasium.com/github.com/JamesBrooks/hash_validator)
8
8
 
9
9
  Ruby library to validate hashes (Hash) against user-defined requirements
10
10
 
@@ -84,6 +84,7 @@ Additional validations exist to validate beyond simple typing, such as:
84
84
 
85
85
  * An Enumerable instance: validates that the value is contained within the supplied enumerable.
86
86
  * A lambda/Proc instance: validates that the lambda/proc returns true when the value is supplied (lambdas must accept only one argument).
87
+ * A regexp instance: validates that the regex returns a match when the value is supplied (Regexp#match(value) is not nil).
87
88
  * `email`: email address validation (string + email address).
88
89
 
89
90
  Example use-cases include Ruby APIs (I'm currently using it in a Rails API that I'm building for better error responses to developers).
@@ -20,6 +20,6 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_development_dependency 'bundler', '~> 1.3'
22
22
  spec.add_development_dependency 'rake'
23
- spec.add_development_dependency 'rspec', '~> 2.13.0'
23
+ spec.add_development_dependency 'rspec', '~> 3.5.0'
24
24
  spec.add_development_dependency 'coveralls'
25
25
  end
@@ -10,7 +10,7 @@ module HashValidator
10
10
  end
11
11
 
12
12
  def validate(key, value, validations, errors)
13
- if value
13
+ unless value.nil?
14
14
  ::HashValidator.validator_for(validations.validation).validate(key, value, validations.validation, errors)
15
15
  errors.delete(key) if errors[key].respond_to?(:empty?) && errors[key].empty?
16
16
  end
@@ -1,3 +1,3 @@
1
1
  module HashValidator
2
- VERSION = '0.7.0'
2
+ VERSION = '0.7.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hash_validator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Brooks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-25 00:00:00.000000000 Z
11
+ date: 2017-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 2.13.0
47
+ version: 3.5.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: 2.13.0
54
+ version: 3.5.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: coveralls
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  version: '0'
136
136
  requirements: []
137
137
  rubyforge_project:
138
- rubygems_version: 2.5.1
138
+ rubygems_version: 2.5.2
139
139
  signing_key:
140
140
  specification_version: 4
141
141
  summary: Ruby library to validate hashes (Hash) against user-defined requirements