Releases: ruby/rbs
Release list
4.1.0.pre.2
4.0.3
Miscellaneous
4.1.0.pre.1
4.0.2
3.10.4
4.0.0
RBS 4.0 ships with experimental RBS inline syntax support, allowing you to write type annotations directly in Ruby source files. See docs/inline.md for the syntax details.
class Calculator
# @rbs (Integer, Integer) -> Integer
def add(a, b) = a + b
endNote: RBS inline is still experimental and may change in future releases.
This release also introduces two language changes: type argument support for singleton types (singleton(T)[S]) mainly for Sorbet integration, and generic type parameter lower bounds (T < S).
Signature updates
Updated classes/modules/methods: Addrinfo, Array, BasicObject, BigDecimal, Binding, CGI, Comparable, Complex, Digest::SHA2, Encoding::Converter, Enumerable, Enumerator, Enumerator::ArithmeticSequence, Enumerator::Lazy, Fiber, File, FileUtils, Float, Hash, IO, IO::TimeoutError, Integer, JSON, Kernel, Kconv, Math, Method, Minitest, Module, Numeric, ObjectSpace, Open3, OpenURI, OptionParser, PStore, Pathname, Proc, Process::Status, Psych, Ractor, Random, Random::Formatter, Range, Rational, RBS::Unnamed::TopLevelSelfClass, Ripper::Lexer::Elem, Ruby, RubyVM, SecureRandom, Set, Socket, String, StringScanner, TCPSocket, Thread, URI, URI::Generic, Zlib::GzipReader, Zlib::GzipWriter
- Remove deprecated types (#2880)
- Add type
RBS::Unnamed::TopLevelSelfClassto core (#2362) - Graduate bundled gems from Ruby v4.0 (#2852)
- stdlib: Add missing Psych methods and exception classes (#2850)
- Add variants with positional argument to
Hash#transform_keys(#2848) - add extra kwarg options for File#initialize and derivatives (#2798)
- pstore: fixes types, treat it as a collection (#2806)
- Add signatures for
{Module,Proc}#ruby2_keywords(#2805) - Make Zlib::GzipWriter.new level and strategy parameters optional (#2810)
- URI.(s) does string coercion (#2825)
- Fix String#append_as_bytes to accept Integer (#2817)
- [Comparable] Add in Comparable::_CompareToZero (#2697)
- [Kernel] Add Kernel.trace_var and Kernel.untrace_var (#2682)
- Add signature for
Module#method_undefined(#2804) - Fix Zlib::GzipWriter signatures (#2803)
- GzipWriter#initialize only takes 1 required positional arg (#2799)
- Fix accessibility of method in Module (#2802)
- Graduate kconv (#2794)
- Fix test related to pathname (#2789)
- Split pathname to core and stdlib (#2777)
- [Kernel] Narrow
caller_locations(#2745) - Ruby 4.1 changed
source_locationtype (#2784) - Remove ObjectSpace.count_nodes (#2779)
- Support selector for
String#stripfamily. (#2775) - Add
Ruby,Array#find, andArray#rfind(#2767) - Update minitest (#2761)
- Support BigDecimal v4 (#2758)
- Update rdoc and comments (#2733)
- Update cgi and cgi/escape type definitions (#2728)
- Update RBS files for Ruby 4 (#2731)
- Update existing docs (#2724)
- Remove reference to
JSON.deep_const_get(#2701) - Remove deprecated methods in
JSON(#2366) - Update FileUtils to v1.8.0 (#2700)
- Avoid overloading where arguments are identical (#2559)
- Move Pathname to core from stdlib (#2705)
- Remove undocumented
#nonzero?(#2543) - Add signature for
OptionParser#raise_unknown(#2735) - Add signature for
Open3.popen2(#2734) - Add RFC2396_PARSER to URI module (#2727)
- Add signature for
Open3.capture3(#2714) - Remove sig for IO#{ready?,nread} (#2710)
- Accept
nilstate parameter into_jsontype signatures (#2691) - Add type of
Open3.popen3(#2699) unsetenv_othersandclose_othersonly allows bool. (#2698)- Add deprecated annotation to
attrwith bool args (#2693) - Update open3 (#2692)
- Add signature for
SecureRandom.bytes(#2690) - Set %a{deprecated} to deprecated core methods (#2664)
- Migrate usages of ::_ToPath to use ::path instead (#2677)
- Add missing signatures for
Random::Formatter(#2680) - Split
Random::Formatterto core and stdlib (#2661) - Skip test cases of developing methods for Pathname (#2648)
- Add signature
Random.seed(#2649) - Update
string.rbsto avoid deprecation warning in Steep (#2655) - Add sig
IO#preadandIO#pwrite(#2647) - Refine signature of
Numeric#stepand add type ofEnumerator::ArithmeticSequence(#2600) - Remove undocumented override methods (#2622)
- Add docs (#2625)
- Remove undocumented methods for
imaginary(#2620) - Update securerandom (#2619)
- Drop undocumented
#eql?(#2618) - Just use
Numeric#+@and return self (#2597) - Drop undocumented
#dup(#2598) - Add signature for
Digest::SHA2(#2573) - Add signatures for
OpenURI(#2574) - Add signature for
IO::TimeoutError(#2571) - Add signatures for
Set(#2570) - Add signature for
Enumerator#+(#2567) - Add signature for
Enumerator::Lazy#eager(#2568) - Add signature for
Fiber#blocking(#2566) - Support BasicObject to avoid NoMethodError for
RBS::Test::TypeCheck(#2565) - Add documentation for
Range#{minmax,count,to_a,entries}(#2562) - Delegate to
EnumerablefromRange#{min,max}(#2540) - Add URI::Generic#+ (#2535)
- Make IO.binread, IO.binwrite, IO.read and IO.write accept _ToPath (#2378)
- Support pattern argument for Enumerable#{all,any,none,one}? (#2368)
- fixing sig for addrinfo (#2464)
Language updates
- Add type arguments support to singleton types (#2502)
- Move the note about lower bound (#2517)
- Add support for lower bounds in type parameters (#2490)
Library changes
- Add
#type_fingerprintmethods (#2879) topfor membership predicates of collection types (#2878)- Add block parameter (
&block) type declaration (#2875) - Add splat (
*a) and double-splat (**a) parameter support (#2873) - Add parameter type inline annotation (#2443)
- Reduce compile warnings (#2871)
- Specify input range by byte offsets (#2863)
- add
extern "C"wrapping torbs.hwhen using C++ (#2855) - Automatically inherits super method type if unannotated (#2858)
- Add
...syntax to method type inline annotation syntax (#2856) - Fix for string reference corruption issue ([#2836](https://github....
3.10.3
4.0.0.dev.5
3.10.2
3.10.1
This is a follow-up release for Ruby 4.0.0 with documentation update based on Ruby 4.0.0, and bugfixes related to set/pathname library loading.