Sorbet install: Difference between revisions
From wikinotes
(→Shims) |
|||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
= Gemfile = | = Initial Setup = | ||
<blockquote> | |||
== Gemfile == | |||
<blockquote> | <blockquote> | ||
<syntaxhighlight lang="ruby"> | <syntaxhighlight lang="ruby"> | ||
Line 11: | Line 13: | ||
</blockquote><!-- Gemfile --> | </blockquote><!-- Gemfile --> | ||
= Init = | == Init == | ||
<blockquote> | <blockquote> | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
Line 18: | Line 20: | ||
</blockquote><!-- Init --> | </blockquote><!-- Init --> | ||
= Dependencies = | == Dependencies == | ||
<blockquote> | <blockquote> | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
Line 25: | Line 27: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</blockquote><!-- Dependencies --> | </blockquote><!-- Dependencies --> | ||
</blockquote><!-- Initial Setup --> | |||
= Shims = | = Shim Generation / Ignores = | ||
<blockquote> | |||
== Ignore Directories == | |||
<blockquote> | |||
<syntaxhighlight lang="ruby"> | |||
# ${PROJECT}/sorbet/config | |||
--enable-experimental-requires-ancestor | |||
--dir | |||
. | |||
--ignore=/tmp/ | |||
--ignore=/vendor/bundle | |||
--ignore=/sorbet/rbi | |||
</syntaxhighlight> | |||
</blockquote><!-- Ignore Directories --> | |||
== Shims == | |||
<blockquote> | <blockquote> | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
Line 33: | Line 51: | ||
</blockquote><!-- Shims --> | </blockquote><!-- Shims --> | ||
= Tapioca Requires = | == Tapioca Requires == | ||
<blockquote> | <blockquote> | ||
You can require gems during the <code> | You can require gems during the <code>srb gems</code> execution which executes shims to help with dynamic code | ||
<syntaxhighlight lang=""> | <syntaxhighlight lang="ruby"> | ||
# sorbet/tapioca/require.rb | # sorbet/tapioca/require.rb | ||
require "thor" | require "spoom" | ||
require "thor/runner" | |||
require "yard-sorbet" | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</blockquote><!-- Tapioca Requires --> | </blockquote><!-- Tapioca Requires --> | ||
</blockquote><!-- Shim Generation / Ignores --> |
Latest revision as of 20:40, 4 November 2023
Initial Setup
Gemfile
source "https://rubygems.org" gem "sorbet" gem "sorbet-runtime" gem "sorbet-static" gem "tapioca"Init
bundle exec srb initDependencies
aur sync watchman-bin pacman -S watchman-bin
Shim Generation / Ignores
Ignore Directories
# ${PROJECT}/sorbet/config --enable-experimental-requires-ancestor --dir . --ignore=/tmp/ --ignore=/vendor/bundle --ignore=/sorbet/rbiShims
bundle exec srb gems # generate shims for gemsTapioca Requires
You can require gems during the
srb gems
execution which executes shims to help with dynamic code# sorbet/tapioca/require.rb require "spoom" require "thor/runner" require "yard-sorbet"