aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* improve docs for #round methodsstomar2017-04-032-70/+92
| | | | | | | | * numeric.c: [DOC] improve and harmonize documentation for {Float,Integer,Numeric}#round. * rational.c: [DOC] ditto for Rational#round. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix arguments order of IO#pwritekazu2017-04-032-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add IO#pread and IO#pwrite methodsnobu2017-04-035-0/+175
| | | | | | | | | | | | | | | | | These methods are useful for safe/concurrent file I/O in multi-thread/process environments and also fairly standard nowadays especially in systems supporting pthreads. Based on patches by Avseyev <sergey.avseyev@gmail.com> at [ruby-core:79290]. [Feature #4532] * configure.in: check for pwrite(2). pread() is already used internally for IO.copy_stream. * io.c: implement wrappers for pread(2) and pwrite(2) and expose them in IO. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2017-04-03svn2017-04-021-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: avoid duplicate mark entry for string literal Rangenormal2017-04-021-1/+1
| | | | | | | | | | | | iseq_add_mark_object is called in iseq_set_sequence later on, so we only need to call iseq_add_mark_object_compile_time in iseq_peephole_optimize. Without this change, there would've been a duplicate entry in the long-lived iseq mark_ary. * compile.c (iseq_peephole_optimize): avoid duplicate mark object entry [ruby-core:80536] [Feature #13355] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update configure by prereq [ci skip]nobu2017-04-021-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c: comments on M:N threading [ci skip]normal2017-04-021-0/+6
| | | | | | | | | | | I may experiment with M:N threading in coming months. Often I find myself yearning for the old 1.8 days when spawning threads was really cheap for network operations. But I also like to use native blocking recv_io and accept calls for round-robin load distribution and accessing files on systems with dozens of slow rotational disks. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rational.c: improves Rational#round rdoc [ci skip]nobu2017-04-011-4/+14
| | | | | | | * rational.c (nurat_round_n): [DOC] improves Integer#round documentation as well as Float#round. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_optimization.rb: quiet warningsnormal2017-04-011-3/+3
| | | | | | | | This quiets an old "assigned but unused variable" warning left over after r56653 as well as two new "ambiguous first argment" warnings introduced in r58233. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: optimize literal String range in case/when dispatchnormal2017-04-012-0/+46
| | | | | | | | | | | | | | | | | | | This is similar in spirit to opt_case_dispatch as the literal Range here is guaranteed to be immutable when used for checkmatch. Normal range literals with non-frozen strings are actually mutable, as Range#begin and Range#end exposes the strings to modification. So those Range objects cannot be frozen without breaking compatibility, but Ranges in case/when dispatch can be frozen at compile time. * compile.c (iseq_peephole_optimize): persistent Range creation when String literals are used as beginning and end of range when used for case/when dispatch. [ruby-core:80290] [Feature #13355] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* doc/contributors.rdoc: [DOC] updatestomar2017-04-011-0/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2017-04-02svn2017-04-011-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rational.c: improve docsstomar2017-04-011-93/+119
| | | | | | | | | | | | | | * rational.c: [DOC] improve docs for Rational and related methods * improve class documentation for Rational * fix call-seq's * simplify examples for Rational#{floor,ceil,truncate,round} * fix wrong examples for #floor, subtraction, and exponentiation * improve docs for #<=>, Kernel#Rational, {String,Float}#to_r, Integer.{gcd,lcm,gcdlcm} * fix typos, grammar, and rdoc formatting * other improvements git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ostruct.rb: improve fix for OpenStruct.allocate + #respond_to?eregon2017-04-011-7/+1
| | | | | | | | | * lib/ostruct.rb (OpenStruct#respond_to_missing?): this makes OpenStruct#respond_to? works on any OpenStruct instance, just like Kernel#respond_to? does, without workarounds. [ruby-core:80292] [Bug #13358] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2017-04-01svn2017-04-011-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c: Array#append and Array#prependnobu2017-04-013-0/+24
| | | | | | | | | * array.c (Init_Array): Add alias "append" to Array#push, and "prepend" to Array#unshift. [Feature #12746] [Fix GH-1574] Author: pascbjumper2 <stowers.joshua@live.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* exts.mk.tmpl: note footer [ci skip]nobu2017-03-311-1/+3
| | | | | | * template/exts.mk.tmpl: place note footer message at the end. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* debug.c: check codepage value [ci skip]nobu2017-03-311-3/+7
| | | | | | * debug.c (set_debug_option): check garbage and overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* RUBY_DEBUG codepage option [ci skip]nobu2017-03-312-6/+34
| | | | | | | | | | * debug.c (set_debug_option): add "codepage" option to force locale charmap on Windows. * localeinit.c (locale_charmap): use the codepage by debug env if given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* setup.mak: ENABLE_DEBUG_ENV [ci skip]nobu2017-03-311-0/+3
| | | | | | | * win32/setup.mak (-basic-vars-): pass ENABLE_DEBUG_ENV to Makefile. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2017-03-31svn2017-03-301-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* localeinit.c: locale_charmap return valuenobu2017-03-301-9/+26
| | | | | | | | * localeinit.c (locale_charmap): fix the return value to call conv function instead of encoding index on platforms where locale information is not available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* .travis.yml: make tests silent [ci skip]nobu2017-03-301-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* .travis.yml: checkout ruby/spec PRnobu2017-03-301-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* git-refresh: rewrite optionsnobu2017-03-301-13/+6
| | | | | | | * tool/git-refresh: parse options without git-rev-parse, which is old on travis. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* tool/git-refreshnobu2017-03-302-57/+56
| | | | | | | | * tool/git-refresh: tool to clone or update git working directory. * Makefile.in: use git-refresh. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2017-03-30svn2017-03-291-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* methods.rdoc: small improvementsstomar2017-03-291-9/+9
| | | | | | | * doc/syntax/methods.rdoc: [DOC] small improvements: fix some typos, grammar, punctuation, consistently use capitalized "Ruby". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix two typosmame2017-03-292-2/+3
| | | | | | My typo checker :-) found the bugs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c: Supress logical-op-parentheses warningsorah2017-03-291-2/+2
| | | | | | | | * string.c(rb_str_upcase_bang): Supress logical-op-parentheses warning Patch by Fukuo Kadota <fukuo-kadota@cookpad.com>, Closes [GH-1570] [Bug #13387]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vsnprintf.c: prefix with precisionnobu2017-03-292-8/+4
| | | | | | | * vsnprintf.c (BSD_vfprintf): sign and hex-prefix should not be counted in precision. [ruby-dev:47714] [Bug #8916] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_minitest_unit.rb: assert_triggerednobu2017-03-291-1/+2
| | | | | | | * test/minitest/test_minitest_unit.rb (assert_triggered): rename to be hidden in backtraces. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add documents on Process::CLOCK_* constantssorah2017-03-291-0/+26
| | | | | | | | * process.c: Add documents on Process::CLOCK_* constants. Patch by Sunao Komuro <sunao-komuro@cookpad.com>. Closes [GH-1567] [Bug #13386] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix `make clean` errorssorah2017-03-292-2/+2
| | | | | | | | | | | Patch by Kohei Suzuki <eagletmt@gmail.com>. * common.mk(clean-rubyspec): Supress error messages when rubyspec files don't exist. [GH-1563] [Bug #13384] * Makefile.in: Fix error when files don't exist. [GH-1563] [Bug #13384] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: dot_or_colonnobu2017-03-291-10/+2
| | | | | | | * parse.y (dot_or_colon): use the default action without type casts. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Remove unused Init_frozen_strings declarationsorah2017-03-291-1/+0
| | | | | | | | | | | | Init_frozen_strings definition is removed in r51511. https://bugs.ruby-lang.org/issues/11423 Patch by Kohei Suzuki <eagletmt@gmail.com> * internal.h: Remove declaration of unexist function [Fix GH-1558] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_symbol.rb: switch to assert_not_equalnobu2017-03-291-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2017-03-29svn2017-03-281-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_symbol.rb: new test for nondeterminismnormal2017-03-281-0/+10
| | | | | | | | | | | We need to ensure hashes for static symbols remain non-deterministic to avoid DoS attacks. This is currently the case since 2.4+, but was not for the 2.3 series. * test/ruby/test_symbol.rb (test_hash_nondeterministic): new test [ruby-core:80430] [Bug #13376] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix a typo [ci skip]kazu2017-03-281-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Update assertion message [ci skip]kazu2017-03-281-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ostruct.rb: refine visibility failure messagenobu2017-03-282-4/+31
| | | | | | | * lib/ostruct.rb (method_missing): raise an exception with proper visibility message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c: improves Integer#round rdoc [ci skip]nobu2017-03-281-1/+10
| | | | | | | * numeric.c (int_round): [DOC] improves Integer#round documentation as well as Float#round. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2017-03-28svn2017-03-281-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c: improves Float#round rdoc [ci skip]nobu2017-03-282-2/+12
| | | | | | | | | * numeric.c (flo_round): [DOC] improves Float#round documentation to better highlight the half keyword. [Fix GH-1541] Author: Evan Brodie <brodie.evan@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: err at glob failurenobu2017-03-273-21/+118
| | | | | | | | | | | | | * dir.c (glob_helper): raise a SystemCallError exception when opendir() failed, except for ENOENT, ENOTDIR, and EACCES. this behavior predates 1.0; the comments in glob.c claimed that glob() returned -1 on error but actualy the pointer to a global variable, then dir_glob() did check only -1 as the comments, and ignored actual errors. [ruby-core:80226] [Bug #13276] dir.c: ruby_glob_funcs_t git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c: warning functionsnobu2017-03-272-0/+78
| | | | | | | | | * error.c: define warning functions in all combinations of * no errno, system errno, argument * without/with encoding * enabled/disabled by default git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c: refactor warning messagesnobu2017-03-271-66/+48
| | | | | | | | | | * error.c (with_warning_string): extract building warning message string from variadic arguments. * error.c (syserr_warning): write warning message with the system error message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2017-03-27svn2017-03-271-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix redefinition optimization for -"literal string" (UMinus)normal2017-03-275-1/+27
| | | | | | | | | | | | | | | | | Unfortunately this enlarges insns.def by yet another instruction. However, it is much prettier than opt_str_freeze in use, and maybe we can avoid having so many instructions in the future. [ruby-core:80368] * insns.def (DEFINE_INSN): new instruction: opt_str_uminus (maybe temporary) * compile.c (iseq_compile_each0): split instructions * test/ruby/test_optimization.rb (test_string_uminus): new test * vm.c (vm_init_redefined_flag): set redefinintion flag for uminus * vm_core.h (enum ruby_basic_operators): add BOP_UMINUS git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e