json-schema-generator 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NjRkOWJiNTNmMDM2ZmM2YzE2YmJiZWE4ZmFkNzg5MzllMGQ5Y2IyOA==
5
- data.tar.gz: !binary |-
6
- NDM3NWE3NTc4OTIwN2ZjNTJlMjJiYTg5YWRiMTczYTJkN2ZiOTc5NA==
2
+ SHA1:
3
+ metadata.gz: 69ed2137db5f60e22f7c1ed761e655bdd21931fc
4
+ data.tar.gz: 1e649eac8fa0392b7a1dad5238c620c75b321b50
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- ZTE3YWI4MmQ0YjAxMTNhZGMxZGJkNzRlNWZiN2Q2ODViMWQ4YjM5MjcyMWZj
10
- YjE3ZmIxNjVmY2U2Yzc5MDM3M2VhMTQ4ZDlmMDYzM2NkOTUzMmQ0ZmY4YzIz
11
- N2QzODUzYzhjOTRkYzlkYjFkY2NjN2NjYjMyMWRhYjVkNzQwMDk=
12
- data.tar.gz: !binary |-
13
- MDNlMDU2M2E5YWQ0MzdhNTVhMDA2MjQ5NTczZDZlMjQ2NDMxYjZlN2Y5NTQ0
14
- MWFjY2MwZmRiOTY2NjVhMDEzNTEwN2YxMjA5YTVmN2YwZDNlMTViYTNkMGFk
15
- NzFmNzM2ZTg0MDE3YzE3YjgwMDg4N2ZkNGEzYmMyZGE2MDE5ZDc=
6
+ metadata.gz: 64f4382b5a8f089a8d8d58c1997bcb6d095b5600eec3bef93aec8b7af2b58d5d82b63c7dbd9459a6dd041c2b3e8b0c8d766a1ffcd0cf2afbd36a540835755a3b
7
+ data.tar.gz: 4f5bf1b70ebad07ea3be172e85a4108db9e4db27618d6cb3367c74c7e3eca7847dae5ba08dc03cd0364a0c92969cce419217d946648c22de4647dbde4bb78a06
@@ -3,6 +3,9 @@ rvm:
3
3
  - 2.0.0
4
4
  - 1.9.3
5
5
  - jruby-19mode
6
- - rbx-19mode
6
+ - rbx-2.2.1
7
+ matrix:
8
+ allow_failures:
9
+ - rvm: rbx-2.2.1
7
10
  before_install:
8
11
  - git submodule update --init --recursive
data/Gemfile CHANGED
@@ -2,3 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in json-schema-generator.gemspec
4
4
  gemspec
5
+
6
+ platforms :rbx do
7
+ gem 'rubysl'
8
+ end
@@ -39,7 +39,13 @@ module JSON
39
39
  statement_group = StatementGroup.new
40
40
  statement_group.add "\"$schema\": \"http://json-schema.org/#{@version}/schema#\""
41
41
  statement_group.add "\"description\": \"Generated from #{@name} with shasum #{Digest::SHA1.hexdigest raw_data}\""
42
- create_hash(statement_group, data, detect_required(data))
42
+ case data
43
+ when Array
44
+ $stop = true
45
+ create_array(statement_group, data, detect_required(data))
46
+ else
47
+ create_hash(statement_group, data, detect_required(data))
48
+ end
43
49
  @buffer.puts statement_group
44
50
  result
45
51
  end
@@ -5,7 +5,11 @@ module JSON
5
5
  class BruteForceRequiredSearch
6
6
  def initialize(data)
7
7
  @data = data.dup
8
- @json_path = ['$']
8
+ if data.is_a? Array
9
+ @json_path = ['$[*]']
10
+ else
11
+ @json_path = ['$']
12
+ end
9
13
  end
10
14
 
11
15
  def push(key, value)
@@ -1,5 +1,5 @@
1
1
  module JSON
2
2
  class SchemaGenerator
3
- VERSION = "0.0.6"
3
+ VERSION = "0.0.7"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json-schema-generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Lincoln
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-18 00:00:00.000000000 Z
11
+ date: 2013-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jsonpath
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
@@ -42,56 +42,56 @@ dependencies:
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ! '>='
59
+ - - '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ! '>='
66
+ - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: json-schema
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ! '>='
73
+ - - '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ! '>='
80
+ - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: travis
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ! '>='
87
+ - - '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ! '>='
94
+ - - '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  description: A very basic json-schema generator
@@ -130,12 +130,12 @@ require_paths:
130
130
  - lib
131
131
  required_ruby_version: !ruby/object:Gem::Requirement
132
132
  requirements:
133
- - - ! '>='
133
+ - - '>='
134
134
  - !ruby/object:Gem::Version
135
135
  version: '0'
136
136
  required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  requirements:
138
- - - ! '>='
138
+ - - '>='
139
139
  - !ruby/object:Gem::Version
140
140
  version: '0'
141
141
  requirements: []