schema_registry 0.0.3 → 0.0.4

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: 58117d0b752d254049962f942bdc029e51d95119
4
- data.tar.gz: 7d101a19c3912c71484834b6ff1f02492349baa6
3
+ metadata.gz: a1d530b329c2ffc4f471bed84fc897843fdc932b
4
+ data.tar.gz: b770be7557c4c038494147e5aed96d1052d3f486
5
5
  SHA512:
6
- metadata.gz: 7e087a0cd8bb28d9f56c69c02975c5fc20bab199f118ad653c9475438cd4528d83725252d26829eb2f09b9ce6cf1489120a4a5d71d9234775b695f104faf1138
7
- data.tar.gz: b2c94029b386207e910fccb5d0759142dc6325be39b3e79ea551ddb7f016e5bd60fefb9aa252a80eeafe5513d5a86fa013223a2bf7299406413b024e7041b419
6
+ metadata.gz: 8c45a230a3a73add3ec82751dcdc275979d5cd27f38c769157c819864da2ad8beae1de676c0dd960d854487a1e50dddbb8d3e839ca950b743253e3644e045c77
7
+ data.tar.gz: 7bf8a528e69c471c4d25ae299fd00d0a0ca68c0dfa5d42a3fa7148cd950829a192cd22fce37a001517f549741c41e33fa1b315e78e30cd810c5c39d530889bab
@@ -85,7 +85,7 @@ module SchemaRegistry
85
85
  raise SchemaRegistry::UnauthorizedRequest.new(response.code.to_i, message)
86
86
 
87
87
  else
88
- response = begin
88
+ response_data = begin
89
89
  JSON.parse(response.body)
90
90
  rescue JSON::ParserError => e
91
91
  raise SchemaRegistry::InvalidResponse, "Invalid JSON in response: #{e.message}"
@@ -34,6 +34,13 @@ module SchemaRegistry
34
34
  SchemaRegistration.new(self, client.request(:post, "/subjects/#{name}", schema: schema_json))
35
35
  end
36
36
 
37
+ def schema_registered?(schema_json)
38
+ verify_schema(schema_json)
39
+ true
40
+ rescue SubjectNotFound, SchemaNotFound
41
+ false
42
+ end
43
+
37
44
  def register_schema(schema_json)
38
45
  client.request(:post, "/subjects/#{name}/versions", schema: schema_json)['id']
39
46
  end
@@ -1,3 +1,3 @@
1
1
  module SchemaRegistry
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schema_registry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Willem van Bergen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-17 00:00:00.000000000 Z
11
+ date: 2015-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler