README.md in tapioca-0.4.0 vs README.md in tapioca-0.4.1
- old
+ new
@@ -29,10 +29,17 @@
In order to make sure that `tapioca` can reflect on that type, we need to add the line `require "better_html/parser"` to the `sorbet/tapioca/require.rb` file. This will make sure `BetterHtml::Parser` is loaded into memory and a type annotation is generated for it in the `better_html.rbi` file. If this extra `require` line is not added to `sorbet/tapioca/require.rb` file, then the definition for that type will be missing from the RBI file.
If you ever run into a case, where you add a gem or update the version of a gem and run `tapioca sync` but don't have some types you expect in the generated gem RBI files, you will need to make sure you have added the necessary requires to the `sorbet/tapioca/require.rb` file.
+You can use the command `tapioca require` to auto-populate the `sorbet/tapioca/require.rb` file with all the requires found
+in your application. Once the file generated, you should review it, remove all unnecessary requires and commit it.
+
+## How does tapioca compare to "srb rbi gems" ?
+
+[Please see the detailed answer on our wiki](https://github.com/Shopify/tapioca/wiki/How-does-tapioca-compare-to-%22srb-rbi-gems%22-%3F)
+
## Installation
Add this line to your application's `Gemfile`:
```ruby
@@ -47,10 +54,11 @@
$ bundle exec tapioca
Commands:
tapioca generate [gem...] # generate RBIs from gems
tapioca help [COMMAND] # Describe available commands or one specific command
tapioca init # initializes folder structure
+ tapioca require # generate the list of files to be required by tapioca
tapioca sync # sync RBIs to Gemfile
tapioca todo # generate the list of unresolved constants
Options:
--pre, -b, [--prerequire=file] # A file to be required before Bundler.require is called
@@ -92,9 +100,13 @@
- `--prerequire [file]`: A file to be required before `Bundler.require` is called.
- `--postrequire [file]`: A file to be required after `Bundler.require` is called.
- `--out [directory]`: The output directory for generated RBI files, default to `sorbet/rbi/gems`.
- `--generate-command [command]`: The command to run to regenerate RBI files (used in header comment of the RBI files), defaults to the current command.
- `--typed-overrides [gem:level]`: Overrides typed sigils for generated gem RBIs for gem `gem` to level `level` (`level` can be one of `ignore`, `false`, `true`, `strict`, or `strong`, see [the Sorbet docs](https://sorbet.org/docs/static#file-level-granularity-strictness-levels) for more details).
+
+### Strong typing option for ActiveRecord column methods
+
+`tapioca` gives you the option to generate stricter type signatures for your ActiveRecord column types. By default, methods generated for columns that are defined in the schema have signatures of T.untyped. However, if the object extends a module with name StrongTypeGeneration, tapioca will generate stricter signatures that follow closely with the types defined in the schema. Expectation is the StrongTypeGeneration module you define in your application won't allow objects to be initialized with "bad state". It will check all the attributes that are not nillable to ensure they are not nil.
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/Shopify/tapioca. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](https://github.com/Shopify/tapioca/blob/master/CODE_OF_CONDUCT.md) code of conduct.