Sorbet install: Difference between revisions

From wikinotes
No edit summary
 
(5 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 -->
= 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 =
== Shims ==
<blockquote>
<blockquote>
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
Line 32: Line 50:
</syntaxhighlight>
</syntaxhighlight>
</blockquote><!-- Shims -->
</blockquote><!-- Shims -->
== Tapioca Requires ==
<blockquote>
You can require gems during the <code>srb gems</code> execution which executes shims to help with dynamic code
<syntaxhighlight lang="ruby">
# sorbet/tapioca/require.rb
require "spoom"
require "thor/runner"
require "yard-sorbet"
</syntaxhighlight>
</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 init

Dependencies

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/rbi

Shims

bundle exec srb gems  # generate shims for gems

Tapioca 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"