The RBS repository contains the type definitions of Core API and Standard Libraries. There are some discussions whether if it is the best to have them in this repository, but we have them and continue updating the files meanwhile.
The target version of the bundled type definitions is the latest release of Ruby -- 4.0 as of 2026. Note, however, that the CI runs the tests on every non-EOL Ruby -- 3.3 and later as of 2026.
The core API type definitions are in core directory. You will find the familiar class names in the directory, like string.rbs or array.rbs.
The standard libraries type definitions are in stdlib directory. They have the third party repository structure. There is a set directory for the set library, and it contains 0 directory. Because RBS supports the latest release of Ruby, we have one set of RBS files which corresponds to the bundled versions of the libraries.
stdlib/foo/0 if you work for one of the standard libraries.You will typically follow the steps as follows:
rbs prototype runtime to generate list of methods.rbs annotate to import RDoc comments.rake generate:stdlib_test[CLASS,PATH,...] to generate a test case. Pass the paths to the standard library signatures and their dependencies when needed.See the next Useful Tools section and the guides above for writing and testing RBS files.
rbs prototype runtime --merge String--merge tells to use the method types in RBS if exists.rbs prototype runtime --merge --method-owner=Numeric Integerrbs annotate core/string.rbsbin/query-rdoc String#initializebin/sort core/string.rbsrbs -r LIB validate Validate the syntax and some of the semantics.rake generate:stdlib_test[String] Scaffold the stdlib test.rake test/stdlib/Array_test.rb Run specific stdlib test with the path.We define the standard members order so that ordering doesn't bother reading diffs or git-annotate outputs.
def self.new or def initializepublic & public instance methodsprivate & private instance methodsclass HelloWorld[X] def self.new: [A] () { (void) -> A } -> HelloWorld[A] # new or initialize comes first def initialize: () -> void include Enumerable[X, void] # Mixin comes next attr_reader language: (:ja | :en) # Attributes def self.all_languages: () -> Array[Symbol] # Singleton methods public # Public instance methods def each: () { (A) -> void } -> void # Members are sorted dictionary order def to_s: (?Locale) -> String private # Private instance methods alias validate validate_locale def validate_locale: () -> void end
You are correct. We want to move to their repos. We haven't started the migration yet.
We ignore the incompatibilities for now. We focus on the latest version of core APIs and standard libraries.