avro-resolution_canonical_form 0.3.0 → 0.4.0

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: 92db806c8c64c020593f72c0915c506a6f644f732025e1b1188a6312999a1b7c
4
- data.tar.gz: 352466440aa35ee0743aca9880b974c2a60db65e9b0326e985c42cdda3c47a35
3
+ metadata.gz: 5bc3f7c52afdd1298ab687f9d68d77c0c9aacf080c5087ed0c89a7f9066e55a7
4
+ data.tar.gz: a76c46c1a5b50efc70b634063de67f84d6dee38a3b91934a8263365622c5fc58
5
5
  SHA512:
6
- metadata.gz: d33a9ce1bb91751e437c15c379afc95bd0d7249b32f3d88be6a2c24ed9e5bb64de38927a90cdaab06fca39391c608a07a066222bc41e9dd424ad6c84432d1af9
7
- data.tar.gz: 3597d4ebb038f45750aeb926b099bdb0f7cd07c6e7458f4f398507200090392f66cf026df28098c4daa914f7726a0066df4525b836c74cee369a803408f77c95
6
+ metadata.gz: 510197a7bf31b4841e18664d02aaf29b96a215a3d914ac1615f21e7680bfb4b9edeab7218983fc340efaae0649dbd01d7be83d7329557602b9ffccb11dc046fc
7
+ data.tar.gz: c910f5a1de6cfed67a46f52ce5a746fcf7403a458ae29aa41d13170592afd29f02a1be72deedd11833fb26adc07790c038040200b5c87e3bf3e885cead5c3b84
@@ -0,0 +1,71 @@
1
+ version: 2.1
2
+ jobs:
3
+ lint:
4
+ docker:
5
+ - image: salsify/ruby_ci:2.6.6
6
+ working_directory: ~/avro-resolution_canonical_form
7
+ steps:
8
+ - checkout
9
+ - restore_cache:
10
+ keys:
11
+ - v2-gems-ruby-2.6.6-{{ checksum "avro-resolution_canonical_form.gemspec" }}-{{ checksum "Gemfile" }}
12
+ - v2-gems-ruby-2.6.6-
13
+ - run:
14
+ name: Install Gems
15
+ command: |
16
+ if ! bundle check --path=vendor/bundle; then
17
+ bundle install --path=vendor/bundle --jobs=4 --retry=3
18
+ bundle clean
19
+ fi
20
+ - save_cache:
21
+ key: v2-gems-ruby-2.6.6-{{ checksum "avro-resolution_canonical_form.gemspec" }}-{{ checksum "Gemfile" }}
22
+ paths:
23
+ - "vendor/bundle"
24
+ - "gemfiles/vendor/bundle"
25
+ - run:
26
+ name: Run Rubocop
27
+ command: bundle exec rubocop
28
+ test:
29
+ parameters:
30
+ ruby-version:
31
+ type: string
32
+ docker:
33
+ - image: salsify/ruby_ci:<< parameters.ruby-version >>
34
+ environment:
35
+ CIRCLE_TEST_REPORTS: "test-results"
36
+ working_directory: ~/avro-resolution_canonical_form
37
+ steps:
38
+ - checkout
39
+ - restore_cache:
40
+ keys:
41
+ - v2-gems-ruby-<< parameters.ruby-version >>-{{ checksum "avro-resolution_canonical_form.gemspec" }}-{{ checksum "Gemfile" }}
42
+ - v2-gems-ruby-<< parameters.ruby-version >>-
43
+ - run:
44
+ name: Install Gems
45
+ command: |
46
+ if ! bundle check --path=vendor/bundle; then
47
+ bundle install --path=vendor/bundle --jobs=4 --retry=3
48
+ bundle clean
49
+ fi
50
+ - save_cache:
51
+ key: v2-gems-ruby-<< parameters.ruby-version >>-{{ checksum "avro-resolution_canonical_form.gemspec" }}-{{ checksum "Gemfile" }}
52
+ paths:
53
+ - "vendor/bundle"
54
+ - "gemfiles/vendor/bundle"
55
+ - run:
56
+ name: Run Tests
57
+ command: |
58
+ bundle exec rspec --format RspecJunitFormatter --out $CIRCLE_TEST_REPORTS/rspec/junit.xml --format progress spec
59
+ - store_test_results:
60
+ path: "test-results"
61
+ workflows:
62
+ build:
63
+ jobs:
64
+ - lint
65
+ - test:
66
+ matrix:
67
+ parameters:
68
+ ruby-version:
69
+ - "2.6.6"
70
+ - "2.7.2"
71
+ - "3.0.0"
data/.rubocop.yml CHANGED
@@ -1,10 +1,12 @@
1
1
  inherit_gem:
2
2
  salsify_rubocop: conf/rubocop.yml
3
3
 
4
- Style/FileName:
4
+ AllCops:
5
+ TargetRubyVersion: 2.6
6
+
7
+ Naming/FileName:
5
8
  Exclude:
6
9
  - 'lib/avro-resolution_canonical_form.rb'
7
10
 
8
11
  RSpec/FilePath:
9
12
  Enabled: false
10
-
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # avro-resolution_canonical_form
2
2
 
3
+ ## v0.4.0 (Unreleased)
4
+ - Drop dependency on `avro-patches`.
5
+ - Add support for Ruby 3.0.
6
+ - Drop support for Ruby < 2.6.
7
+ - Use frozen string literals.
8
+
3
9
  ## v0.3.0
4
10
  - Require Avro v1.10.
5
11
  - Include aliases, enum defaults, and decimal logical types in the resolution
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # override the :github shortcut to be secure by using HTTPS
data/README.md CHANGED
@@ -34,17 +34,6 @@ to include `default` and `aliases` attributes and logical type for decimals:
34
34
  named types and fields are converted to their fullname, using applicable
35
35
  namespace, and sorted.
36
36
 
37
- ## Ruby Support
38
-
39
- This currently gem requires the [avro-patches](https://github.com/salsify/avro-patches)
40
- gem.
41
-
42
- ### Aliases
43
-
44
- The Avro Ruby gem, including the avro-patches, does not yet include support
45
- for aliases. Aliases are included in the specification of the Resolution Canonical
46
- Form above, but not yet supported by this gem.
47
-
48
37
  ## Usage
49
38
 
50
39
  `Avro::ResolutionCanonicalForm` subclasses `Avro::SchemaNormalization`
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
 
3
5
  require 'rspec/core/rake_task'
@@ -1,6 +1,6 @@
1
- # coding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path('../lib', __FILE__)
3
+ lib = File.expand_path('lib', __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  require 'avro-resolution_canonical_form/version'
6
6
 
@@ -28,16 +28,17 @@ Gem::Specification.new do |spec|
28
28
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
29
29
  spec.require_paths = ['lib']
30
30
 
31
- spec.add_development_dependency 'appraisal'
31
+ spec.required_ruby_version = '>= 2.6'
32
+
32
33
  spec.add_development_dependency 'bundler', '~> 2.0'
33
- spec.add_development_dependency 'rake', '~> 10.0'
34
- spec.add_development_dependency 'rspec', '~> 3.4'
35
- spec.add_development_dependency 'salsify_rubocop', '~> 0.46.0'
36
34
  spec.add_development_dependency 'overcommit'
35
+ spec.add_development_dependency 'rake', '~> 13.0'
36
+ spec.add_development_dependency 'rspec', '~> 3.8'
37
+ spec.add_development_dependency 'rspec_junit_formatter'
38
+ spec.add_development_dependency 'salsify_rubocop', '~> 1.0.1'
37
39
  spec.add_development_dependency 'simplecov'
38
40
 
39
41
  spec.add_runtime_dependency 'avro', '~> 1.10.0'
40
- spec.add_runtime_dependency 'avro-patches', '< 2.0.0'
41
42
 
42
43
  spec.post_install_message = %(
43
44
  avro-resolution_canonical_form now requires Avro v1.10.
@@ -1,3 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avro'
1
4
  require 'avro-resolution_canonical_form/version'
2
5
  require 'avro/resolution_canonical_form'
3
6
  require 'avro/resolution_fingerprint'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module AvroResolutionCanonicalForm
2
- VERSION = '0.3.0'.freeze
4
+ VERSION = '0.4.0'
3
5
  end
@@ -1,8 +1,8 @@
1
- require 'avro-patches'
1
+ # frozen_string_literal: true
2
2
 
3
3
  module Avro
4
- class ResolutionCanonicalForm < SchemaNormalization
5
- DECIMAL_LOGICAL_TYPE = 'decimal'.freeze
4
+ class ResolutionCanonicalForm < Avro::SchemaNormalization
5
+ DECIMAL_LOGICAL_TYPE = 'decimal'
6
6
 
7
7
  def self.to_resolution_form(schema)
8
8
  new.to_resolution_form(schema)
@@ -25,9 +25,7 @@ module Avro
25
25
  def normalize_field(field)
26
26
  extensions = {}
27
27
  extensions[:default] = field.default if field.default?
28
- if field.aliases && !field.aliases.empty?
29
- extensions[:aliases] = field.aliases.sort
30
- end
28
+ extensions[:aliases] = field.aliases.sort if field.aliases && !field.aliases.empty?
31
29
 
32
30
  super.merge(extensions)
33
31
  end
@@ -45,9 +43,9 @@ module Avro
45
43
 
46
44
  def normalize_named_type(schema, attributes = {})
47
45
  extensions = {}
48
- if schema.respond_to?(:default)
46
+ if schema.respond_to?(:default) && !schema.default.nil?
49
47
  # For enum defaults
50
- extensions[:default] = schema.default unless schema.default.nil?
48
+ extensions[:default] = schema.default
51
49
  end
52
50
 
53
51
  aliases = schema.fullname_aliases
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Avro
2
4
  class Schema
3
5
  # Returns the SHA-256 fingerprint of the Resolution Canonical Form for the
metadata CHANGED
@@ -1,99 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avro-resolution_canonical_form
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Salsify, Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-20 00:00:00.000000000 Z
11
+ date: 2021-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: appraisal
14
+ name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '2.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: bundler
28
+ name: overcommit
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '2.0'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '2.0'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '10.0'
47
+ version: '13.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '10.0'
54
+ version: '13.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '3.4'
61
+ version: '3.8'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '3.4'
68
+ version: '3.8'
69
69
  - !ruby/object:Gem::Dependency
70
- name: salsify_rubocop
70
+ name: rspec_junit_formatter
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 0.46.0
75
+ version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 0.46.0
82
+ version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: overcommit
84
+ name: salsify_rubocop
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: 1.0.1
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: 1.0.1
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: simplecov
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -122,20 +122,6 @@ dependencies:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: 1.10.0
125
- - !ruby/object:Gem::Dependency
126
- name: avro-patches
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "<"
130
- - !ruby/object:Gem::Version
131
- version: 2.0.0
132
- type: :runtime
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - "<"
137
- - !ruby/object:Gem::Version
138
- version: 2.0.0
139
125
  description: Unique identification of Avro schemas for schema resolution
140
126
  email:
141
127
  - engineering@salsify.com
@@ -145,12 +131,11 @@ executables:
145
131
  extensions: []
146
132
  extra_rdoc_files: []
147
133
  files:
134
+ - ".circleci/config.yml"
148
135
  - ".gitignore"
149
136
  - ".overcommit.yml"
150
137
  - ".rspec"
151
138
  - ".rubocop.yml"
152
- - ".travis.yml"
153
- - Appraisals
154
139
  - CHANGELOG.md
155
140
  - Gemfile
156
141
  - LICENSE.txt
@@ -159,8 +144,6 @@ files:
159
144
  - avro-resolution_canonical_form.gemspec
160
145
  - bin/console
161
146
  - bin/setup
162
- - gemfiles/avro_patches_0.x.gemfile
163
- - gemfiles/avro_patches_1.x.gemfile
164
147
  - lib/avro-resolution_canonical_form.rb
165
148
  - lib/avro-resolution_canonical_form/version.rb
166
149
  - lib/avro/resolution_canonical_form.rb
@@ -189,15 +172,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
189
172
  requirements:
190
173
  - - ">="
191
174
  - !ruby/object:Gem::Version
192
- version: '0'
175
+ version: '2.6'
193
176
  required_rubygems_version: !ruby/object:Gem::Requirement
194
177
  requirements:
195
178
  - - ">="
196
179
  - !ruby/object:Gem::Version
197
180
  version: '0'
198
181
  requirements: []
199
- rubyforge_project:
200
- rubygems_version: 2.7.6.2
182
+ rubygems_version: 3.2.3
201
183
  signing_key:
202
184
  specification_version: 4
203
185
  summary: Unique identification of Avro schemas for schema resolution
data/.travis.yml DELETED
@@ -1,11 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.5.8
4
- - 2.6.6
5
- - 2.7.1
6
- before_install: gem install bundler -v 2.0.1 --no-document
7
- before_script:
8
- - bundle exec appraisal install --jobs=3
9
- script:
10
- - bundle exec rubocop
11
- - bundle exec appraisal rspec
data/Appraisals DELETED
@@ -1,3 +0,0 @@
1
- appraise 'avro-patches-1.x' do
2
- gem 'avro-patches', '>= 1.0.0'
3
- end
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "avro-patches", "< 1.0.0"
6
-
7
- gemspec path: "../"
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "avro-patches", ">= 1.0.0"
6
-
7
- gemspec path: "../"