classy_hash 0.1.3 → 0.1.4
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 +4 -4
- data/lib/classy_hash.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb81cef4f4d479a0268add5597b92dd9cc2c38ed
|
4
|
+
data.tar.gz: 476532b9fc8e6bb077d095e911cd529e9fdc9bc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d747ebfcf3c9a615b6dcf40959857f2fbbe56b55d6ae8902da98dda0cfd187d706a4fa7b6db4fe549dce8bfe3e84a18e6a99ff1940e48a35757b11a3e76c9cfa
|
7
|
+
data.tar.gz: a65a0978bc15a704acc880711163acf5b4132c094e5bd1e44b237278ab350f265efe3be529021de68f1c04a82c4a7fa2eb88d418fd97ed7f111691418327b415
|
data/lib/classy_hash.rb
CHANGED
@@ -121,6 +121,12 @@ module ClassyHash
|
|
121
121
|
self.check_multi(key, value, constraint, parent_path)
|
122
122
|
end
|
123
123
|
|
124
|
+
when Regexp
|
125
|
+
# Constrain value to be a String matching a Regexp
|
126
|
+
unless value.is_a?(String) && value =~ constraint
|
127
|
+
self.raise_error(parent_path, key, "a String matching #{constraint.inspect}")
|
128
|
+
end
|
129
|
+
|
124
130
|
when Proc
|
125
131
|
# User-specified validator
|
126
132
|
result = constraint.call(value)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: classy_hash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Deseret Book
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-05-26 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: |2
|
15
15
|
Classy Hash is a schema validator for Ruby Hashes. You provide a simple
|