json_schema_spec 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -3
- data/README.md +2 -0
- data/json_schema_spec.gemspec +1 -1
- data/lib/json_schema_spec.rb +2 -2
- 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: c8fdc6d05168b5673a8df3323e5ec20013706055
|
4
|
+
data.tar.gz: a209d077423e0994ede08e330a51e12b446e9caf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f309a56c8f687ad0daf4d233336a06ab723d509d193e82b61ad9f71c556171a25683e5c12d14ff23a980f741fc6988264fa70cda5f330eac2b6662360959b2b7
|
7
|
+
data.tar.gz: 760a7d2ae493dfa427e7ff86a4a3d85dd9826f21345016da97bc042933008dc5d5622dc47d65336a070e93845ae48c7e39694bae95994967a5243f2da6c6e4ef
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
data/json_schema_spec.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "json_schema_spec"
|
7
|
-
spec.version = "0.0.
|
7
|
+
spec.version = "0.0.8"
|
8
8
|
spec.authors = ["Winton Welsh"]
|
9
9
|
spec.email = ["mail@wintoni.us"]
|
10
10
|
spec.description = %q{Generate fixtures from JSON schemas.}
|
data/lib/json_schema_spec.rb
CHANGED
@@ -52,14 +52,14 @@ module JsonSchemaSpec
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def json_schema_value(key, value, prefix)
|
55
|
-
if !value.is_a?(Hash) || value[:optional]
|
55
|
+
if !value.is_a?(Hash) || value[:optional] || value[:type] == 'null'
|
56
56
|
nil
|
57
57
|
elsif value[:type] == 'array'
|
58
58
|
[ json_schema_value(key, value[:items], prefix) ]
|
59
59
|
elsif value[:type] == 'boolean'
|
60
60
|
rand(2) == 1
|
61
61
|
elsif value[:type] == 'integer'
|
62
|
-
|
62
|
+
rand(1_000_000)
|
63
63
|
elsif value[:type] == 'object'
|
64
64
|
json_schema_to_params(value[:properties], prefix << key)
|
65
65
|
elsif value[:type] == 'string'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_schema_spec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Winton Welsh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|