json_schema-faker 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/VERSION +1 -1
- data/lib/json_schema/faker/strategy/simple.rb +7 -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: ed035b4c6b13f8c95e652da5d0a3a8cd0b2f2ea1
|
4
|
+
data.tar.gz: 56cfae8127b7a6dfaeb6f39ed178efbe8d95daf9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f1f10ce70b6607759b82c98429f8ca157d28d137530cebe7b324a0faffd4ba34f9252709db0674516c368bfe4a02b203e3d74f5bce4b426e029344313c16fcf
|
7
|
+
data.tar.gz: fa9a0f383a929411577fba5e97fb7dbcb25a8872521d3f882de15224b599229761dfc1315569b8143a56c34bde93271c99dd41ab302a68ee56b245f7914667bf
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
@@ -1,5 +1,11 @@
|
|
1
1
|
module JsonSchema::Faker::Strategy
|
2
2
|
class Simple
|
3
|
+
class << self
|
4
|
+
def formats
|
5
|
+
@formats ||= {}
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
3
9
|
def call(schema, hint: nil, position:)
|
4
10
|
if ::JsonSchema::Faker::Configuration.logger
|
5
11
|
::JsonSchema::Faker::Configuration.logger.debug "current position: #{position}"
|
@@ -13,6 +19,7 @@ module JsonSchema::Faker::Strategy
|
|
13
19
|
schema = compact_schema(schema, position: position)
|
14
20
|
|
15
21
|
return schema.default if schema.default
|
22
|
+
return self.class.formats[schema.format].call(schema, hint: hint, position: position) if self.class.formats.has_key?(schema.format)
|
16
23
|
|
17
24
|
if schema.not
|
18
25
|
hint ||= {}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_schema-faker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- okitan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json_schema
|