jimmy 0.4 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jimmy/schema_types/string.rb +5 -1
- data/lib/jimmy/version.rb +1 -1
- 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: d9a33ee9ed0b7f72d8f48754308e5d9bd61f33a4
|
4
|
+
data.tar.gz: f3c83b5489a5b51131f416ded556ccf89c88cded
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3158fb0245caadaa29bc765927db8ee8f6c4a1bf4663637777657b099a3b924be08ea925c02cda4ecc8ee28ab9bd0771cecf6d68f3d6689741afba0a81450c8a
|
7
|
+
data.tar.gz: f5466c57c1e8482a4760931586b1ded7efc499ade5499b3ba0e9c5c73304cfdac45f875f13a34598c47d9e2abf4bbbc6e65b86a5594259f6a90b182a38e5f351
|
@@ -14,6 +14,10 @@ module Jimmy
|
|
14
14
|
ipv6
|
15
15
|
uri
|
16
16
|
].each { |k| trait(k) { format k } }
|
17
|
+
trait(:enum) do |*values|
|
18
|
+
attrs[:enum] ||= []
|
19
|
+
attrs[:enum] |= values.flatten.map(&:to_s)
|
20
|
+
end
|
17
21
|
trait(Regexp) { |regex| pattern regex }
|
18
22
|
trait Range do |value|
|
19
23
|
variation = value.exclude_end? ? 1 : 0
|
@@ -26,7 +30,7 @@ module Jimmy
|
|
26
30
|
end
|
27
31
|
end
|
28
32
|
trait(Fixnum) { |value| min_length value; max_length value }
|
29
|
-
trait(Array) { |value|
|
33
|
+
trait(Array) { |value| enum value }
|
30
34
|
|
31
35
|
compile do |hash|
|
32
36
|
hash.merge! camelize_attrs(%i[min_length max_length pattern enum format])
|
data/lib/jimmy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jimmy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Neil E. Pearson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json-schema
|