-
Notifications
You must be signed in to change notification settings - Fork 217
Release Note 2.7
RBS 2.7.0 is the latest version of RBS 2.7.
Some of the highlights in RBS 2.7 are:
You can install it with $ gem install rbs
or using bundler.
gem 'rbs', '~> 2.7.0'
See the CHANGELOG for the details.
You can upgrade RBS 2.6 in Ruby programs safely without any modification.
See #1077 for the detail.
Some Ruby methods like #instance_eval
evaluates the block with self
other than outside of the block.
123.instance_eval do
# self is `123`, not the toplevel object
end
The feature is frequently used in DSL definitions, or .scope
method in ActiveRecord::Base
is one of the most frequently seen examples of the feature.
RBS 2.7 introduces a new syntax to declare a block is evaluated under different self
:
class Foo
def foo: () { () [self: String] -> void } -> void
end
The [self: String]
is the self type binding of a block of method #foo
. The implementation would look like the following:
class Foo
# foo receives a block, and it evaluate with self that is a String
def foo(&block) = "hello".instance_eval(&block)
end
RBS 2.7 provides a RDoc plugin that reads RBS files and generates RDoc.
$ bundle exec rdoc sig
This is preliminary implementation of the RDoc support. It lacks many important features -- supporting generic classes, generating interface & type alias docs, ...
Acknowledgement: This is a work by a contributor supported by Google Summer of Code 2022.
- fiber (#1071)
- rubygems (#1107)
-
OptionParser
(#1114) -
Set
(#1110) -
RDoc::Markup
(#1109) -
BigDecimal
(#1053) -
ERB::Util
,ERB::DefMethod
(#1074) -
Float::Infinity
(#1095) -
Logger
(#1046) -
IO.pipe
,IO.foreach
(#1057) -
Module#refine
(#1064) -
Regexp.new
(#1059) -
StringIO#write
(#1065) -
Symbol#start_with?
(#1118) -
URL::*.build
(#1118) -
Warning.#warn
,Kernel.#warn
(#1056)