Add missing definitions for utility, math, and algorithm standard libraries (digest, forwardable, random-formatter, singleton, time, tsort) - #3173
Conversation
fa965e5 to
0174697
Compare
ksss
left a comment
There was a problem hiding this comment.
benchmark and bigdecimal-math are planned to be removed from the rbs repo.
Please submit your requests to each gem.
rbs/lib/rbs/collection/config/lockfile_generator.rb
Lines 7 to 22 in 5a8d8ac
0174697 to
af6a2be
Compare
|
Thank you for the guidance! I have excluded |
| # prng.rand #=> 0.5816771641321361 | ||
| # prng.rand(1000) #=> 485 | ||
| # prng.rand(1..6) #=> 3 | ||
| # |
There was a problem hiding this comment.
The documentation overlaps with random.rbs.
We should set %a{annotate:rdoc:skip}
|
|
||
| def test_alphanumeric_constant | ||
| assert_const_type "Array[String]", "Random::Formatter::ALPHANUMERIC" | ||
| assert_equal "A", Random::Formatter::ALPHANUMERIC.first |
There was a problem hiding this comment.
This is a test of behavior, not a test of types.
|
|
||
| assert_const_type "Module", "Singleton::SingletonInstanceMethods" | ||
| def test_instance | ||
| assert_equal Example.instance, Example.instance |
There was a problem hiding this comment.
This is a test of behavior, not a test of types.
I believe that testing this method is impossible.
af6a2be to
ccf1e1d
Compare
…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 |
ccf1e1d to
f739d1b
Compare
|
Thanks! |
Add missing methods, classes, and constants for
digest,forwardable,random-formatter,singleton,time, andtsort.Also refine
Forwardable.debugandForwardable.debug=.Note:
benchmarkandbigdecimal-mathhave been excluded as they are inALUMNI_STDLIBSand planned to be removed from the rbs repo.Changes
Digest::VERSIONVERSIONForwardable.debuguntyped→boolishForwardable.debug=T→void, acceptboolishRandom::Formatter::ALPHANUMERICALPHANUMERICSingleton.module_with_class_methodsmodule_with_class_methodsSingleton::VERSIONVERSIONTime::VERSIONVERSIONTSort::VERSIONVERSION