json-schema 0.9.11 → 0.9.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,7 +18,7 @@ From the git repo:
18
18
 
19
19
  <pre>
20
20
  $ gem build json-schema.gemspec
21
- $ gem install json-schema-0.9.11.gem
21
+ $ gem install json-schema-0.9.12.gem
22
22
  </pre>
23
23
 
24
24
 
@@ -348,6 +348,17 @@ module JSON
348
348
  @@fake_uri_generator = lambda{|s| JSON::Util::UUID.create_v5(s,JSON::Util::UUID::Nil).to_s }
349
349
  end
350
350
 
351
+ if @@json_backend == 'yajl'
352
+ @@serializer = lambda{|o| Yajl::Encoder.encode(o) }
353
+ else
354
+ @@serializer = lambda{|o| Marshal.dump(o) }
355
+ end
356
+
357
+ def serialize schema
358
+ @@serializer.call(schema)
359
+ end
360
+
361
+
351
362
  def fake_uri schema
352
363
  @@fake_uri_generator.call(schema)
353
364
  end
@@ -389,7 +400,7 @@ module JSON
389
400
  if @options[:list]
390
401
  schema = {"type" => "array", "items" => schema}
391
402
  end
392
- schema_uri = URI.parse(fake_uri(schema.inspect))
403
+ schema_uri = URI.parse(fake_uri(serialize(schema)))
393
404
  schema = JSON::Schema.new(schema,schema_uri,@options[:version])
394
405
  Validator.add_schema(schema)
395
406
  else
metadata CHANGED
@@ -1,32 +1,23 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: json-schema
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 9
8
- - 11
9
- version: 0.9.11
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.9.12
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Kenny Hoxworth
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2011-10-24 00:00:00 -04:00
18
- default_executable:
12
+ date: 2011-12-14 00:00:00.000000000Z
19
13
  dependencies: []
20
-
21
14
  description:
22
15
  email: hoxworth@gmail.com
23
16
  executables: []
24
-
25
17
  extensions: []
26
-
27
- extra_rdoc_files:
18
+ extra_rdoc_files:
28
19
  - README.textile
29
- files:
20
+ files:
30
21
  - lib/json-schema/attributes/additionalitems.rb
31
22
  - lib/json-schema/attributes/additionalproperties.rb
32
23
  - lib/json-schema/attributes/dependencies.rb
@@ -64,37 +55,41 @@ files:
64
55
  - resources/draft-02.json
65
56
  - resources/draft-03.json
66
57
  - README.textile
67
- has_rdoc: true
58
+ - test/test_extended_schema.rb
59
+ - test/test_files.rb
60
+ - test/test_jsonschema_draft1.rb
61
+ - test/test_jsonschema_draft2.rb
62
+ - test/test_jsonschema_draft3.rb
63
+ - test/test_schema_validation.rb
64
+ - test/data/bad_data_1.json
65
+ - test/data/good_data_1.json
66
+ - test/schemas/good_schema_1.json
67
+ - test/schemas/good_schema_2.json
68
68
  homepage: http://github.com/hoxworth/json-schema/tree/master
69
69
  licenses: []
70
-
71
70
  post_install_message:
72
71
  rdoc_options: []
73
-
74
- require_paths:
72
+ require_paths:
75
73
  - lib
76
- required_ruby_version: !ruby/object:Gem::Requirement
77
- requirements:
78
- - - ">="
79
- - !ruby/object:Gem::Version
80
- segments:
81
- - 0
82
- version: "0"
83
- required_rubygems_version: !ruby/object:Gem::Requirement
84
- requirements:
85
- - - ">="
86
- - !ruby/object:Gem::Version
87
- segments:
88
- - 0
89
- version: "0"
74
+ required_ruby_version: !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ! '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ required_rubygems_version: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
90
86
  requirements: []
91
-
92
87
  rubyforge_project:
93
- rubygems_version: 1.3.6
88
+ rubygems_version: 1.8.10
94
89
  signing_key:
95
90
  specification_version: 3
96
91
  summary: Ruby JSON Schema Validator
97
- test_files:
92
+ test_files:
98
93
  - test/test_extended_schema.rb
99
94
  - test/test_files.rb
100
95
  - test/test_jsonschema_draft1.rb