avromatic 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +5 -1
- data/lib/avromatic.rb +4 -5
- data/lib/avromatic/model/decoder.rb +1 -0
- data/lib/avromatic/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1da7b6df955352305598cea4f26f57f5caf2f18
|
4
|
+
data.tar.gz: 6644ededff6d0b7a74c76d88927235195d491049
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0c6b0617485d61017ba84dff71e711d987c1e3fffa6c8ae12334c0c4690149a2cb988f0503b9f8e2e84bedcb191574fd1bbbb00eac51cf2986210a97001c906
|
7
|
+
data.tar.gz: 0129ad7d75d3c2a6ef332a82f31d7794cde344954bf643e508729954add5bfa50a3274b73ed7998e0e54de6f47df25f2cfd37fbe49657b2b59b088cfcef618a0
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -29,8 +29,12 @@ Or install it yourself as:
|
|
29
29
|
|
30
30
|
`Avromatic` supports the following configuration:
|
31
31
|
|
32
|
+
* schema_registry: An `AvroTurf::SchemaRegistry` object used to store Avro schemas
|
33
|
+
so that they can be referenced by id. Either `schema_registry` or
|
34
|
+
`registry_url` must be configured.
|
32
35
|
* registry_url: URL for the schema registry. The schema registry is used to store
|
33
|
-
Avro schemas so that they can be referenced by id.
|
36
|
+
Avro schemas so that they can be referenced by id. Either `schema_registry` or
|
37
|
+
`registry_url` must be configured.
|
34
38
|
* schema_store: The schema store is used to load Avro schemas from the filesystem.
|
35
39
|
It should be an object that responds to `find(name, namespace = nil)` and
|
36
40
|
returns an `Avro::Schema` object.
|
data/lib/avromatic.rb
CHANGED
@@ -5,7 +5,7 @@ require 'avro_turf/messaging'
|
|
5
5
|
|
6
6
|
module Avromatic
|
7
7
|
class << self
|
8
|
-
attr_accessor :registry_url, :schema_store, :logger, :messaging
|
8
|
+
attr_accessor :schema_registry, :registry_url, :schema_store, :logger, :messaging
|
9
9
|
end
|
10
10
|
|
11
11
|
self.logger = Logger.new($stdout)
|
@@ -21,12 +21,11 @@ module Avromatic
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def self.build_messaging
|
24
|
-
raise 'Avromatic must be configured with a registry_url' unless registry_url
|
25
24
|
raise 'Avromatic must be configured with a schema_store' unless schema_store
|
26
25
|
AvroTurf::Messaging.new(
|
27
|
-
|
28
|
-
schema_store:
|
29
|
-
logger:
|
26
|
+
registry: schema_registry || build_schema_registry,
|
27
|
+
schema_store: schema_store,
|
28
|
+
logger: logger)
|
30
29
|
end
|
31
30
|
|
32
31
|
def self.build_messaging!
|
@@ -46,6 +46,7 @@ module Avromatic
|
|
46
46
|
@model_map = build_model_map(models)
|
47
47
|
@schema_names_by_id = {}
|
48
48
|
@schema_registry = schema_registry ||
|
49
|
+
Avromatic.schema_registry ||
|
49
50
|
(registry_url && AvroTurf::SchemaRegistry.new(registry_url, logger: Avromatic.logger)) ||
|
50
51
|
Avromatic.build_schema_registry
|
51
52
|
end
|
data/lib/avromatic/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avromatic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Salsify Engineering
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: avro
|
@@ -242,7 +242,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
242
242
|
version: '0'
|
243
243
|
requirements: []
|
244
244
|
rubyforge_project:
|
245
|
-
rubygems_version: 2.4.
|
245
|
+
rubygems_version: 2.4.7
|
246
246
|
signing_key:
|
247
247
|
specification_version: 4
|
248
248
|
summary: Generate Ruby models from Avro schemas
|