Граф коммитов

28533 Коммитов

Автор SHA1 Сообщение Дата
kazu 0395a51ea7 ChangeLog should be us-ascii [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-16 12:25:51 +00:00
duerst 6a808bda64 * enc/unicode/case-folding.rb, casefold.h: Used only first element
(rather than all) of target in CaseUnfold_11 array.
  (with Kimihito Matsui)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-16 10:10:37 +00:00
nobu 527fa61087 numeric.c: fix segfault
* numeric.c (compare_with_zero): fix variable name, rb_cmperr
  requires VALUEs but not an ID.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-16 09:25:08 +00:00
nobu 135a171ce1 dir.c: Dir.empty?
* dir.c (rb_dir_s_empty_p): add Dir.empty? method, which tells the
  argument is the name of an empty directory.  [Feature #10121]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-16 08:34:47 +00:00
nobu 9cedfbcb91 rbinstall.rb: drive letter in without_destdir
* tool/rbinstall.rb (without_destdir): just strip a drive letter
  which is prepended by with_destdir.
  pointed out by @DavidEGrayson.
  https://github.com/ruby/ruby/commit/0e5f9ae#commitcomment-16101763

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-16 00:51:48 +00:00
naruse 2708fb6ba7 * insns.def (opt_plus): simply use LONG2NUM() instead of wrongly
complex overflow case.

* insns.def (opt_sub): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-15 19:42:59 +00:00
nobu 0e5f9aeaea rbinstall.rb: drive letter in without_destdir
* tool/rbinstall.rb (without_destdir): compare with the destdir
  after stripping a drive letter, on dosish platforms.
  pointed out by @DavidEGrayson.
  https://github.com/ruby/ruby/commit/d0cf23b#commitcomment-16100407

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-15 17:50:08 +00:00
nobu fbb51ff44c parse.y: kwarg to method with same name variable
* parse.y (parse_ident): allow keyword arguments just after a
  method where the same name local variable is defined.
  [ruby-core:73816] [Bug#12073]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-15 06:44:36 +00:00
duerst c3554cdea6 * enc/unicode/case-folding.rb: Added debugging option
(with Kimihito Matsui)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-15 05:43:55 +00:00
nobu fdcc924fce mkmf.rb: Do not modify caller strings
* lib/mkmf.rb (with_{cpp,c,ld}flags): copy caller strings not to
  be modified, in append_{cpp,c,ld}flags respectively.
  [Fix GH-1246]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-14 08:32:15 +00:00
nobu e294f4cfdf not overwrite cause
* eval.c (setup_exception): set the cause only if it is explicitly
  given or not set yet.  [Bug #12068]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-14 07:19:23 +00:00
akr f061d40326 * hash.c (rb_hash_invert): [DOC] more examples.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-13 12:45:59 +00:00
nobu 1ee9cad027 CIDR in no_proxy
* lib/uri/generic.rb (URI::Generic#find_proxy): support CIDR in
  no_proxy.  [ruby-core:73769] [Feature#12062]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-13 08:31:12 +00:00
nobu 423d042371 no_proxy with whitespaces and leading dots
* lib/uri/generic.rb (find_proxy): exclude white-spaces and allow
  for a leading dot in the domain name in no_proxy.
  [ruby-core:54542] [Feature #8317]

The previous implementation wouldn't allow for white-spaces nor a leading dot
in the domain name. The latter is described in the wget documentation as a valid case.

By being more strict on the characters, which are counted to a domainname,
we allow for white-spaces.
Also, a possible leading dot will be handled gracefully.

[Fix GH-285]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-13 08:12:21 +00:00
nobu 6bbe44a39a error.c: fix doc [ci skip]
* error.c (name_err_initialize, nometh_err_initialize): [DOC] fix
  argument positions.  optional parameters except for the message
  are placed at the last.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-12 03:21:17 +00:00
nobu 0a19e7f0a3 net/ftp.rb: NullSocket#closed?
* net/ftp.rb: add NullSocket#closed? to fix closing not opened
  connection.  [Fix GH-1232]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-12 02:50:09 +00:00
nobu 301cbf4d69 Update re.c [ci skip]
* re.c (rb_reg_initialize_m): [DOC] fix missing right bracket.
  [Fix GH-1243]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-12 02:17:58 +00:00
nobu 2456239f18 configure.in: fix universal binary
* configure.in (RUBY_CHECK_SIZEOF, RUBY_DEFINT): fix for types
  which are conditionally available depending on architectures
  when universal binary, e.g., __int128.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-11 05:58:16 +00:00
naruse 832f275316 * configure.in (RUBY_DEFINT): use Parameter Expansion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-10 21:29:50 +00:00
naruse 60f3986914 * configure.in (int128_t): don't check HAVE_XXX (for example
HAVE___INT128) because RUBY_CHECK_SIZEOF() don't define it for
  config.h and use of $ac_cv_sizeof___int128 alternates the check.
  (and don't need to define because users shouldn't know that)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-10 20:57:49 +00:00
nobu 12eb0df4d5 check ar D flag
* configure.in (ARFLAGS): check if deterministic mode flag is
  effective, which is on by default on Ubuntu.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-10 03:03:57 +00:00
sonots 460e9d8d83 * lib/logger.rb: Remove block from Logger.add as it's not needed
patch provided by Daniel Lobato Garcí [fix GH-1240] [Bug #12054]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-09 07:41:51 +00:00
zzak 70d040ddbd * ext/zlib/zlib.c: Document mtime header behavior with patch by @schneems
Fixes [GH-1129]: https://github.com/ruby/ruby/pull/1129


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-09 05:33:35 +00:00
zzak d901058900 * re.c: Remove deprecated kcode argument from Regexp.new and compile
patch provided by Dylan Pulliam [Bug #11495]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-09 04:54:39 +00:00
duerst 73ab88994f * enc/unicode/case-folding.rb, enc/unicode/casefold.h: Flags for
upper/lower conversion added (titlecase and SpecialCasing still missing)
  (with Kimihito Matsui)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-08 12:26:35 +00:00
duerst 2ca7569c6d * string.c, enc/unicode.c: Disassociating ONIGENC_CASE_FOLD flag from
ONIGENC_CASE_DOWNCASE.
(with Kimihito Matsui)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-08 11:44:12 +00:00
duerst 8f10a72d90 * enc/unicode.c: Shortened macros for enc/unicode/casefold.h to
single-letter; use flags in casefold.h for logic.
* enc/unicode/case-folding.rb: Added flag for case folding.
  Changed parameter passing.
* enc/unicode/casefold.h: New flags added.
(with Kimihito Matsui)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-08 04:00:31 +00:00
nobu 12bdb15e71 ruby.c: err ambiguous feature name [ci skip]
* ruby.c (feature_option): raise a runtime error if ambiguous
  feature name is given, in the future.  [Bug #12050]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-08 01:30:22 +00:00
duerst c1db3a49a4 * common.mk: Removed enc/unicode/casefold.h from automatic build because
some CI systems don't have gperf. Creation of enc/unicode/casefold.h
  is now possible with make unicode-up. This is intended as a temporary measure.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-08 00:44:10 +00:00
nagachika d5b4511020 * ChangeLog: revive an entry for r53762 accidentally removed at r53764.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-07 19:40:05 +00:00
duerst 49ca434bcf * common.mk: Added two more precondition files for enc/unicode/casefold.h
* enc/unicode.c: Added shortening macros for enc/unicode/casefold.h
* enc/unicode/case-folding.rb: Fixed file encoding for CaseFolding.txt
  to ASCII-8BIT (should fix some ci errors). Clarified usage. Created
  class MapItem. Partially implemented class CaseMapping.
(with Kimihito Matsui)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-07 13:10:20 +00:00
duerst e40d117339 * enc/unicode/case-folding.rb: Fixing parameter passing.
(with Kimihito Matsui)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-07 05:12:44 +00:00
duerst 5cbe9fe5c4 * enc/unicode/case-folding.rb: New classes CaseMapping/CaseMappingDummy
to pass as parameters; not yet implemented or used.
(with Kimihito Matsui)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-07 02:44:14 +00:00
duerst ee696372a8 * common.mk: using new option in recipe for enc/unicode/casefold.h
* enc/unicode/case-folding.rb: Correctly specify argument to new option.
(with Kimihito Matsui)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-07 02:16:12 +00:00
duerst 1e7770d372 (this commit message applies to the previous commit)
* common.mk: explicit recipe for enc/unicode/casefold.h
* enc/unicode/case-folding.rb: Adding -m option to prepare for using
  multiple data files.
(with Kimihito Matsui)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-07 01:43:39 +00:00
naruse 0a3fc607c1 Revert "check __int64_t and __int128_t"
This reverts commit r53750.
Those types seems to be for C++, and breaks old GCC.
http://rubyci.s3.amazonaws.com/c64b/ruby-trunk/log/20160206T130202Z.diff.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-06 17:56:47 +00:00
nobu 8e46f401b2 ASCII-incompatible escape
* lib/cgi/util.rb (escapeHTML, unescapeHTML): consider
  ASCII-incompatible encodings.  [Fix GH-1239]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-06 13:31:07 +00:00
nobu 7475d8048e check __int64_t and __int128_t
* configure.in: check __int64_t and __int128_t for RUBY_DEFINT on
  OS X.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-06 11:44:33 +00:00
duerst e8dde46b60 * test/ruby/enc/test_regex_casefold.rb: Added data-based testing for
String#downcase :fold.
* enc/unicode.c: Fixed a range error (lowest non-ASCII character affected
  by case operations is U+00B5, MICRO SIGN)
* test/ruby/enc/test_case_mapping.rb: Explicit test for case folding of
  MICRO SIGN to Greek mu.
(with Kimihito Matsui)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-06 06:18:38 +00:00
duerst b217dc81f3 * test/ruby/enc/test_regex_casefold.rb: Tests for three case folding
primitives (mbc_case_fold, get_case_fold_codes_by_str,
  apply_all_case_fold) in the various encodings. Currently only known
  good encodings are tested to avoid test failures. For bug hunting,
  start by adding more encodings with
      generate_test_casefold encoding
  (with Kimihito Matsui)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-06 05:51:33 +00:00
duerst 81515b2381 * enc/unicode.c, test/ruby/enc/test_case_mapping.rb: Implemented :fold
option for String#downcase by using case folding data from
  regular expression engine, and added a few simple tests.
  (with Kimihito Matsui)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-06 05:37:29 +00:00
duerst 6ab70ad72a * test/ruby/enc/test_case_mapping.rb: added tests for :ascii option.
(with Kimihito Matsui)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-05 11:09:07 +00:00
naruse 1f57a334da * insns.def (opt_mult): Use int128_t for overflow detection.
* bignum.c (rb_uint128t2big): added for opt_mult.

* bignum.c (rb_uint128t2big): added for rb_uint128t2big..

* configure.in: define int128_t, uint128_t and related MACROs.
  Initially introduced by r41379 but reverted by r50749.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-05 04:31:27 +00:00
duerst b658249cef * enc/unicode.c: Activated :ascii flag for ASCII-only case conversion
(with Kimihito Matsui)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-04 12:05:23 +00:00
nobu 445b015c3a fstring without copy
* re.c (reg_set_source): make source string frozen without
  copying.
* re.c (rb_reg_initialize_m): refactor initialization with
  encoding.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-04 08:38:06 +00:00
nobu 09c9110896 revert re.c in r53736
* re.c (rb_reg_initialize): must copy the source string content,
  it is not a static literal.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-04 06:46:28 +00:00
nobu 94c70c7d72 fstring_enc_new
* string.c (rb_fstring_enc_new, rb_fstring_enc_cstr): functions to
  make fstring with encoding.
* re.c (rb_reg_initialize): make fstring without copying.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-04 06:35:34 +00:00
duerst bb4f87127f * common.mk: Added Unicode data file SpecialCasing.txt to be additionally
downloaded (with Kimihito Matsui)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-04 05:42:35 +00:00
nobu 217ad664ab cgi/escape: Optimize CGI.escape
* cgi/escape/escape.c: Optimize CGI.escape performance by C ext
  for ASCII-compatible encodings.  [Fix GH-1238]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-04 03:39:12 +00:00
duerst 6ec7e30ce0 * common.mk: Introduce two variables (UNICODE_DATA_DIR and
UNICODE_SRC_DATA_DIR) to eliminate repetitions.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-04 02:54:02 +00:00
naruse 040ce05610 * string.c (str_new_frozen): if the given string is embeddedable
but not embedded, embed a new copied string. [Bug #11946]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-03 04:52:13 +00:00
nobu e14c9f1048 Fix typo on OpenSSL::PKey doc [ci skip]
* ext/openssl/ossl_pkey.c (Init_ossl_pkey): [DOC] Fix typo
  "encrypted" to "decrypted".  [Fix GH-1235]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-02 23:25:40 +00:00
nobu a43f2cbaa1 Fix Ripper.lex error in dedenting squiggly heredoc
* ext/ripper/lib/ripper/lexer.rb (on_heredoc_dedent): Fix
  Ripper.lex error in dedenting squiggly heredoc.  heredoc tree is
  also an array of Elem in the outer tree.  [Fix GH-1234]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-02 23:21:34 +00:00
naruse 7aefa7b89f * re.c (rb_reg_prepare_enc): use already compiled US-ASCII regexp
if given string is ASCII only.
  121.2s to 113.9s on my x86_64-freebsd10.2 Intel Core i5 661

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-02 17:38:00 +00:00
naruse 21daa56b2a * re.c: Introduce RREGEXP_PTR.
patch by dbussink.
  partially merge https://github.com/ruby/ruby/pull/497

* include/ruby/ruby.h: ditto.

* gc.c: ditto.

* ext/strscan/strscan.c: ditto.

* parse.y: ditto.

* string.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-02 04:39:44 +00:00
nobu 120c23edad ChangeLog: reword
* ChangeLog: reword "affect" as it is a verb.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-02 03:53:01 +00:00
hsbt 4e8b8c10dd * lib/rubygems/specification.rb: `coding` is affect only first line except
shebang.
* lib/rubygems/package.rb, lib/rubygems/package/*: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-02 00:11:34 +00:00
hsbt a21d403f21 * lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update rubygems-2.5.2.
It supports to enable frozen string literal and add `--norc` option for
  disable to `.gemrc` configuration.
  See 2.5.2 release notes for other fixes and enhancements.
  a8aa3bac72/History.txt (L3)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-01 12:43:26 +00:00
nobu c2e998d6a3 additional math operations
* test/drb/ut_large.rb (multiply, avg, median): add additional
  math operations to DRbLarge.  [Fix GH-1086]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-31 03:34:21 +00:00
nobu 8b9cd1dbb2 test for File#lstat.
* test/ruby/test_file_exhaustive.rb (test_lstat): Add lacking test
  for File#lstat.  [Fix GH-1231]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-31 03:20:22 +00:00
nobu 9286266137 standard_library.rdoc: fix typo [ci skip]
* doc/standard_library.rdoc: fix typo  [Fix GH-1230]
  Spelling mistakes -
  outputing > outputting
  publich > publish

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-31 03:16:40 +00:00
nobu 6ee8ec7069 vm_eval.c: fix hook call
* vm_eval.c (rb_check_funcall_with_hook): also should call the
  given hook before returning Qundef when overridden respond_to?
  method returned false.  [ruby-core:73556] [Bug #12030]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-30 06:19:13 +00:00
nobu ec943ac668 win32/file.c: drop garbage
* win32/file.c (rb_readlink): drop garbage after the substitute
  name, as rb_w32_read_reparse_point returns the expected buffer
  size but "\??\" prefix is dropped from the result.
* win32/win32.c (w32_readlink): ditto, including NUL-terminator.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-29 08:41:10 +00:00
usa 47f6196cf0 * win32/win32.c (fileattr_to_unixmode, rb_w32_reparse_symlink_p): volume
mount point should be treated as directory, not symlink.
  [ruby-core:72483] [Bug #11874]

* win32/win32.c (rb_w32_read_reparse_point): check the reparse point is
  a volume mount point or not.

* win32/file.c (rb_readlink): follow above change (but this pass won't
  be used).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-29 08:13:42 +00:00
kazu c0b13e292f fix a typo [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-29 08:01:01 +00:00
nobu 93eb95f0b9 Rename parameter name
* enum.c (enum_take_while, enum_drop_while): rename block
  parameter to obj, since they are generic objects.  [Fix GH-1226]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-29 07:18:10 +00:00
nobu 4f8245b703 erb.rb: fronzen-string-literal in comment [Fix GH-1229]
* lib/erb.rb (ERB::Compiler#detect_magic_comment): allow
  fronzen-string-literal in comment as well as encoding.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-29 05:16:29 +00:00
nobu 708a982cb4 erb.rb: duplicated magic comments [Fix GH-1229]
* lib/erb.rb (ERB#def_method): insert def line just before the
  first non-comment and non-empty line, not to leave duplicated
  and stale magic comments.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-29 05:14:31 +00:00
nobu c55ad90a6e erb.rb: frozen-string-literal safe
* lib/erb.rb (ERB#set_eoutvar): explicitly make mutable string as
  a buffer to make ERB work with --enable-frozen-string-literal.
  [ruby-core:73561] [Bug #12031]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-29 02:14:36 +00:00
hsbt 809d3770e6 * lib/net/http/header.rb: Warn nil variable on HTTP Header.
It caused to NoMethodError. [fix GH-952][fix GH-641] Patch by @teosz
* test/net/http/test_httpheader.rb: Added test for nil HTTP Header.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-29 01:46:02 +00:00
nobu 173e287ff9 socket.c: unlimited size hostname
* ext/socket/socket.c (sock_gethostname): support unlimited size
  hostname.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-28 08:32:44 +00:00
svn b6e761e647 * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-27 12:04:48 +00:00
hsbt b7b5692aea * test/-ext-/string/test_capacity.rb: Added missing library.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-27 12:04:47 +00:00
duerst a7c987968d * enc/unicode.c: Fixed bit mask in macro OnigCodePointCount
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-27 09:54:38 +00:00
duerst 415949faba * enc/unicode.c: Protect code point count by macro, in order to
be able to use the remaining bits for flags.
  (with Kimihito Matsui)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-27 08:55:40 +00:00
nobu 75687e0aff Fix doc with default value with GH-523
* lib/tempfile.rb (Tempfile#initialize): [DOC] the first parameter
  `basename` is optional and defaulted to an empty string since
  [GH-523].  [Fix GH-1225]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-27 07:35:34 +00:00
nobu 4df168074c Fix a Ruby-Doc comment for Array#dig
* array.c (rb_ary_dig): [DOC] fix the exception class to be raised
  when intermediate object does not have dig method.  TypeError
  will be raised now.  [Fix GH-1224]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-27 07:26:53 +00:00
kazu d0128a699a fix a typo [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-26 10:39:50 +00:00
nobu 7cf2a0a1b9 array.c: reword [ci skip]
* array.c (permute0, rpermute0): [DOC] Substitute indexes ->
  indices in documentation for consistency.  [Fix GH-1222]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-26 10:37:12 +00:00
normal 1282a4a895 fstring early for internal iseq
All of the strings created here eventually get converted to
fstrings when they are frozen into the iseq.  Prepare the
fstring early so we may reduce a one or two objects.

This is a very minor change, mainly for the '<main>' dedupe.

* compile.c (caller_location): use rb_fstring_cstr for "<compiled>"
  (it is converted to fstring anyways inside rb_iseq_new_with_opt)
* iseq.c (iseqw_s_compile): ditto
* iseq.c (rb_iseq_new_main): use rb_fstring_cstr for "<main>"
* vm.c (Init_VM): ditto, share with with above
* iseq.c (iseqw_s_compile_file): rb_fstring before rb_io_t->pathv
  share "<main>" with above
* vm.c (rb_binding_add_dynavars): fstring "<temp>" immediately

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-26 06:23:47 +00:00
nobu f4ca0739ec compile.c: fix tailcall optimization
* compile.c (iseq_peephole_optimize): don't apply tailcall
  optimization to send/invokesuper instructions with blockiseq.
  This is a follow-up to the changes in r51903; blockiseq is now
  the third operand of send/invokesuper instructions.
  [ruby-core:73413] [Bug #12018]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-26 06:14:59 +00:00
normal 667c0a3a8c Signal.list deduplicates keys
This allows us to reuse string objects used in symbols as well
as any string representations of signal names in source code.

* signal.c (sig_list): use fstring for hash key
* test/ruby/test_signal.rb (test_signal_list_dedupe_keys): added

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-26 05:33:28 +00:00
nobu a52be8fb8f signal.c: reserved signals
* signal.c (rb_f_kill): should immediately deliver reserved
  signals SIGILL and SIGFPE, ont only SIGSEGV and SIGBUS.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-26 04:09:31 +00:00
nobu 4378bd6628 Macro typo
* gc.c (RVALUE_PAGE_WB_UNPROTECTED): fix a typo of argument name.
  [Fix GH-1221]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-25 22:58:25 +00:00
normal afa7c15d6e fix build with VM_CHECK_MODE > 0
* ruby_assert.h (RUBY_ASSERT_WHEN): fix reference to macro name
* vm_core.h: include ruby_assert.h before using
  [ruby-core:73371]

This does not fix the test failure documented in [ruby-core:73371],
that is for later.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-25 08:34:00 +00:00
nobu dfca38eaa2 symbol.c: more informative error message
* symbol.c (sym_check_asciionly): more informative error message
  with the encoding name and the inspected content.
  [ruby-core:73398] [Feature #12016]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-25 06:56:26 +00:00
hsbt 390f087d87 * test/ruby/test_string.rb: added testcase for next!, succ and succ!
[fix GH-1213] Patch by @K0mAtoru

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-25 00:39:26 +00:00
hsbt 65793c9c17 * lib/webrick/httpservlet/filehandler.rb: fix documentation for namespace.
[fix GH-1219][ci skip] Patch by @leafac

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-25 00:33:17 +00:00
normal 0feaa041e7 vm_insnhelper.c (vm_check_if_namespace): tiny size reduction
Take advantage of "%+" modifier in the format string instead of
explicitly calling rb_inspect to reduce object size.

On x86 32-bit:

           text    data     bss     dec     hex filename
before: 2949572   12448   30680 2992700  2daa3c miniruby
after:  2949464   12448   30680 2992592  2da9d0 miniruby

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-24 10:36:16 +00:00
duerst 615d99b7e7 * common.mk: Simplifying Unicode data file download logic to make
it more reliable (including additional fix not in r53633) [Bug #12007]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-24 09:13:30 +00:00
nobu b58fac9a97 wait readable/writable
* ext/io/wait/wait.c (io_wait_readwrite): [EXPERIMENTAL] allow to
  wait for multiple modes, readable and writable, at once.  the
  arguments may change in the future.  [Feature #12013]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-24 07:55:05 +00:00
nobu be8b517f52 Add test for Array#keep_if
* test/ruby/test_array.rb (test_keep_if): Add test for
  Array#keep_if separate from Array#select!  [Fix GH-1218]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-23 13:31:51 +00:00
hsbt 4bfda5d951 * common.mk: revert r53633. It broke rubyci and travis.
https://travis-ci.org/ruby/ruby/builds/104259623

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-23 11:55:32 +00:00
shugo a0019b27e6 fix typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-23 11:19:22 +00:00
shugo 62b750bb55 * range.c (range_eqq): revert r11113 because rb_call_super() is
called in range_include() and thus r11113 doesn't work when the
  receiver Range object consists of non linear objects such as Date
  objects.
  [ruby-core:72908] [Bug #12003]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-23 11:16:09 +00:00
duerst 387e838c02 ChangeLog: Fixing wrong time on previous commit, and adding
previous commit message to svn [ci skip]

The message on the previous commit should have read:
common.mk: Simplifying Unicode data file download logic to make
it more reliable [Bug #12007]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-23 09:38:50 +00:00
duerst 0d3d8a8cda git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2016-01-23 09:32:44 +00:00
duerst 39988ff0ac * tool/downloader.rb: Fixed a logical error, improved documentation
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-23 07:30:32 +00:00
kazu 9608176fad fix a typo [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-23 05:19:42 +00:00
nobu a3f4fcb45c Use SVG Travis badge over PNG
* README.md: Use SVG Travis badge over PNG for better quality and
  devise support.  [Fix GH-1214] [Fix GH-1216]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-23 02:43:34 +00:00
nobu ba5a40fe7d Update documentation of CSV header converter
* lib/csv.rb: Update documentation of CSV header converter for
  r45498, [GH-575].  [Fix GH-1215]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-23 02:30:07 +00:00
nobu 4a01021002 vm_core.h: use RUBY_ASSERT
* vm_core.h (VM_ASSERT): use RUBY_ASSERT instead of rb_bug.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-22 08:37:36 +00:00
nobu 439224a590 RUBY_ASSERT
* error.c (rb_assert_failure): assertion with stack dump.
* ruby_assert.h (RUBY_ASSERT): new header for the assertion.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-22 08:33:55 +00:00
naruse 782fd488d7 * regparse.c (fetch_name_with_level): allow non word characters
at the first character.  [Feature #11949]

* regparse.c (fetch_name): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-21 16:09:09 +00:00
naruse 826f2ee306 * marshal.c (r_object0): honor Marshal.load post proc
value for TYPE_LINK.  by Hiroshi Nakamura <nahi@ruby-lang.org>
  https://github.com/ruby/ruby/pull/1204 fix GH-1204

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-21 08:36:01 +00:00
naruse 89ee8a557e * Makefile.in (update-rubyspec): fix r53208 like r53451.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-21 07:40:17 +00:00
usa c3944b2d1f * ChangeLog: typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-20 12:09:39 +00:00
usa 28efd93e18 * common.mk, Makefile.in: update-config.files is only for Unix
platforms.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-20 12:00:14 +00:00
nobu 131f699d98 ChangeLog: fix commit log of r53599
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-20 08:16:39 +00:00
nobu c23cb3adbe extlibs.rb: add --cache option
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-20 08:14:24 +00:00
duerst 3dcdb2c3b7 * common.mk: Added Unicode data file CaseFolding.txt to be additionally
downloaded (with Kimihito Matsui)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-19 08:04:21 +00:00
sho-h d4ad4d2db7 * lib/shell.rb (Shell.debug_output_exclusive_unlock): remove
because Mutex#exclusive_unlock was already deleted. [fix GH-1185]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-19 02:03:50 +00:00
hsbt 389a84fdbf * vm_method.c: fix grammar in respond_to? warning.
[fix GH-1047]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-19 00:39:12 +00:00
nobu 45acdf4df4 parse.y: escaped newline in dedenting heredoc
* parse.y (parser_here_document): an escaped newline is not an
  actual newline, and the rest part should not be dedented.
  [ruby-core:72855] [Bug #11989]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-18 05:37:48 +00:00
hsbt c626cb6904 * test/ruby/test_string.rb: Added extra testcase for test_rstrip_bang
and test_lstrip_bang. [fix GH-1178] Patch by @Matrixbirds

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-18 03:05:20 +00:00
hsbt 4c6713f374 * string.c: fix a typo. [fix GH-1202][ci skip] Patch by @sunboshan
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-18 02:48:24 +00:00
naruse 9bed6e8e8e * configure.in: improve ICC (Intel C Compiler) support.
* configure.in (CXX): The name of icc's c++ compiler is `icpc`.

* configure.in (warnings): Add `-diag-disable=2259` to suppress
  noisy warnings: "non-pointer conversion from "..." to "..." may
  lose significant bits".

* configure.in (optflags): Add `-fp-model precise` like -fno-fast-math.

* lib/mkmf.rb: icc supports -Werror=division-by-zero
  and -Werror=deprecated-declarations, but doesn't support
  -Wdivision-by-zero and -Wdeprecated-declarations.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-17 12:20:15 +00:00
duerst e580847ce8 * string.c: Any kind of option is now taking the new code path for
upcase/downcase/capitalize/swapcase. :lithuanian can be used for
  testing if no specific option is desired.
* test/ruby/enc/test_case_mapping.rb: Adjusted to above.
  (with Kimihito Matsui)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-17 11:40:46 +00:00
duerst f307d1fe21 * enc/unicode.c: Fixed a logical error and some comments.
* test/ruby/enc/test_case_mapping.rb: Made tests more general.
  (with Kimihito Matsui)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-17 11:10:45 +00:00
duerst 959bbb6f72 * enc/unicode.c: Removed artificial expansion for Turkic,
added hand-coded support for Turkic, fixed logic for swapcase.
* string.c: Made use of new case mapping code possible from upcase,
  capitalize, and swapcase (with :lithuanian as a guard).
* test/ruby/enc/test_case_mapping.rb: Adjusted for above.
  (with Kimihito Matsui)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-17 08:42:16 +00:00
nobu 0bc5341690 option.c: single byte boolean
* ext/socket/option.c (sockopt_bool): relax boolean size to be one
  too not only sizeof(int).  Winsock getsockopt() returns a single
  byte as a boolean socket option.  [ruby-core:72730] [Bug #11958]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-17 06:31:36 +00:00
nobu f918d2b8e2 Add a test case for ENV#select_bang,keep_if
* test/ruby/test_env.rb: [Fix GH-1201]
  * Extract test code for ENV#keep_if from ENV#select_bang
  * Add a test case for ENV#select_bang,keep_if

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-17 05:43:40 +00:00
nobu ddd40c73b6 Add a test case for ENV#reject_bang,delete_if
* test/ruby/test_env.rb: [Fix GH-1201]
  * Extract test code for ENV#delete_if from ENV#reject_bang
  * Add a test case for ENV#reject_bang,delete_if

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-17 05:43:04 +00:00
nobu b25ad0daaa option.c: make error messages consistent
* ext/socket/option.c (check_size): extract a macro to check
  binary data size, with a consistent message.
* ext/socket/option.c (sockopt_byte): fix error message,
  sizeof(int) differs from sizeof(unsigned char) in general.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-17 05:41:01 +00:00
kazu 361d51a7ee fix typos [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-16 14:53:06 +00:00
nobu c8348d0cfa parse.y: should not deent concatenated string
* parse.y (xstring): reset heredoc indent after dedenting,
  so that following string literal would not be dedented.
  [ruby-core:72857] [Bug #11990]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-16 12:16:59 +00:00
duerst c12af76763 * enc/unicode.c: Artificial mapping to test buffer expansion code.
* string.c: Fixed buffer expansion logic.
* test/ruby/enc/test_case_mapping.rb: Tests for above.
(with Kimihito Matsui)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-16 08:24:58 +00:00
hsbt d2076446ed * ext/openssl/lib/openssl/pkey.rb: Added 2048 bit DH parameter.
* test/openssl/test_pkey_dh.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-16 07:51:24 +00:00
hsbt 219467abde * enc/unicode.c: fix implicit conversion error with clang. fixup r53548.
* string.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-16 01:51:58 +00:00
hsbt 203e604f46 * common.mk: test-sample was changed to test-basic.
[Feature #11982][ruby-core:72823]
* basictest/runner.rb: ditto. rename from tool/rubytest.rb.
* basictest/test.rb: ditto. rename from sample/test.rb.
* defs/gmake.mk: picked from r53540
* sample/test.rb: backword compatibility for chkbuild.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-16 01:37:47 +00:00
duerst be897c2507 * string.c, enc/unicode.c: New code path as a preparation for Unicode-wide
case mapping. The code path is currently guarded by the :lithuanian
  option to avoid accidental problems in daily use.
* test/ruby/enc/test_case_mapping.rb: Test for above.
* string.c: function 'check_case_options': fixed logical errors

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-16 01:24:03 +00:00
ngoto 5df321fb1d * regint.h (PLATFORM_UNALIGNED_WORD_ACCESS): The value of
UNALIGNED_WORD_ACCESS should be used to determine whether
  unaligned word access is allowed or not. After this commit,
  ./configure CPPFLAGS="-DUNALIGNED_WORD_ACCESS=0" disables
  unaligned word access even on platforms that support the feature.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-15 11:25:29 +00:00
naruse e0ea641755 Revert "* common.mk: test-sample was changed to test-basic."
This reverts r53537.
Fix chkbuild first.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-15 11:05:51 +00:00
nobu 0d75b7f99e parse.y: should not deent concatenated string
* parse.y (string1): reset heredoc indent fore each string leteral
  so that concatenated string would not be dedented.
  [ruby-core:72857] [Bug #11990]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-15 07:12:46 +00:00
hsbt 17238bce22 * common.mk: test-sample was changed to test-basic.
[Feature #11982][ruby-core:72823]
* basictest/runner.rb: ditto. rename from tool/rubytest.rb.
* basictest/test.rb: ditto. rename from sample/test.rb.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-15 00:25:46 +00:00
naruse aa90e3b859 * lib/uri/generic.rb (URI::Generic#to_s): change encoding to
UTF-8 as Ruby 2.2/ by Koichi ITO <koic.ito@gmail.com>
  https://github.com/ruby/ruby/pull/1188 fix GH-1188

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-14 11:20:24 +00:00
nobu 92e803c9c8 variable.c: matched backrefs only
* variable.c (rb_f_global_variables): add matched back references
  only, as well as defiend? operator.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-14 08:36:49 +00:00
nobu 1301d1f5bc sprintf.c: exact number
* sprintf.c (rb_str_format): format exact number more exactly.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-14 07:12:42 +00:00
hsbt 55cb1b5e70 * Remove 512-bit DH group. It's affected by LogJam Attack.
https://weakdh.org/
  [fix GH-1196][Bug #11968][ruby-core:72766]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-14 06:09:19 +00:00
nobu 7e825eeefc variable.c: $1..$9 in global_variables
* variable.c (rb_f_global_variables): add $1..$9 only if $~ is
  set.  fix the condition removed at r14014.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-14 02:45:03 +00:00
hsbt 7cb5b7dd23 * .travis.yml: removed commented-out code.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-13 08:22:18 +00:00
hsbt 6cea22b5d6 * .travis.yml: removed osx code. follow up with r53517
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-13 08:15:39 +00:00
nobu 22121544e1 iseq.c: mark parent iseq
* iseq.c (rb_iseq_mark): mark parent iseq to prevent dynamically
  generated iseq by eval from GC.  [ruby-core:72620] [Bug #11928]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-13 07:56:51 +00:00
normal 244916d43b resolve class name earlier and more consistently
This further avoids class name resolution issues which came
about due to relying on hash table ordering before r53376.

Pre-caching the class name when it is never used raises memory
use, but the overall gain from moving away from st still gives
us a small gain.  Reverting r53376 and this patch and testing with
"valgrind -v ./ruby -rrdoc -eexit" on x86 (32-bit) shows:

before:
    in use at exit: 1,662,239 bytes in 25,286 blocks
  total heap usage: 49,514 allocs, 24,228 frees, 6,005,561 bytes allocated

after, with this change:
    in use at exit: 1,646,529 bytes in 24,572 blocks
  total heap usage: 48,891 allocs, 24,319 frees, 6,003,921 bytes allocated

* class.c (Init_class_hierarchy): resolve name for rb_cObject ASAP
* object.c (rb_mod_const_set): move name resolution to rb_const_set
* variable.c (rb_const_set): do class resolution here
  [ruby-core:72807] [Bug #11977]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-12 19:26:07 +00:00
nobu 05f1caa1cf Fix typo [ci skip]
* man/ruby.1: fix double word typo.  [Fix GH-1194]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-12 15:37:42 +00:00
nobu 1b39a6e539 iseq.c: mark parents of wrapped iseq
* iseq.c (iseqw_mark): as wrapped iseq is isolated from the call
  stack, it needs to take care of its parent and ancestors, so
  that they do not become orphans.  [ruby-core:72620] [Bug #11928]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-12 15:17:19 +00:00
eregon 9efd4dbe73 * common.mk: update URL and name for the Ruby spec suite.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-12 12:05:41 +00:00
sorah 09cb46b921 correction to proper word
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-12 11:23:05 +00:00
sorah f425e0fc2b * lib/forwardable.rb: Convert given accessors to String.
r53381 changed to accept only Symbol or String for accessors, but
  there are several rubygems that pass classes (e.g. Array,
  Hash, ...) as accessors. Prior r53381, it was accepted because Class#to_s
  returns its class name. After r53381 given accessors are checked
  with define_method, but it accepts only Symbol or String, otherwise
  raises TypeError.

      def_delegator Foo, :some_method

  This change is to revert unwanted incompatibility. But this behavior
  may change in the future.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-12 11:19:25 +00:00
duerst 4a5d3572e6 string.c: made a variable name more grammatically correct
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-12 09:42:07 +00:00