avro_turf 1.4.0 → 1.4.1
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 +4 -0
- data/lib/avro_turf/schema_store.rb +2 -2
- data/lib/avro_turf/version.rb +1 -1
- data/spec/avro_turf_spec.rb +21 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d201b8d402f0d88f3ce125040de4e056d0125607b6988236ff076b3fd042569
|
4
|
+
data.tar.gz: 0c1cbad2263b35f56dc04ca2def7a9ec520a3c95952acbc27f544a1c96337de8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3af9af40e690c6033afb5183d9438ff0785e09a8ac2288873df20f7f50cfd4c439d05dd227d5655e91e490630f4cb677b9ef167be66af072816a07bd2ef1d7a6
|
7
|
+
data.tar.gz: 0d440453c9c8ac12aa3cfc07b9348de674e29fbed65809cbf47956468d2c28b62223f213ffa1f1db2726a96cc0707be98e4cb3cc4bfbb0b4229a7982d529a235
|
data/CHANGELOG.md
CHANGED
@@ -83,10 +83,10 @@ class AvroTurf::SchemaStore
|
|
83
83
|
# has been resolved and use the now-updated local_schemas_cache to
|
84
84
|
# pick up where we left off.
|
85
85
|
local_schemas_cache.delete(fullname)
|
86
|
-
# Ensure
|
86
|
+
# Ensure all sub-schemas are cleaned up to avoid conflicts when re-parsing
|
87
87
|
# schema.
|
88
88
|
local_schemas_cache.each do |schema_name, schema|
|
89
|
-
local_schemas_cache.delete(schema_name)
|
89
|
+
local_schemas_cache.delete(schema_name) unless File.exist?(build_schema_path(schema_name))
|
90
90
|
end
|
91
91
|
load_schema!(fullname, local_schemas_cache)
|
92
92
|
else
|
data/lib/avro_turf/version.rb
CHANGED
data/spec/avro_turf_spec.rb
CHANGED
@@ -68,11 +68,23 @@ describe AvroTurf do
|
|
68
68
|
"type": "array",
|
69
69
|
"items": "message"
|
70
70
|
}
|
71
|
+
},
|
72
|
+
{
|
73
|
+
"name": "status",
|
74
|
+
"type": "publishing_status"
|
71
75
|
}
|
72
76
|
]
|
73
77
|
}
|
74
78
|
AVSC
|
75
79
|
|
80
|
+
define_schema "publishing_status.avsc", <<-AVSC
|
81
|
+
{
|
82
|
+
"name": "publishing_status",
|
83
|
+
"type": "enum",
|
84
|
+
"symbols": ["draft", "published", "archived"]
|
85
|
+
}
|
86
|
+
AVSC
|
87
|
+
|
76
88
|
define_schema "message.avsc", <<-AVSC
|
77
89
|
{
|
78
90
|
"name": "message",
|
@@ -89,6 +101,10 @@ describe AvroTurf do
|
|
89
101
|
"name": "label",
|
90
102
|
"symbols": ["foo", "bar"]
|
91
103
|
}
|
104
|
+
},
|
105
|
+
{
|
106
|
+
"name": "status",
|
107
|
+
"type": "publishing_status"
|
92
108
|
}
|
93
109
|
]
|
94
110
|
}
|
@@ -101,9 +117,11 @@ describe AvroTurf do
|
|
101
117
|
"messages" => [
|
102
118
|
{
|
103
119
|
"content" => "hello",
|
104
|
-
"label" => "bar"
|
120
|
+
"label" => "bar",
|
121
|
+
"status" => "draft"
|
105
122
|
}
|
106
|
-
]
|
123
|
+
],
|
124
|
+
"status" => "published"
|
107
125
|
}
|
108
126
|
|
109
127
|
encoded_data = avro.encode(data, schema_name: "post")
|
@@ -177,7 +195,7 @@ describe AvroTurf do
|
|
177
195
|
context "validating" do
|
178
196
|
subject(:encode_to_stream) do
|
179
197
|
stream = StringIO.new
|
180
|
-
avro.encode_to_stream(message, stream: stream, schema_name: "message", validate: true)
|
198
|
+
avro.encode_to_stream(message, stream: stream, schema_name: "message", validate: true)
|
181
199
|
end
|
182
200
|
|
183
201
|
context "with a valid message" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avro_turf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Schierbeck
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: avro
|