Skip to content

Add missing definitions for utility, math, and algorithm standard libraries (digest, forwardable, random-formatter, singleton, time, tsort) - #3173

Open
zonuexe wants to merge 1 commit into
ruby:masterfrom
zonuexe:fix/stdlib-missing-utils-math
Open

zonuexe wants to merge 1 commit into
ruby:masterfrom
zonuexe:fix/stdlib-missing-utils-math

Conversation

@zonuexe

@zonuexe zonuexe commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Add missing methods, classes, and constants for digest, forwardable, random-formatter, singleton, time, and tsort.
Also refine Forwardable.debug and Forwardable.debug=.

Note: benchmark and bigdecimal-math have been excluded as they are in ALUMNI_STDLIBS and planned to be removed from the rbs repo.

Changes

Ruby Method Change C function
Digest::VERSION Add constant VERSION https://github.com/ruby/digest/blob/master/ext/digest/digest.c
Forwardable.debug Return type untyped → boolish https://github.com/ruby/forwardable/blob/master/lib/forwardable.rb
Forwardable.debug= Return type T → void, accept boolish https://github.com/ruby/forwardable/blob/master/lib/forwardable.rb
Random::Formatter::ALPHANUMERIC Add constant ALPHANUMERIC https://github.com/ruby/ruby/blob/v4.0.7/lib/random/formatter.rb
Singleton.module_with_class_methods Add singleton method module_with_class_methods https://github.com/ruby/singleton/blob/master/lib/singleton.rb
Singleton::VERSION Add constant VERSION https://github.com/ruby/singleton/blob/master/lib/singleton.rb
Time::VERSION Add constant VERSION https://github.com/ruby/time/blob/master/lib/time.rb
TSort::VERSION Add constant VERSION https://github.com/ruby/tsort/blob/master/lib/tsort.rb

@zonuexe
zonuexe force-pushed the fix/stdlib-missing-utils-math branch from fa965e5 to 0174697 Compare September 26, 2026 23:47

@ksss ksss left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

benchmark and bigdecimal-math are planned to be removed from the rbs repo.
Please submit your requests to each gem.

ALUMNI_STDLIBS = {
"mutex_m" => ">= 0.3.0",
"abbrev" => nil,
"base64" => nil,
"benchmark" => nil,
"bigdecimal" => nil,
"csv" => nil,
"kconv" => nil,
"logger" => nil,
"minitest" => nil,
"net-smtp" => nil,
"nkf" => nil,
"observer" => nil,
"cgi" => nil,
"pstore" => nil,
}

…raries (digest, forwardable, random-formatter, singleton, time, tsort)

Add missing methods, classes, and constants for `digest`, `forwardable`, `random-formatter`, `singleton`, `time`, and `tsort`.
Also refine `Forwardable.debug` and `Forwardable.debug=`.

Note: `benchmark` and `bigdecimal-math` have been excluded as they are in `ALUMNI_STDLIBS` and planned to be removed from the rbs repo.

| Ruby Method | Change | C function |
|---|---|---|
| `Digest::VERSION` | Add constant `VERSION` | https://github.com/ruby/digest/blob/master/ext/digest/digest.c |
| `Forwardable.debug` | Return type `untyped` → `boolish` | https://github.com/ruby/forwardable/blob/master/lib/forwardable.rb |
| `Forwardable.debug=` | Return type `T` → `void`, accept `boolish` | https://github.com/ruby/forwardable/blob/master/lib/forwardable.rb |
| `Random::Formatter::ALPHANUMERIC` | Add constant `ALPHANUMERIC` | https://github.com/ruby/ruby/blob/v4.0.7/lib/random/formatter.rb |
| `Singleton.module_with_class_methods` | Add singleton method `module_with_class_methods` | https://github.com/ruby/singleton/blob/master/lib/singleton.rb |
| `Singleton::VERSION` | Add constant `VERSION` | https://github.com/ruby/singleton/blob/master/lib/singleton.rb |
| `Time::VERSION` | Add constant `VERSION` | https://github.com/ruby/time/blob/master/lib/time.rb |
| `TSort::VERSION` | Add constant `VERSION` | https://github.com/ruby/tsort/blob/master/lib/tsort.rb |
@zonuexe
zonuexe force-pushed the fix/stdlib-missing-utils-math branch from 0174697 to af6a2be Compare September 27, 2026 07:33
@zonuexe zonuexe changed the title Add missing definitions for utility, math, and algorithm standard libraries Add missing definitions for utility, math, and algorithm standard libraries (digest, forwardable, random-formatter, singleton, time, tsort) Sep 27, 2026
@zonuexe

zonuexe commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author

Thank you for the guidance! I have excluded benchmark and bigdecimal-math from this PR, keeping only digest, forwardable, random-formatter, singleton, time, and tsort. I will submit separate PRs to ruby/benchmark and ruby/bigdecimal.
Also updated constant assertions in test files to use assert_const_type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants