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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ebbfdd602e4d6c23894efe960ef21e01bc6bbc770c6076105260fc36de3c8e1e
4
- data.tar.gz: 1113f99b28e58f641a13c9cec7b8b314bb113b34e07e3c27aab5559c524568b4
3
+ metadata.gz: 0d201b8d402f0d88f3ce125040de4e056d0125607b6988236ff076b3fd042569
4
+ data.tar.gz: 0c1cbad2263b35f56dc04ca2def7a9ec520a3c95952acbc27f544a1c96337de8
5
5
  SHA512:
6
- metadata.gz: 56c4235851a345cf81abfd7170961f973eed218437187a20ef1b717e600ad19f6cbea8df41a755af5d54f2c98adac0ea3d5c236b822d4fdda10e17c1f6987d5c
7
- data.tar.gz: 8caefcd9b974120c84f0a7910f26aff6106578eb80623119ac48c0c25c1775092c6e18b55a47cb97a2d000e7be7e110905cf0fb2d30a5f80e6bb0a800f98bc6c
6
+ metadata.gz: 3af9af40e690c6033afb5183d9438ff0785e09a8ac2288873df20f7f50cfd4c439d05dd227d5655e91e490630f4cb677b9ef167be66af072816a07bd2ef1d7a6
7
+ data.tar.gz: 0d440453c9c8ac12aa3cfc07b9348de674e29fbed65809cbf47956468d2c28b62223f213ffa1f1db2726a96cc0707be98e4cb3cc4bfbb0b4229a7982d529a235
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## v1.4.1
6
+
7
+ - Purge sub-schemas from cache before re-parsing schema (#151)
8
+
5
9
  ## v1.4.0
6
10
 
7
11
  - Add support for Ruby 3 (#146)
@@ -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 enum schemas are cleaned up to avoid conflicts when re-parsing
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) if schema.type_sym == :enum
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
@@ -1,3 +1,3 @@
1
1
  class AvroTurf
2
- VERSION = "1.4.0"
2
+ VERSION = "1.4.1"
3
3
  end
@@ -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.0
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-06-18 00:00:00.000000000 Z
11
+ date: 2021-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avro