hash_validator 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2e41604544ea1db1c1d88b8c49c59d7edcc96821
4
- data.tar.gz: 5b5f86c50484ffdf9784534ce3e33ccf150fb0bb
3
+ metadata.gz: 1a1492f217366ea561ca20646b123578e23a3d08
4
+ data.tar.gz: 9bfa7a9b44345a7bcca3837ee439b38db1f76bd7
5
5
  SHA512:
6
- metadata.gz: 11f7746ceca1018580e21d7f05a6ceae369339c94cd1f28ad40303e8f68534b5b9355293f96c483dd59ef9bbb2c09aa2a6c97cc764828d73e0ec7150293662ad
7
- data.tar.gz: 3d97b917af1eba349ca698cd823dd9e4c53bec687ea82c12315682d2d283ca10bdb53c2230915c645d552d95d65e3d7881ee74ea222b2bfa2392036073cd892c
6
+ metadata.gz: 5d4026acaac90a08173375923d6932b68d7151c2c1a6d3b7f5df82f2373111909d08b70f052a8bb4dd9010019480985ce90497296ef9630ada45b387f130bfe1
7
+ data.tar.gz: 3384677eaef109084a8d8089f21cb82c7a25d78ec5c4eb25554bcd26d8c451156328d64abcdfb5b330fad9849f4468632558fab69a2ab67b1a00a416d4d640cd
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # Hash Validator
2
2
 
3
3
  [![Build Status](https://travis-ci.org/JamesBrooks/hash_validator.png)](https://travis-ci.org/JamesBrooks/hash_validator)
4
- [![Code Climate](https://codeclimate.com/github/JamesBrooks/hash_validator.png)](https://codeclimate.com/github/JamesBrooks/git-runner)
5
- [![Gem Version](https://badge.fury.io/rb/hash_validator.png)](http://badge.fury.io/rb/git-runner)
6
- [![Dependency Status](https://gemnasium.com/JamesBrooks/hash_validator.png)](https://gemnasium.com/JamesBrooks/git-runner)
4
+ [![Code Climate](https://codeclimate.com/github/JamesBrooks/hash_validator.png)](https://codeclimate.com/github/JamesBrooks/hash_validator)
5
+ [![Gem Version](https://badge.fury.io/rb/hash_validator.png)](http://badge.fury.io/rb/hash_validator)
6
+ [![Dependency Status](https://gemnasium.com/JamesBrooks/hash_validator.png)](https://gemnasium.com/JamesBrooks/hash_validator)
7
7
 
8
8
  Ruby library to validate hashes (Hash) against user-defined requirements
9
9
 
@@ -22,7 +22,8 @@ Or install it yourself as:
22
22
  $ gem install hash_validator
23
23
 
24
24
  ## Example
25
- ````
25
+
26
+ ```ruby
26
27
  # Validations hash
27
28
  validations = {
28
29
  user: {
@@ -52,11 +53,11 @@ validator.errors
52
53
  # {
53
54
  :user => {
54
55
  :last_name => "should be string",
55
- :age => "numeric required",
56
+ :age => "numeric required",
56
57
  :likes => "array required"
57
58
  }
58
59
  }
59
- ````
60
+ ```
60
61
 
61
62
  ## Usage
62
63
 
@@ -68,6 +69,8 @@ Define a validation hash which will be used to validate. This has can be nested
68
69
  * `time`
69
70
  * hashes are validates by nesting validations, or if just the presence of a hash is required `{}` can be used.
70
71
 
72
+ 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).
73
+
71
74
  ## Contributing
72
75
 
73
76
  1. Fork it
@@ -1,9 +1,9 @@
1
- require 'hash_validator/base'
2
- require 'hash_validator/version'
3
- require 'hash_validator/validators'
4
-
5
1
  module HashValidator
6
2
  def self.validate(*args)
7
3
  Base.validate(*args)
8
4
  end
9
5
  end
6
+
7
+ require 'hash_validator/base'
8
+ require 'hash_validator/version'
9
+ require 'hash_validator/validators'
@@ -1,3 +1,3 @@
1
1
  module HashValidator
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
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.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Brooks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-12 00:00:00.000000000 Z
11
+ date: 2013-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler