README.md in tapioca-0.10.2 vs README.md in tapioca-0.10.3
- old
+ new
@@ -471,10 +471,12 @@
[--rbi-max-line-length=N] # Set the max line length of generated RBIs. Signatures longer than the max line length will be wrapped
# Default: 120
-e, [--environment=ENVIRONMENT] # The Rack/Rails environment to use when generating RBIs
# Default: development
-l, [--list-compilers], [--no-list-compilers] # List all loaded compilers
+ [--app-root=APP_ROOT] # The path to the Rails application
+ # Default: .
-c, [--config=<config file path>] # Path to the Tapioca configuration file
# Default: sorbet/tapioca/config.yml
-V, [--verbose], [--no-verbose] # Verbose output for debugging purposes
generate RBIs for dynamic methods
@@ -633,10 +635,12 @@
There are two main parts to the DSL compiler API: `gather_constants` and `decorate`:
* The `gather_constants` class method collects all classes (or modules) that should be processed by this specific DSL compiler.
* The `decorate` method defines how to generate the necessary RBI definitions for the gathered constants.
+Every compiler must declare the type member `ConstantType` in order for Sorbet to understand what the return type of the `constant` attribute reader is. It needs to be assigned the correct type variable matching the type of constants that `gather_constants` returns. This generic variable allows Sorbet to type-check method calls on the `constant` reader in your `decorate` method. See the Sorbet documentation on [generics](https://sorbet.org/docs/generics) for more information.
+
You can now run the new RBI compiler through the normal DSL generation process (your custom compiler will be loaded automatically by Tapioca):
```shell
$ bin/tapioca dsl
@@ -820,9 +824,10 @@
quiet: false
workers: 2
rbi_max_line_length: 120
environment: development
list_compilers: false
+ app_root: "."
gem:
outdir: sorbet/rbi/gems
file_header: true
all: false
prerequire: ''