This is a fix related to the following issue.
rails/rails#33464
Not only in rails apps, some little ruby app with only 2 or 3 ruby
files reproduce the problem during many years.
When I edit linux ruby files by vs code via samba on windows, and
then I execute the ruby files on linux, "require_relative" will
sometimes not work properly.
My solution is to wait a monument if the required relative file is
busy.
In commit f8ea2860b0 the Reline encoding
for native windows console was changed to hardcoded UTF-8.
This caused failures in reline and readline tests, but they were hidden,
because parallel ruby tests incorrectly used Reline::ANSI as IOGate.
Tests failures were raised in single process mode, but not with -j switch.
This patch corrects encodings on native Windows console.
The previous detection per get_screen_size fails when stdout is passed
to a pipe. That is the case when running ruby tests in parallel ("-j" switch).
In this case Reline believes that it's running on MinTTY and the tests
are running with ANSI IOGate instead of the Windows adapter on MINGW.
So parallel test results were different to that of a single process.
This commit fixes these differencies.
The code is taken from git sources and translated to ruby.
NtQueryObject() is replaced by GetFileInformationByHandleEx(), because
NtQueryObject() is undocumented and is more difficult to use:
c5a03b1e29/compat/winansi.c (L558)
VALUE and rb_serial_t do not agree with their width. We have to be
consistent. Assigning an rb_serial_t value to a VALUE variable is
practically a problem on a ILP32 environment.
Rails before 5.2 added Array#append as an alias to Array#<< ,
so that it expects only one argument.
However ruby-2.5 added Array#append as an alias to Array#push
which takes any number of arguments.
If irb completion is used in `rails c` (for example "IO.<tab>")
it fails with:
irb/completion.rb:206:in `<<': wrong number of arguments (given 3, expected 1) (ArgumentError)
Using Array#push instead of Array#append fixes compatibility.
https://github.com/ruby/irb/commit/5b7bbf9c34
Sort the results which matched single wildcard or character set in
binary ascending order, unless `sort: false` is given. The order
of an Array of pattern strings and braces are not affected.
* The definition lists extensions of the RDoc Markdown parser does
not support nesting.
* The RDoc Markdown parser requires more indents for nested lists.
It was found that a feature to check and add ruby2_keywords flag to an
existing Hash is needed when arguments are serialized and deserialized.
It is possible to do the same without explicit APIs, but it would be
good to provide them as a core feature.
https://github.com/rails/rails/pull/38105#discussion_r361863767
Hash.ruby2_keywords_hash?(hash) checks if hash is flagged or not.
Hash.ruby2_keywords_hash(hash) returns a duplicated hash that has a
ruby2_keywords flag,
[Bug #16486]
It is useful for a program that dumps and load arguments (like drb).
In future, they should deal with both positional arguments and keyword
ones explicitly, but until ruby2_keywords is deprecated, it is good to
support the flag in marshal.
The implementation is similar to String's encoding; it is dumped as a
hidden instance variable.
[Feature #16501]