typelizer 0.1.0 → 0.1.2

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: 2a3d9ee492a8abe52368f76b6312cb8dea42c1321d45f9555e69ad7165c660bf
4
- data.tar.gz: b3327bfeebc1bae33772bd3a4ddeec312583fbc9345da5e2ca16e992f845331b
3
+ metadata.gz: d728a2d15357f1cd3316c78dde5407a130c26e80cfc8e4e706cfa3836ef4d650
4
+ data.tar.gz: f3f4c3b3420da55c4c2a671a85b9a03d06cf02a09a1df63578c4df0f91a4ea75
5
5
  SHA512:
6
- metadata.gz: 43771cbcdbc2ae8952abe2af958b434a1e2cf8caaa639fab7ea477be64000e7b9c4e7d83fec13c94b3ab26ac65efbae4dfab47bd3e6976e345c0b2516e95bf40
7
- data.tar.gz: 0450a22f5189a079f7747f2c8c2d1b01445143d5a1cbdadf34d3be17ef7056b2f28ce27d880b3950d87d69e34a166481742a1d16a8fce5b9906c130b3c18f378
6
+ metadata.gz: e1adc62cf80343300db84b62a34e13fb0f6bf5b6749a3940f34c56463054b0f4b50727ce946fcecff3fd05584ba3d45c0cd94ac77b733a6cdb676381b7163716
7
+ data.tar.gz: a7e6101a95798e1a1f5522b096fec15e966cfd3f354004c32d83702ea7cea230b06185df2180226d5b93325de51414f03d59cb05caba880dd9cd72ad87473b9e
data/CHANGELOG.md CHANGED
@@ -7,13 +7,29 @@ and this project adheres to [Semantic Versioning].
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.1.2] - 2024-09-05
11
+
12
+ ### Fixed
13
+
14
+ - Prevent Alba's `meta nil` raising an error ([@okuramasafumi])
15
+
16
+ ## [0.1.1] - 2024-08-26
17
+
18
+ ### Fixed
19
+
20
+ - Failing method inspection ([@skryukov], [@davidrunger])
21
+
10
22
  ## [0.1.0] - 2024-08-02
11
23
 
12
24
  - Initial release ([@skryukov])
13
25
 
26
+ [@davidrunger]: https://github.com/davidrunger
27
+ [@okuramasafumi]: https://github.com/@okuramasafumi
14
28
  [@skryukov]: https://github.com/skryukov
15
29
 
16
- [Unreleased]: https://github.com/skryukov/typelizer/compare/v0.1.0...HEAD
30
+ [Unreleased]: https://github.com/skryukov/typelizer/compare/v0.1.2...HEAD
31
+ [0.1.2]: https://github.com/skryukov/typelizer/compare/v0.1.1...v0.1.2
32
+ [0.1.1]: https://github.com/skryukov/typelizer/compare/v0.1.0...v0.1.1
17
33
  [0.1.0]: https://github.com/skryukov/typelizer/commits/v0.1.0
18
34
 
19
35
  [Keep a Changelog]: https://keepachangelog.com/en/1.0.0/
data/README.md CHANGED
@@ -47,20 +47,20 @@ Include the Typelizer DSL in your serializers:
47
47
 
48
48
  ```ruby
49
49
  class ApplicationResource
50
- include Alba::Resource
50
+ include Alba::Resource
51
51
  include Typelizer::DSL
52
52
  end
53
53
 
54
54
  class PostResource < ApplicationResource
55
55
  attributes :id, :title, :body
56
-
56
+
57
57
  has_one :author, serializer: AuthorResource
58
58
  end
59
59
 
60
60
  class AuthorResource < ApplicationResource
61
61
  # specify the model to infer types from (optional)
62
62
  typelize_from User
63
-
63
+
64
64
  attributes :id, :name
65
65
  end
66
66
  ```
@@ -43,7 +43,7 @@ module Typelizer
43
43
  files.each do |file|
44
44
  trace = TracePoint.new(:call) do |tp|
45
45
  begin
46
- next unless tp.self.respond_to?(:typelizer_interface) && !tp.self.send(:respond_to_missing?, :typelizer_interface, false)
46
+ next unless tp.self.methods.include?(:typelizer_interface)
47
47
  rescue WeakRef::RefError
48
48
  next
49
49
  end
@@ -41,6 +41,8 @@ module Typelizer
41
41
  return nil unless serializer._meta
42
42
 
43
43
  name = serializer._meta.first
44
+ return nil unless name
45
+
44
46
  [
45
47
  build_property(name, name)
46
48
  ]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Typelizer
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
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.0
4
+ version: 0.1.2
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-08-02 00:00:00.000000000 Z
11
+ date: 2024-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
78
  - !ruby/object:Gem::Version
79
79
  version: '0'
80
80
  requirements: []
81
- rubygems_version: 3.5.7
81
+ rubygems_version: 3.5.17
82
82
  signing_key:
83
83
  specification_version: 4
84
84
  summary: A TypeScript type generator for Ruby serializers.