typelizer 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -1
- data/README.md +2 -2
- data/lib/typelizer/config.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: 45bdcfd99663e0a61f6d70b5825f4ee29db4bc70927676c162fab5e8557675d6
|
4
|
+
data.tar.gz: ff3df8f4e1433bf7e8eb2f88318c117d58f86d14b974d6c1100fafe04988edc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed256b928dd5621f2a573c74997bcb2dd072af8ed02e79919e3f0506056bfd579405d234257136d87a3840393cc6fa625f2b50c1e9362eabcb5b7682e0d0eb00
|
7
|
+
data.tar.gz: ba1dab8fa94374dc25b02ac67b7e995f4a5d10c9492ceddf7bb866f22abaf609d148393af8a6c1eb899ccb553f0b2be542618811b58e1ae6b08f0d9d95d916ae
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning].
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## [0.1.4] - 2024-10-04
|
11
|
+
|
12
|
+
## Added
|
13
|
+
|
14
|
+
- PORO model plugin ([@okuramasafumi])
|
15
|
+
- Auto model plugin ([@skryukov])
|
16
|
+
|
10
17
|
## [0.1.3] - 2024-09-27
|
11
18
|
|
12
19
|
## Added
|
@@ -48,7 +55,8 @@ and this project adheres to [Semantic Versioning].
|
|
48
55
|
[@okuramasafumi]: https://github.com/@okuramasafumi
|
49
56
|
[@skryukov]: https://github.com/skryukov
|
50
57
|
|
51
|
-
[Unreleased]: https://github.com/skryukov/typelizer/compare/v0.1.
|
58
|
+
[Unreleased]: https://github.com/skryukov/typelizer/compare/v0.1.4...HEAD
|
59
|
+
[0.1.4]: https://github.com/skryukov/typelizer/compare/v0.1.3...v0.1.4
|
52
60
|
[0.1.3]: https://github.com/skryukov/typelizer/compare/v0.1.2...v0.1.3
|
53
61
|
[0.1.2]: https://github.com/skryukov/typelizer/compare/v0.1.1...v0.1.2
|
54
62
|
[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
@@ -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.4
|
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-04 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
|