* test/ruby/test_lambda.rb (test_lambda_as_iterator): refine a
test for the intention of the original report.
[ruby-core:61340] [Bug #9605]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_args.c (refine_sym_proc_call): pass block to the method when
using refinements. [ruby-core:80219] [Bug #13325]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm.c (invoke_iseq_block_from_c): guard arguments on stack, not
to be clobbered during splatting.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* .gdbinit (rp): check number of instance variables to get rid of
"Invalid number 0 of repetitions." message at an empty object.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* .gdbinit (rp): put the contents of RArray in value history, for
later use.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c: [DOC] improve and harmonize docs for IO#read and ARGF#read;
fix invalid example code for IO#read to make it syntax highlighted.
* io.c: [DOC] various improvements for docs of IO, ARGF, and Kernel:
fix indent to ensure correct code block detection; sync "outbuf"
paragraph for {IO,ARGF}#read, {IO,ARGF}#readpartial, and IO#sysread;
fix formatting of call-seq's; improve Kernel#open example to use nil?;
fix RDoc markup and typos.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Make sure it's clear that the returned values are not Unicode codepoints
for encodings other than UTF-8/UTF-16(BE|LE)/UTF-32(BE|LE).
[ci skip] [Bug #13321]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Anybody who hits these code paths can hit them again in the
future, so try deduplicating across multiple runs of these
methods to reduce garbage.
* string.c (str_upto_each): fstring on "%.*d"
* strftime.c (rb_strftime_with_timespec): fstring on "%0*d"
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
"/dev/null" is a common sight for pre-1.9.3-compatible code
targeting *nix systems, so deduplicate it here, as well.
* file.c (Init_File): use fstring for File::NULL
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
"/" and ":" are always statically registered in symbol.c (Init_op_tbl),
and "\n" is a commonly seen in source code.
* file.c (Init_File): fstring on File::SEPARATOR and File::PATH_SEPARATOR
* io.c (Init_IO): fstring on rb_default_rs ("\n")
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Users do not read commit messages, but maybe they read NEWS.
r57828 ("compile.c: apply opt_str_freeze to String#-@ (uminus)")
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rational.c (read_num): `n` was used uninitialized when the
string started with a period.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rational.c (parse_rat): allow float as a denominator as well as
a numerator. [ruby-core:79104] [Bug #13134]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rational.c (read_num): use rb_int_parse_cstr to parse integer
parts, and make String#to_r consistent with #to_i and #to_f.
[ruby-core:80098] [Bug #13105]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rational.c (read_rat_nos): denominator cannot be 0, raise zero
division in that case.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* object.c (rb_cstr_to_dbl): stop at successive underscores, as
well as Float literals. [ruby-core:80098] [Bug #13105]
* `_` should be within digits
* only one `_` allowed between digits
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (str_casecmp, str_casecmp_p): split to skip argument
check when it is a String certainly.
* string.c (sym_casecmp, sym_casecmp_p): shortcut argument checks.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This server seemed to cause "leaked file descriptor" warnings.
Moved it into the setup/teardown framework.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/tempfile.rb (Tempfile#size): Fix its behavior when nothing
is written. Tempfile#size should return 0 in this case.
The patch is from nobu <nobu@ruby-lang.org>.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
There is an invariant that ISEQ_COVERAGE(iseq) must be Qnil if and only
if option->coverage_enabled is false. This invariant was broken by
NODE_PRELUDE which updates option->coverage_enabled but not
ISEQ_COVERAGE(iseq).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c (thread_do_start): fix segfault at start with Symbol.
proc created by Symbol#to_proc does not have environment unless
using refinements. [ruby-core:80147] [Bug #13313]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c (thread_do_start): extract from a macro in
thread_start_func_2 for debugger.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (rb_str_cmp_m): use rb_check_string_type for check and
conversion, instead of calling the conversion method directly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e