refactored for future extension
(https://github.com/ruby/irb/pull/707)
* Move completion implementation to completion/regexp_completor for future extension
* Remove constant CompletionProc and PerfectMatchedProc and add a class method
* Move document display logic to InputCompletor. Each completor only need to implement `completion_caididates` and `doc_namespace`
* Move display_document logic to RelineInputMethod
* Use RegexpCompletor directly. Not through class method of InputCompletor.
* RegexpCompletor extends BaseCompletor, move back definition to completion.rb
* Move display_document test to input_method test
* Stop re-initialize completor on each completion phase
* Store completor to ReadlineInputMethod's iver
https://github.com/ruby/irb/commit/1e98521483
Given `SHAPE_MAX_NUM_IVS 80`, we transition to TOO_COMPLEX
way before we could overflow a 8bit counter.
This reduce the size of `rb_shape_t` from 32B to 24B.
If we decide to raise `SHAPE_MAX_NUM_IVS` we can always increase
that type again.
When I shared srcdir as read-only in lima-vm,
`make install` causes following error:
```
Update rbs to 33813a60752624d58dfe5ae770b39bfaf29fbaf1
error: cannot open .git/FETCH_HEAD: Read-only file system
```
I cannot find any ignore option for `git checkout --detach`
when already checked out. So I add `if`.
When using a Ruby preview the require path of `bundler/setup` is
similar to `-r/opt/ruby3.3.0-preview2/lib/ruby/3.3.0+0/bundler/setup`.
The special character `+` in the string makes the Regexp fail,
leading to multiple addition of the same require statement each time
`set_rubyopt` is called (e.g. server reloading).
Escaping the characters in the string esure a correct match with all
the different Ruby versions.
https://github.com/rubygems/rubygems/commit/dd43dfa709
So when building instruction sequences for a scope we can reference
items from the ast node that requires the scope. This is useful for for
loops, where the local variable tables from the parent scope will need
to be referenced.
https://github.com/ruby/prism/commit/426b1ca094
In parse.y, node can be NODE_DEF_TEMP or NODE_EXITS.
Hit "unknown node" without taking care of them.
For example `ruby --dump=y lib/cgi/util.rb` causes
"[BUG] unknown node: 107".
This still allocates a ton (a string for each line, plus a bunch of
splits into arrays), but it helps a bit when Bundler has to go through
dependency resolution.
```
==> memprof.after.txt <==
Total allocated: 194.14 MB (2317172 objects)
Total retained: 60.81 MB (593164 objects)
==> memprof.before.txt <==
Total allocated: 211.97 MB (2404890 objects)
Total retained: 62.85 MB (640342 objects)
```
https://github.com/rubygems/rubygems/commit/c68b41b0e5
From running in a random rails app I have locally, here are the changes
1) for `bundle lock --update --bundler` (forcing Bundler to go through
dependency resolution)
```
==> memprof.after.txt <==
Total allocated: 2.98 MB (48307 objects)
Total retained: 1.21 MB (16507 objects)
==> memprof.before.txt <==
Total allocated: 12.62 MB (198506 objects)
Total retained: 1.30 MB (23133 objects)
```
2) for `bin/rails runner true` (essentially only bundler/setup)
```
==> memprof.after.txt <==
Total allocated: 59.50 kB (1017 objects)
Total retained: 25.08 kB (362 objects)
==> memprof.before.txt <==
Total allocated: 561.82 kB (8575 objects)
Total retained: 27.28 kB (513 objects)
```
https://github.com/rubygems/rubygems/commit/35c8ed2cb8