avromatic 3.0.1 → 3.0.2

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
  SHA256:
3
- metadata.gz: d4938e400e426cf06497e5819b1f92c9c3f12920ada5ed999a1a826bd19c7efb
4
- data.tar.gz: e37322f05ec5adaff55e28bc8e15a2e2164dc3d8575fb8ed0dad6e5b283fa440
3
+ metadata.gz: e809f79141573b5b305bd08859b5bc78554ce8044c7affb7f47d6ccf3ffabe9f
4
+ data.tar.gz: 537f11353220a3dbd723f6bc5f9939a1d72e2db570085276e4f990db96284b27
5
5
  SHA512:
6
- metadata.gz: 258766a91f94e209f18e0f2060bb2590d606bb973b93bd702a2acc45535d2591e7688b5d14695c004621a5eddf8d328528518447ccf26521c10d2fb3821dfdb6
7
- data.tar.gz: fd1aea43406300f106aba81a9be6212e50d4e6bab68b4a3a25bb5f7aafaa01400bb1712bfe7a9a4206a6dc8fa7bf31491988bd43a69755b2582f6c44d26603ba
6
+ metadata.gz: 623cfd23c9b9700be27022c8eb31f1815f0ff78c938e3dbfd08df485f942b79d3c925225406d33b5c5f7575b7247314a9781a5ab8705dc90929dcc9d26528350
7
+ data.tar.gz: 4835ad980bf412547204c70ae261014b966b71c24f56b30f595a9d0e1ecc41d85ad1e123861466ca5951db9d7e40032a386b2454eacf07bb23d02e3103f1b166
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # avromatic changelog
2
2
 
3
+ ## 3.0.2
4
+ - Reset the schema registry client between RSpec tests to ensure any cached values are
5
+ consistent with the fake schema registry.
6
+
3
7
  ## 3.0.1
4
8
  - Raise an error when registering a nested model that has already been auto-generated.
5
9
  This avoids hard to troubleshoot coercion errors when instantiating models and fixes
data/README.md CHANGED
@@ -72,7 +72,9 @@ and the [Messaging API](#messaging-api).
72
72
  so that they can be referenced by id. Either `schema_registry` or
73
73
  `registry_url` must be configured.
74
74
  * **registry_url**: URL for the schema registry. Either `schema_registry` or
75
- `registry_url` must be configured.
75
+ `registry_url` must be configured. The `build_schema_registry!` method may
76
+ be used to create a caching schema registry client instance based on other
77
+ configuration values.
76
78
  * **use_schema_fingerprint_lookup**: Avromatic supports a Schema Registry
77
79
  [extension](https://github.com/salsify/avro-schema-registry#extensions) that
78
80
  provides an endpoint to lookup existing schema ids by fingerprint.
@@ -91,6 +93,7 @@ Example using a schema registry:
91
93
  Avromatic.configure do |config|
92
94
  config.schema_store = AvroTurf::SchemaStore.new(path: 'avro/schemas')
93
95
  config.registry_url = Rails.configuration.x.avro_schema_registry_url
96
+ config.build_schema_registry!
94
97
  config.build_messaging!
95
98
  end
96
99
  ```
data/lib/avromatic.rb CHANGED
@@ -45,6 +45,10 @@ module Avromatic
45
45
  end
46
46
  end
47
47
 
48
+ def self.build_schema_registry!
49
+ self.schema_registry = build_schema_registry
50
+ end
51
+
48
52
  def self.build_messaging
49
53
  raise 'Avromatic must be configured with a schema_store' unless schema_store
50
54
  Avromatic::Messaging.new(
@@ -12,6 +12,7 @@ RSpec.configure do |config|
12
12
 
13
13
  WebMock.stub_request(:any, /^#{registry_uri}/).to_rack(AvroSchemaRegistry::FakeServer)
14
14
  AvroSchemaRegistry::FakeServer.clear
15
+ Avromatic.build_schema_registry!
15
16
  Avromatic.build_messaging!
16
17
  end
17
18
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Avromatic
4
- VERSION = '3.0.1'
4
+ VERSION = '3.0.2'
5
5
  end
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: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Salsify Engineering
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-10 00:00:00.000000000 Z
11
+ date: 2021-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel