Ruby 的静态类型检查器
通过 RubyGems 安装。 $ gem install steep
Steep 需要 Ruby 2.6 或更高版本。
Steep 不会从 Ruby 程序中推断类型,而是需要声明类型并写入注释。 您必须按照以下三个步骤进行。
steep init运行 steep init 以生成配置文件。
$ steep init # Generates Steepfile编辑 Steepfile:
target :app do
check "lib"
signature "sig"
endGemfile.lock 中的 RBS 通过 RBS 集合 加载,您可以使用 rbs collection init 和 rbs collection install 来设置该集合。仅对 rbs collection 不管理的 RBS 添加 library 调用。
在 sig 目录中的 .rbs 文件中声明类型。
$ rbs prototype rb lib/person.rb lib/email.rb暂无开放 Issues,或尚未同步最近议题。