-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add schema_namespace_map config option * implement schema_namespace_map for when generate_namespace_folders is enabled - Use entire namespace for both module definition and folder structure - (zeitwerk fix): use camelize instead of classiify to allow plural module names - (zeitwerk fix): don't use singularize to allow plural directory names - check schema_namespace_map for largest matching namespace reduction and apply it * regenerate test schema classes, add schema for testing * add spec, update snapshots * changelog * update docs * rubocop * use keys array for lookup * update docs to specify base module will be modified and that the keys are prefixes * update module_namespace assignment & tweak regex to match `.` character rather than any * update comment * improve directories assignment * rename generate_namespace_folders to use_full_namespace * fix spec
- Loading branch information
Showing
40 changed files
with
2,393 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
spec/schemas/com/my-namespace/my-suborg/MyLongNamespaceSchema.avsc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"namespace": "com.my-namespace.my-suborg", | ||
"name": "MyLongNamespaceSchema", | ||
"type": "record", | ||
"doc": "Test schema", | ||
"fields": [ | ||
{ | ||
"name": "test_id", | ||
"type": "string", | ||
"doc": "test string" | ||
}, | ||
{ | ||
"name": "some_int", | ||
"type": "int", | ||
"doc": "test int" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# frozen_string_literal: true | ||
|
||
# This file is autogenerated by Deimos, Do NOT modify | ||
module Schemas; module MyNamespace | ||
### Primary Schema Class ### | ||
# Autogenerated Schema for Record at com.my-namespace.my-suborg.MyLongNamespaceSchema | ||
class MyLongNamespaceSchema < Deimos::SchemaClass::Record | ||
|
||
### Attribute Accessors ### | ||
# @return [String] | ||
attr_accessor :test_id | ||
# @return [Integer] | ||
attr_accessor :some_int | ||
|
||
# @override | ||
def initialize(test_id: nil, | ||
some_int: nil) | ||
super | ||
self.test_id = test_id | ||
self.some_int = some_int | ||
end | ||
|
||
# @override | ||
def schema | ||
'MyLongNamespaceSchema' | ||
end | ||
|
||
# @override | ||
def namespace | ||
'com.my-namespace.my-suborg' | ||
end | ||
|
||
def self.tombstone(key) | ||
record = self.allocate | ||
record.tombstone_key = key | ||
record.test_id = key | ||
record | ||
end | ||
|
||
# @override | ||
def as_json(_opts={}) | ||
{ | ||
'test_id' => @test_id, | ||
'some_int' => @some_int | ||
} | ||
end | ||
end | ||
end; end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,7 +68,7 @@ def namespace | |
end | ||
|
||
def self.tombstone(key) | ||
record = self.new | ||
record = self.allocate | ||
record | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.