typelizer 0.1.3 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -1
- data/README.md +2 -2
- data/lib/typelizer/config.rb +1 -1
- data/lib/typelizer/interface.rb +1 -1
- data/lib/typelizer/model_plugins/auto.rb +19 -0
- data/lib/typelizer/model_plugins/poro.rb +13 -0
- data/lib/typelizer/version.rb +1 -1
- data/lib/typelizer.rb +2 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52c5a98a49d5f7a6f040da23ce1ff5c7b8453a758c0daae251788189be0fc874
|
4
|
+
data.tar.gz: f0b023ec773a121a30d5ee587118dad4c30b36f33309e34e4d07fb77b32a93fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c4b5d39763829b212109356ac5f81967cbcd2340562bddf6bb116cd98d18e209e42f0d694d7fdb62241c661849591e75728250eb856929b68cdbdb4d54fd03a
|
7
|
+
data.tar.gz: 66635cbafdbc3babb70f92dd2a73b924954f7e7b3f22623397ef53c99d62f8c62c3daea754634833dd3909cdaaa4e03f6aa114c1d7156202aa8274ee2a77cc2e
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning].
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## [0.1.5] - 2024-10-07
|
11
|
+
|
12
|
+
## Fixed
|
13
|
+
|
14
|
+
- Fix the duplicated import with multiple same association ([@okuramasafumi])
|
15
|
+
|
16
|
+
## [0.1.4] - 2024-10-04
|
17
|
+
|
18
|
+
## Added
|
19
|
+
|
20
|
+
- PORO model plugin ([@okuramasafumi])
|
21
|
+
- Auto model plugin ([@skryukov])
|
22
|
+
|
10
23
|
## [0.1.3] - 2024-09-27
|
11
24
|
|
12
25
|
## Added
|
@@ -48,7 +61,9 @@ and this project adheres to [Semantic Versioning].
|
|
48
61
|
[@okuramasafumi]: https://github.com/@okuramasafumi
|
49
62
|
[@skryukov]: https://github.com/skryukov
|
50
63
|
|
51
|
-
[Unreleased]: https://github.com/skryukov/typelizer/compare/v0.1.
|
64
|
+
[Unreleased]: https://github.com/skryukov/typelizer/compare/v0.1.5...HEAD
|
65
|
+
[0.1.5]: https://github.com/skryukov/typelizer/compare/v0.1.4...v0.1.5
|
66
|
+
[0.1.4]: https://github.com/skryukov/typelizer/compare/v0.1.3...v0.1.4
|
52
67
|
[0.1.3]: https://github.com/skryukov/typelizer/compare/v0.1.2...v0.1.3
|
53
68
|
[0.1.2]: https://github.com/skryukov/typelizer/compare/v0.1.1...v0.1.2
|
54
69
|
[0.1.1]: https://github.com/skryukov/typelizer/compare/v0.1.0...v0.1.1
|
data/README.md
CHANGED
@@ -202,8 +202,8 @@ Typelizer.configure do |config|
|
|
202
202
|
# Custom transformation for generated properties
|
203
203
|
config.properties_transformer = ->(properties) { ... }
|
204
204
|
|
205
|
-
# Plugin for model type inference (default: ModelPlugins::
|
206
|
-
config.model_plugin = Typelizer::ModelPlugins::
|
205
|
+
# Plugin for model type inference (default: ModelPlugins::Auto)
|
206
|
+
config.model_plugin = Typelizer::ModelPlugins::Auto
|
207
207
|
|
208
208
|
# Plugin for serializer parsing (default: SerializerPlugins::Auto)
|
209
209
|
config.serializer_plugin = Typelizer::SerializerPlugins::Auto
|
data/lib/typelizer/config.rb
CHANGED
data/lib/typelizer/interface.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
module Typelizer
|
2
|
+
module ModelPlugins
|
3
|
+
module Auto
|
4
|
+
class << self
|
5
|
+
def new(model_class:, config:)
|
6
|
+
plugin(model_class).new(model_class: model_class, config: config)
|
7
|
+
end
|
8
|
+
|
9
|
+
def plugin(model_class)
|
10
|
+
if model_class && model_class < ::ActiveRecord::Base
|
11
|
+
ActiveRecord
|
12
|
+
else
|
13
|
+
Poro
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/typelizer/version.rb
CHANGED
data/lib/typelizer.rb
CHANGED
@@ -16,6 +16,8 @@ require_relative "typelizer/serializer_plugins/alba"
|
|
16
16
|
require_relative "typelizer/serializer_plugins/ams"
|
17
17
|
|
18
18
|
require_relative "typelizer/model_plugins/active_record"
|
19
|
+
require_relative "typelizer/model_plugins/poro"
|
20
|
+
require_relative "typelizer/model_plugins/auto"
|
19
21
|
|
20
22
|
require_relative "typelizer/railtie" if defined?(Rails)
|
21
23
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: typelizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Svyatoslav Kryukov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -41,6 +41,8 @@ files:
|
|
41
41
|
- lib/typelizer/interface.rb
|
42
42
|
- lib/typelizer/listen.rb
|
43
43
|
- lib/typelizer/model_plugins/active_record.rb
|
44
|
+
- lib/typelizer/model_plugins/auto.rb
|
45
|
+
- lib/typelizer/model_plugins/poro.rb
|
44
46
|
- lib/typelizer/property.rb
|
45
47
|
- lib/typelizer/railtie.rb
|
46
48
|
- lib/typelizer/renderer.rb
|