1. 首页
  2. 数据库
  3. 其它
  4. 陡峭:Ruby的静态类型检查器 源码

陡峭:Ruby的静态类型检查器 源码

上传者: 2021-03-19 11:53:41上传 ZIP文件 955.44KB 热度 29次
陡峭-Ruby的渐进式打字 安装 通过RubyGems安装。 $ gem install steep 要求 陡峭需要Ruby 2.6。 用法 Steep不会从Ruby程序中推断类型,但是需要声明类型并编写注释。 您必须执行以下三个步骤。 0. steep init 运行steep init以生成配置文件。 $ steep init # Generates Steepfile 编辑Steepfile : target :app do check "lib" signature "sig" library "set" , "pathname" end 1.声明类型 在sig目录中声明.rbs文件的类型。 class Person @name: String @contacts: Array[Email | Phone] def initialize: (name: String) -> untyped def name: -> String def contacts: -> Array[Email | Phone] def gues
下载地址
用户评论