define_method method block self type (#2325)CGI.escape/unescape_uri_component (#2299)Enumerator::Chain (#2220)IO.read (#2216)IPAddr#netmask (#2311)Kernel#gets, Kernel#readline, Kernel#readlines (#2212)Net::HTTP.start (#2225)OpenSSL::BN (#2267)OpenSSL::PKey::{RSA,DSA,DH}#params (#2255)UNIXSocket#send_io, UNIXSocket#recv_io (#2264)URI.encode/decode_uri_component (#2299)resolve-type-names: false magic comment (#2234)attr_* methods from duplicate checks. (#2294)rubygems and set (#2279)TypeParam#unchecked! from C parser (#2256)Any#todo! from C parser (#2249)Dir.mktmpdir (#2158)File.join (#2158)IO#each_line (#2151)Kernel#readlines (#2151)Ractor.store_if_absent (#2198)RubyVM::AbstractSyntaxTree::Location (#2189)_JsonWrite#flush (#2134)Array#fetch_values (#2189)Array#to_csv (#2099)Exception#set_backtrace (#2189)Fiber#raise (#2189)GC.config (#2189)Hash.new (#2189)Kernel#raise (#2189)MatchData#bytebegin (#2189)MatchData#byteend (#2189)Pathname#mkpath (#2048)Pathname#rmtree (#2048)Ractor._require (#2189)Ractor.[] (#2189)Ractor.[]= (#2189)Ractor.main? (#2189)Range#step (#1958)RubyVM::AbstractSyntaxTree::Node#locations (#2189)String#append_as_bytes (#2189)String#parse_csv (#2099)String#scan (#2146)Tempfile.create (#2189)Thread#raise (#2189)Time#iso8601 (#2189)Time#xmlschema (#2189)Warning.categories (#2189)ZStream#finish (#2136)Kernel#Namespace (#2123)missing braces around initializer warning (#2180)instance usage example (#2139)parser_test code snippets properly (#2137)CGI.accept_charset (#2045)IO#readline, IO#readlines (#2059)Kernel#proc (#2036)Kernel#system (#2075)Object#to_yaml (#2107)OpenSSL::Digest (#2108)OpenSSL.base64digest (#2078)Process.detach (#2083)parse_ methods as static (#2103).c/.h files (#2098)rbs_unescape_string declaration (#2058)instance_eval/instance_exec detection (#2052)File.open with block (#2119)bundle exec on windows (#2101)rbs gem validation (#2084)inline is not at beginning of declaration for melt_array (#2050)mkpath test with 3.4 (#2053)Nothing changed since 3.6.0.pre.3.
JSON.load_file, .load_file! (#2031)Module#class_eval, Module#module_eval (#2029)Open3 (#2014)RubyVM::InstructionSequence (#2027)instance/class types in modules (#2020)self type as a generics default (#2022)self types in generics default type (#2021)TypeParamDefaultReferenceError#type_param (#2032)_Each (#2006)Array (#1921)Enumerable (#1921)Enumerator::_Each (#2006, #1915)Enumerator (#2004)Kernel (#1945)Method (#1939)Module (#1921)Net::HTTPHeader (#1932)Proc (#1937)Queue (#2004)Range (#1921)Refinement (#1931)Symbol (#1930)TracePoint (#1943)#rand (#2007)syntax.md (#1995)GC.auto_compact compatible (#1971)FileFinder faster by globbing all possible files (#1965)UntypedFunction (#1906)AbstractSyntaxTree test with ruby-3.4 (#2005)File.open instead of IO.sysopen (#1912)UntypedFunction (#1906, Backported in #1925)File.open instead of IO.sysopen (#1913)net-http headers (#1750)CSV.foreach (#1738)Enumerator#initialize (#1801)Float#divmod, Rational#divmod (#1868)GC (#1530)Integer#pow (#1706)Kernel.rand (#1783)Kernel#extend (#1769)Module#include, Module#prepend (#1769)Proc#parameters (#1819)Range#step (#1709)Regexp.union (#1809)RubyVM::YJIT.enable (#1812)RubyVM::YJIT, RubyVM::RJIT (#1746)String#bytesplice (#1793)String#gsub! (#1768)Symbol#=~ (#1704)Time#initialize (#1771)Time#zone (#1770)Timeout::ExitException (#1803)URI::MailTo (#1858)abbrev (#1866)prototype rb failure (#1713)Gemfile and Gemfile.lock (#1856)Gemfile.lock from the gem package (#1823)String.new not String#initialize. (#1789)--enable-frozen-string-literal (#1767)fd (#1752)MatchData (#1651)String (#1672, #1641)Struct (#1621)Warning categories (#1576)ConditionVariable#wait (#1670)Date.parse (#1653)IO#gets (#1620)Kernel.Pathname (#1681)Resolv::DNS::Resource::Generic.create (#1655)Thread#raise (#1668)UnresolvedOverloadingError (#1688)with_*** helpers (#1687)Delegator object (#1682)ParsingError instead of NoMethodError (#1675)RBS::UnitTest modules (#1660)ParsingError instead of ArgumentError (#1652)WithEnum#but and with_range (#1649).respond_to is no longer used in Rbs::Test::Errors#inspect_ (#1650)--detail option to rbs diff (#1623)_ as version from git source (#1657)bundler explicitly for ruby/ruby CI (#1629)bundle command (#1619)Module#constants has been redefined (#1591)BasicObject (#1506)ConditionVariable (#1468)Encoding (#1510)Exception (#1529)FalseClass (#1478, #1487)Fiber (#1463)FileTest (#1500)Kernel (#1567, #1518, #1504, #1487)Marshal (#1524)Math (#1533)Mutex (#1468)NilClass (#1478, #1487)Object (#1504)Queue (#1468)RbConfig (#1534)Signal (#1512)SizedQueue (#1468)ThreadGroup (#1509)TrueClass (#1478, #1487)Warning (#1477)Enumerator.produce (#1516)Module.define_method (#1557)URI.join (#1580)YAML.unsafe_load (#1528)builtin.rbs(#1455, #1469)constants.rbs (#1531)::interned (#1499, #1488)__todo__ type (#1520)Abbrev to runtime dependency (#1573)Struct or Data by prototype runtime (#1571)sources section from lockfile (#1544)assert_type assertion to confirm if the value has a type (#1532)#assert_const_type and guide to use type assertions (#1514)Fiber (Backport #1463)IO (#1399)::DATA (#1395)$DEBUG (#1427)ConditionVariable#wait (#1397)Kernel::exit! (#1396)Kernel#exec (#1368)Kernel#p, Kernel#pp (#1342)Logger.new (#1423)Module (#1321)Object#define_singleton_method (#1431)Object#enum_for (#1327)StringIO#truncate (#1425)Thread#raise (#1426)Time#round, Time#floor, Time#ceil (#1337)TRUE, FALSE, and NIL constants (#1432)| nil to ? in global_variables.rbs (#1430)--outline option to prototype runtime to skip generating method definition (#1404)rbs_collection.yaml declares dependency (#1378)rbs syntax to code snippets in Markdown files (#1366)⚠️ Note that this patch level release may report additional validation errors that is caused by fix of type name resolution (#1373).
TypeNameResolver more compatible with Ruby (Backport #1373)GC.verify_transient_heap_internal_consistency (Backport #1374)Module#attr_* methods (#1300)Object#define_singleton_method (#1299)String#scan (#1297)Gem.datadir (#1273):type_name location (#1307)InvalidOverloadMethodError on overloading extended method (#1294)NoTypeFoundError from BaseError to DefinitionError (#1290)#detailed_message for NonregularTypeAliasError, CyclicTypeParameterBound, InconsistentClassModuleAliasError and CyclicClassAliasDefinitionError (#1289)rbs subtract command (#1287)#detailed_message for InvalidVarianceAnnotationError, RecursiveAliasDefinitionError, MixinClassError and RecursiveTypeAliasError (#1285)#detailed_message for NoTypeError, InheritModuleError, NoSelfTypeFoundError and NoMixinFoundError (#1280)-e, --type, and --method-type options to rbs parse (#1252)include in class << self to extend by prototype rb (#1255)#gemspec gems via RBS collection (#1319)DefinitionBuilder (#1268)Gemfile.lock (#1266)RubyVM::AbstractSyntaxTree stub type definition (#1259)set library on loading (#1251)Read the release note for the overview of the changes.
RubyVM::AbstractSyntaxTree (#1189)Array#zip (#1232)Enumerable#zip (#1232)Module#attr_* (#1218, #1229)Regexp.new (#1237)Regexp#=~ (#1195)Socket.new (#1185)Object::name (#1204)_ToProc#to_proc (#1223)implicitly-returns-nil annotations (#1226)use directivesEnvironment cleanup (#1209, #1236, #1247)rbs ancestors command (#1245)#detailed_message for ParsingError (#1166)Sorter (#1191)-std=gnu99 instead of -std=c99 (#973)rbs_ prefix to skip function (#1186)#resolved_revision return the last fetched commit (#1215)syntax.md (#1243)RBS by Example to README.md #1225rake stdlib_test run with single process (#1207, #1211, #1231)steep/* files from .gem (#1214, #1216)rake stdlib_test run with single process (Backport #1207, #1211)steep/* files from .gem (Backport #1214, #1216)YAML.load (#1170)prepended module itself (#1182)TestSkip module to skip tests that fails in ruby CI (#1167)Gemfile for unbundled environments (#1161)variables: (#1153)rubygems from rbs’s manifest (#1150)untyped instead of any in syntax.md (#1147)syntax.md (#1127)syntax.md (#1123)... in syntax.md (#1120)append_cflags for other than GCC (#1106)See Release Note 2.7 for the highlights of this release.
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)Warning.#warn, Kernel.#warn (#1056)frozen_string_literal: true (#1100)-r option also (#1013).new methods correct type (#1097)nil versions are discouraged and will be deprecated in Rubygems 4 (#1091)add for Repository.default (#1062)bin/sort implementation to under lib/ (#1051)RBS 2.6 ships with rbs prototype commands improvements and signature updates. New minitest RBS definitions will help you to type check your tests.
ENV. ARGF, Random::Base (#1041)Hash#dig (#1011)Hash#reject (#1016)Kernel?.fail (#1026, #1028)Rational#* (#1012)Regexp.new (#1040)visibility columns in {AttrReader,AttrAccessor,AttrWriter}#to_json (#1014)self (#1003)Prototype::Runtime (#1030)Prototype::RBI (#1018)CONTRIBUTING.md (#1004)Prototype::RB (#1019)This is a maintenance release mainly to fix errors detected in CI of ruby/ruby. Nothing changed related to the users of RBS gem.
test/tools/sort_test.rb that is not included in this release)Regexp.new argument (#1034)OpenSSL::PKey::PKeyError: EVP_PKEY_keygen: bad ffc parameters with OpenSSL 3 (#1005)This is a minor release with tuple type/record type syntax updates and rbs prototype improvements.
[], instead of [ ]{}prototype-rb command with --out-dir option generates multiple RBS files in the directoryTime (#994)name attribute in MethodDefinition#to_json (#997)ArgumentError) invalid byte sequence in UTF-8 (#995)decls from RBS::Prototype::RB (#998)rbs prototype (#1000)This is a minor release with some signature updates, prototype rb improvement, and test fixes.
prototype rb (#974)IO::Buffer.new for mutable buffer tests (#989)::Object (#972)append_cflags, add Windows ‘compile only’ CI (#964)RBS::SyntaxError from parse_record_attributes (#966)literal_to_type (#962)Enumerator (#931)FalseClass (#931)Integer (#914)Module (#931)NilClass (#931)Object (#931)Prime (#934)TracePoint (#941)TrueClass (#931)#to_d (#936)IO#wait_writable (#943)Resolver::ConstantResolver and Resolver::TypeNameResolver (#938)bin/sort for constants (#919)validate_type_alias run without an error on unknown type (#912)RBS 2.2 ships with a new syntax to specify the visibility of a method per definition bases.
class Foo private def hello: () -> void private attr_accessor world: String end
It also changes the semantics of self? method. It defines both public singleton method and private instance method, which is equivalent to module_function.
schema/typeParam.json (#891)Writer preserve format (#900)RBS::Buffer (#907)#class from #hash to improve performance (#906)unchcked (#909)Thread::Backtrace and Thread::Backtrace::Location test (#896)CharScanner due to no longer used (#905)RBS 2.1 is a release to deliver the types and documents of the new and updated methods of Ruby 3.1.
Dir.exists?, FileTest#exists? (#884)FileTest (#880)Gem::Version#<=> (#869)Process.clock_gettime (#858)rbs annotate command (#881)RBS 2.0 ships with bounded generics, which improves the expressiveness of the language by adding a new syntax to define constraints on type parameters.
class PrettyPrint[T < _Output] interface _Output def <<: (String) -> void end attr_reader output: T def initialize: (T output) -> void end
This is the motivating example I found in the prettyprint library. The #initialize receives a object of type T and it must have #<< method. This is defined with < _Output syntax in the example. It means T has to be compatible with _Output interface. PrettyPrint[String] is okay, but PrettyPrint[Integer] is a type error.
See the PR for details.
RBS Collection feature is generally available on RBS 2.0. In short, it is Bundler for RBS. You can manage RBSs of standard libraries and third party gems with rbs collection subcommand.
$ rbs collection init created: rbs_collection.yaml # The `install` command set up RBS files and creates `rbs_collection.lock.yaml` file $ rbs collection install Installing actionpack:6.0 (actionpack@ce6664cec73) (...snip...) Using tsort:0 (/path/to/rbs-2.0.0/stdlib/tsort/0) It's done! 21 gems' RBSs now installed. # Now you can use `rbs`, `typeprof` and `steep` commands with the dependencies out of the box! $ rbs validate $ typeprof app.rb $ steep check
RBS 2.0 also introduces manifest.yaml to declare the dependencies from your gems to standard libraries explicitly. See the documentation for more information.
This version contains a bug fix, which potentially breaks the compatibility with older versions. The super class names in class definitions are now resolved in outer context. It was an incompatibility with Ruby and this PR fixed the problem.
manifest.yaml for collection to specify stdlib dependencies (#808)rbs collection (#855)#map_type methods (#841)RBS 1.8.0 ships with a language feature enhancement, generic type alias. You can define a type alias with type parameters now.
type list[T] = [T, list[T]] | nil # Defines a list of type T type int_list = list[Integer] # List of Integer type string_list = list[String] # List of String
You can find the detail in the PR.
Thread#value (#824)untyped as an expectation of return value of IO#ready? in test (#828)This version replaces RBS::Parser implementation from pure Ruby code based on Racc to C extension. It improves the RBS file parsing performance up to 5 times faster. :rocket:
super keyword and any type are no longer supported.When you want to change the parser/lexer, change the files under ext/rbs_extension directory and run rake compile to compile the extension.
ENV -- Note that it introduces a dummy ::ENVClass class, which is not defined in Ruby. (#812)Net::HTTPRequest (#784)#clone (#811, #813)Kernel#BigDecimal (#817)Tempfile.new, Tempfile.create (#792, #791)RBS::Parser (#788, #789)CollectionNotAvailable without gems from git source (#795)Parser::KEYWORDS a hash (#804)rbs collection installer (#805)Array#filter and Array#select (#820)super (#807)$XDG_CACHE_HOME during test (#781)This is a minor release including test fixes.
Resolv::Hosts by removing /etc/hosts dependency (#779)This release includes a preview of rbs collection commands, which is bundler for RBS. The command helps you manage RBS files from gem_rbs_collection or other repositories.
This feature is a preview, and any feedback is welcome!
IO#set_encoding_by_bom (#106)OpenSSL::PKey::EC#dh_compute_key (#775)bin/annotate-with-rdoc process nested constants/classes (#766, #768)This release includes stdlib signature updates.
Ractor (#755)File::Stat#size? (#754)$-i, $0, $PROGRAM_NAME (#753)This release includes feature enhancements including recursive type definition validation, improved compatibility of global variable names, and various method type updates.
Array, Enumerator, Enumerable, Hash, FalseClass, Float, Hash, Integer, Object, Range, TrueClass (#728)Array#[] (#732)Exception#set_backtrace (#738)Kernel#Array (#733)Kernel#spawn (#748)Kernel#String (#745, #751)URI::Generic#fragment (#752)URI::Generic#merge (#746)rbs-prototype-rb error when multi assign with const (#740)This release includes a minor update of resolv library RBS and a fix of test for ruby/ruby CI.
This release is to fix a bug introduced by parser update in 1.3.0.
_ (#723)This release is to fix a bug introduced by parser update in 1.3.0.
_ (#721)RBS 1.3.0 includes bug fixes of the parser and class/module definition validations.
IO (#698)Marshal (#684)Mutex (#683)Array#shift (#707)BasicObject#method_missing (#707, #710)Kernel#caller (#705)initialize method with return type void (#685)prototype runtime generate class/module declarations in nested syntax (#700)docs/rbs_by_example.md (#694)This release includes the following minor changes:
RBS 1.2 ships with better support for AST/token locations and Locator utility class. The AST objects now keep the locations of tokens. The Locator class is to translate the text position (line and column) to semantic object at the location. The class allows to find if a text position is on the class name of a class declaration.
Errors are now organized by RBS::BaseError, RBS::ParsingError, RBS::LoadingError, and RBS::DefinitionError. The library users can rescue RBS related errors with RBS::BaseError, parsing errors with RBS::ParsingError, and other errors with RBS::LoadingError and RBS::DefinitionErrors.
Updating a part of environments are supported. Library users can remove declarations read from a set of files, adding new declarations, running name resolution related to the new decls, and deleting DefinitionBuilder caches related to the changes. See RBS::Environment#reject, RBS::Environment#resolve_type_names, RBS::AncestorGraph, and RBS::DefinitionBuilder#update.
RBS::DefinitionBuilder#build_singleton now returns definitions containing instance type, which had returned resolved class instance types. This is a breaking change, but we consider it a bug fix because RBS::DefinitionBuilder#build_instance has returned instance types and #build_singleton has returned class type.
TypeName (#611)Parser::LexerError (#615)instance types on #build_singleton (#619)RACC environment variable (#602)Gem::Version polyfill (#622)refute_send_type check that method call doesn't match with types in RBS (#588)rr to run test in ruby/ruby repo (#585)#ancestors and #location of RecursiveAncestorError (#583)generate:stdlib_test Rake task (#578)prototype rb (#561)prototype rb (#560)URI, IO, File, Pathname, Module, and Time (#529, #521, #520, #511, #517, #542, #546, #540, #538)rbs prototype runtime generates extends (#535)rbs prototype runtime stability improvements (#533, #526)rbs prototype rb compatibility improvements (#545)RBS::Writer (#537)ruby2_keywords for Proc in Ruby <2.7 (#513)extension syntax (#543)alias and .new (#522, #519, #516)DuplicatedMethodDefinitionError (#539)TSort, DBM, Time, and Hash (#496, #497, #499, #507)EnvironmentWalker#each_type_name (#494)YAML, ObjectSpace, and Singleton (#408, #477, #482)prototype rb improvements (#492, #487, #486, #481)DependencyWalker API to receive Node objects instead of TypeName (#484)Enumerable, Hash, and TSort (#462, #468, #471, #472, #473, #474)prototype rb (#465)Kernel, PStore, Enumerable, and Array (#450, #443, #438, #437, #433, #432)bool type semantics (#456)rbs prototype rb (#457)ptyPTY stdlib testThis version is to improve Ruby 3 testing compatibility. Nothing changed for users.
forwardable, struct, set, URI::Generic, URI::File, and BigDecimal..new methods from initialize included from modules #390date/datetime #367rbs test command for runtime type checking #366Zlib... for overloading method definitions #362Enumerator and PTY... syntax #342DefinitionBuilder#one_instance_ancestors and DefinitionBuilder#one_singleton_ancestors #341rbs validate faster #338rbs prototype rb #334Logger.Environment#inspect. #331Mutex_m, IO, and Enumerable.Fiber, Encoding, and Enumerator.! ? #304rbs prototype rb #303rbs prototype runtime #302--require-relative option in rbs prototype runtime #299rbs ast #295rbs gem and it is different software from RBS.