Skip to content

Release Note 2.8

Soutaro Matsumoto edited this page Nov 17, 2022 · 5 revisions

Status: Draft

RBS 2.8.0.pre.1 is the latest version of RBS 2.8.

Some of the highlights in RBS 2.8 are:

  • Support to call collection command in child dir (#1025, #1135)
  • Make type/method-type parser more flexible about input position (#1140)

You can install it with $ gem install rbs or using Bundler.

gem 'rbs', '~> 2.8.0.pre'

See the CHANGELOG for the details.

You can upgrade to RBS 2.8 from 2.7 safely.

Support to call collection command in child dir

rbs collection commands try to find rbs_collection.yaml and rbs_collection.lock.yaml in ancestor directories. The commands will use the inner-most rbs_collection.yaml, while Bundler users the top-most Gemfile from the ancestor directories.

The path to Gemfile.lock is also saved in the rbs_collection.lock.yaml to ensure the Bundler context is the same one as the one where lockfile is generated in.

Type/method-type parser can handle the middle of input

The RBS::Parser.parse_type and RBS::Parser.parse_method_type now accepts range: keyword, that specify where the parsing starts from and finishes at.

RBS::Parser.parse_type("() -> void () -> String", range: 6...10)   # Returns `void`
RBS::Parser.parse_type("() -> void () -> String", range: 6...)     # Returns `void` too

If range: is specified, the parser consumes one type/method-type and just returns, not raises an error even if the input has more tokens other than EOF.

You can use the new API to parse from the middle of the input and then continue processing the rest of the input.

Signature updates

New errors

  • RBS::InheritModuleError is added, which is raised if a class declaration inherits a module

Clone this wiki locally