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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca9c68a89b0e12cd2c9add27620a0e27a612bc98
4
- data.tar.gz: bd0f0df87c65b0a6d4d75e25bd73567c4adcf25a
3
+ metadata.gz: ed035b4c6b13f8c95e652da5d0a3a8cd0b2f2ea1
4
+ data.tar.gz: 56cfae8127b7a6dfaeb6f39ed178efbe8d95daf9
5
5
  SHA512:
6
- metadata.gz: 1f808e04df1769456412a40050173939a44bd2c7b2ec76cf6744811eea885b98f892dd408ef6a3aec7833f58f7067d4b5441c8a5f83f92958d2c1456f3dc461f
7
- data.tar.gz: c510fd256a59d6be0f120c7e740692a056336c2121d49ede8cdf498b45913e2dc9f39844d0c64dab89fa0e943f281a50d7ba8256a64f9e04dcc52ce7469e69cb
6
+ metadata.gz: 3f1f10ce70b6607759b82c98429f8ca157d28d137530cebe7b324a0faffd4ba34f9252709db0674516c368bfe4a02b203e3d74f5bce4b426e029344313c16fcf
7
+ data.tar.gz: fa9a0f383a929411577fba5e97fb7dbcb25a8872521d3f882de15224b599229761dfc1315569b8143a56c34bde93271c99dd41ab302a68ee56b245f7914667bf
@@ -1,3 +1,8 @@
1
+ ## 0.3.0
2
+
3
+ * ENHANCEMENT
4
+ * can add faker to format
5
+
1
6
  ## 0.2.0
2
7
 
3
8
  * ENHANCEMENT
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.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.2.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-06-21 00:00:00.000000000 Z
11
+ date: 2016-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json_schema