tapioca_dsl_compiler_store_model 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -13
- data/lib/tapioca/dsl/compilers/store_model.rb +0 -2
- data/lib/tapioca_dsl_compiler_store_model/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8695b3c4b636d2021926bf0c9c2e24214f187a51932082f2d707de39c77b7c1c
|
4
|
+
data.tar.gz: 88a4e945bfd61b5b18e4abec1a4fa985b3e8417b6f37d333d56ae7dd77323f22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 388d30a2d63a7300c8c10f6b3a8c1d84d8f32fdf699e937409e173f881fa06057f8be52904625c292f7081eb67d3ff7ed58d0eceff6708e3a8d7f7eb2ef70a1b
|
7
|
+
data.tar.gz: 8eeab3c0cc6465d334556892c77bd353cda98a032fa5e42650af3cb553ced879a4d62b1fc46b76f37bad29997b5abc872d900bfd746a1ff66006a26285429be8
|
data/README.md
CHANGED
@@ -2,15 +2,6 @@
|
|
2
2
|
|
3
3
|
A [Tapioca](https://github.com/Shopify/tapioca) DSL compiler that generates RBI files for [StoreModel](https://github.com/DmitryTsepelev/store_model) attributes in ActiveRecord models.
|
4
4
|
|
5
|
-
StoreModel adds JSON-backed attributes to ActiveRecord models, and this gem provides Sorbet type signatures for the methods that StoreModel dynamically generates.
|
6
|
-
|
7
|
-
## Features
|
8
|
-
|
9
|
-
- **Automatic RBI Generation**: Generates Sorbet RBI files for StoreModel attributes
|
10
|
-
- **Comprehensive Type Coverage**: Supports both single and array StoreModel types
|
11
|
-
- **Build Methods**: Generates signatures for `build_*` methods created by StoreModel
|
12
|
-
- **Tapioca Integration**: Follows Tapioca's standard compiler patterns and is automatically discovered
|
13
|
-
|
14
5
|
## Installation
|
15
6
|
|
16
7
|
Add this line to your application's Gemfile:
|
@@ -33,7 +24,7 @@ $ gem install tapioca_dsl_compiler_store_model
|
|
33
24
|
|
34
25
|
## Usage
|
35
26
|
|
36
|
-
Once installed, Tapioca will automatically discover and use
|
27
|
+
Once installed, Tapioca will automatically discover and use this compiler when generating RBI files with `bundle exec tapioca dsl`.
|
37
28
|
|
38
29
|
### Example
|
39
30
|
|
@@ -117,10 +108,9 @@ These features may be added in future versions.
|
|
117
108
|
|
118
109
|
## Requirements
|
119
110
|
|
120
|
-
- Ruby 2
|
121
|
-
- [Tapioca](https://github.com/Shopify/tapioca) 0.
|
111
|
+
- Ruby 3.2+
|
112
|
+
- [Tapioca](https://github.com/Shopify/tapioca) 0.11+
|
122
113
|
- [StoreModel](https://github.com/DmitryTsepelev/store_model) 1.0+
|
123
|
-
- ActiveRecord 6.0+
|
124
114
|
|
125
115
|
## Development
|
126
116
|
|
@@ -5,8 +5,6 @@ module Tapioca
|
|
5
5
|
module Dsl
|
6
6
|
module Compilers
|
7
7
|
class StoreModel < Tapioca::Dsl::Compiler
|
8
|
-
ConstantType = type_member { { fixed: T.class_of(ActiveRecord::Base) } }
|
9
|
-
|
10
8
|
sig { override.returns(T::Enumerable[Module]) }
|
11
9
|
def self.gather_constants
|
12
10
|
return [] unless defined?(::StoreModel)
|