Dir.children is available since Feature #11302.
Find.find can use of the new list (having no '.' neither '..' entries),
making now superflous an if statement.
This change can improve the performance of Find.find when the path
has lots of entries (thousands?).
https://bugs.ruby-lang.org/issues/11302
patched by Espartaco Palma <esparta@gmail.com>
https://github.com/ruby/ruby/pull/1697 fix GH-1697
[Feature #13896]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (f_arglist, parser_yylex): set lex_state via
SET_LEX_STATE macro for yydebug messages.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* object.c (convert_type_with_id): fix failure message for
explicit conversion. rb_convert_type_with_id and
rb_check_convert_type_with_id are not only for implicit
conversions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* spec/rubyspec/optional/capi/spec_helper.rb (compile_extension):
rescue possible EBADF as jobserver fd may not be available.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* spec/rubyspec/core/dir/mkdir_spec.rb: the source directory may
be on a read-only filesystem.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* spec/rubyspec/optional/capi/ext/fixnum_spec.c: FIX2INT and
FXI2UINT return long, in spite of their names.
* spec/rubyspec/optional/capi/ext/range_spec.c: err is int.
* spec/rubyspec/optional/capi/ext/st_spec.c: st_index_t is larger
than int.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Ensure `opt` is a hash before using `rb_hash_lookup` to `opt`.
This will prevent SEGV when an inappropriate object (i.e. an array)
is passed to `opt`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
It had failed to sanitize some type of exception messages. Reported and
patched by Yusuke Endoh (mame) at https://hackerone.com/reports/223363
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (ripper_state): add states of scanner to tokens from
Ripper.lex and Ripper::Filter#on_*. based on the patch by
aycabta (Code Ahss) at [ruby-core:81789]. [Feature #13686]
* ext/ripper/tools/preproc.rb (prelude, usercode): generate EXPR_*
constants from enums.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Coverage generates unique ID numbers for each branch and each method.
Use long instead of int for the IDs. I don't want to see 2^32 branches
and methods in one file, but just in case...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
To measure coverage of C code:
`./configure --enable-gcov && make && make exam && make lcov`
To measure coverage of Ruby code:
`./configure && make && make exam COVERAGE=true && make lcov`
To measure coverage of both languages at a time:
`./configure --enable-gcov && make && make exam COVERAGE=true && make lcov`
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
`unless` statement was a syntactic sugar for `if` statement,
which made the result of branch coverage hard to understand.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* TestFileExhaustive#test_atime: It fails with nano-sec precise.
I changed to use unixtime for this assertion for APFS.
* TestFileExhaustive#test_expand_path: skip assertion when given
invalid charactor on APFS.
[Bug #13816][ruby-core:82383]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
The old API:
Coverage.start
load "foo.rb"
p Coverage.result #=> {"foo.rb" => [1, 2, nil]}
The new API:
ENV["COVERAGE_EXPERIMENTAL_MODE"] = "true"
Coverage.start(lines: true)
load "foo.rb"
p Coverage.result #=> {"foo.rb" => {:lines => [1, 2, nil]}}
This new API allows us to add other measuring target types.
Notes:
* To keep compatibility, the old interface is still remained; passing no
optional argument makes `Coverage.result` return the old format.
* This feature is still experimental. So, to enable the new API, the
environment variable `COVERAGE_EXPERIMENTAL_MODE` must be set. I plan
to activate this feature by Ruby 2.5.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This is needed for passing to the hook function the measuring target
type (line/branch/method) and the site of coverage event fired.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_rubyoptions.rb (TestRubyOptions#test_search):
PATH must keep library loading paths on a platform where it is
used for that purpose, for extra libraries.
[ruby-core:81178] [Bug #13569] [Fix GH-1616]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in, win32/Makefile.sub: set LIBPATHENV to PATH on
Windows, for extra DLLs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e