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

8083 Коммитов

Автор SHA1 Сообщение Дата
nobu 058823440d test_autoload.rb: use class_eval
* test/ruby/test_autoload.rb (add_autoload): use class_eval
  instead of string eval.

* test/ruby/test_autoload.rb (remove_autoload_constant): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-18 09:41:21 +00:00
nobu c4d216793b intern.h: rb_f_notimplement for ext on Windows
* include/ruby/intern.h (rb_f_notimplement): should not respond to
  not-implemented methods.  as the address inside a DLL and the
  imported address are different on Windows, use an exported
  variable to share the same address.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-18 06:31:42 +00:00
shugo 7be5169804 * lib/monitor.rb (mon_try_enter, mon_enter): should reset @mon_count
just in case the previous owner thread dies without mon_exit.
  [fix GH-874] Patch by @chrisberkhout

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-18 04:56:22 +00:00
nobu 47349e8701 notimplement: rename
* ext/-test-/notimplement, test/-ext-/test_notimplement.rb:
  rename from bug-3662.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-17 14:47:36 +00:00
nobu 932e916b9e numeric.c: Numeric#positive? and Numeric#negative?
* numeric.c (num_positive_p, num_negative_p): add methods
  Numeric#positive? and Numeric#negative?.
  [ruby-core:69173] [Feature #11151]
* numeric.c (flo_positive_p, flo_negative_p): specialiazed
  functions for Float.
* complex.c (Init_Complex): Complex do not have positive? and
  negative? methods

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-17 06:01:47 +00:00
nobu 1fbf1f7552 test_numeric.rb: separate dummy classes
* test/ruby/test_numeric.rb: use separate dummy classes for each
  test cases.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-17 05:59:58 +00:00
normal 8ff35b816a ext/socket/init.c: use SOCK_NONBLOCK if available
This saves a system call by allowing us to use SOCK_NONBLOCK in
Linux when accept4 is available.

Note: I do not agree accept_nonblock should always make accepted
sockets non-blocking, and will propose a future API to allow
controlling whether accepted sockets are non-blocking or not
regardless of how they were created.

* ext/socket/init.c (cloexec_accept): support nonblock flag and
  use SOCK_NONBLOCK if possible
* ext/socket/init.c (rsock_s_accept_nonblock): update cloexec_accept call
* ext/socket/init.c (accept_blocking): ditto for blocking
* test/socket/test_nonblock.rb: check nonblock? on accepted socket
  [Feature #11138]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-17 05:56:07 +00:00
nobu a9ca74cd70 default colors
* bootstraptest/runner.rb, sample/test.rb, test/lib/test/unit.rb:
  shared the default colors from test/colors file.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-17 00:50:11 +00:00
nobu 75a865406f reset colors
* bootstraptest/runner.rb, sample/test.rb, test/lib/test/unit.rb:
  reset for each colors.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-17 00:50:02 +00:00
tenderlove 1fc214c04d * load.c (loaded_feature_path): stop returning false negatives for
filenames which are trailing substrings of file extensions.  For
  example, 'b', which a trailing substring of ".rb" should not return
  false. [Bug #11155][ruby-core:69206]

* test/ruby/test_autoload.rb: test for fix

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-16 19:02:38 +00:00
tenderlove d7188cc95c fix test failures introduced in r50494
This commit changes some of the `require` tests to run *without*
rubygems enabled.  Those particular tests were removing rubygems from
$LOAD_PATH.  These tests assert that a `LoadError` is raised.
Unfortunately, since RubyGems was enabled by default and was not fully
loaded, the load error actually originated from RubyGems, *not* from
where the tests intended.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-16 15:02:41 +00:00
xibbar a4344cb5b4 * lib/cgi/cookie.rb: Implement HttpOnly flag for cookies.
[fix GH-887] Patch by @martinpovolny

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-14 23:27:01 +00:00
tenderlove cd465d552c * variable.c: Change autoload to call `require` through Ruby rather
than directly calling `rb_require_safe`.  This allows things like
  RubyGems to intercept file loading done though `autoload`.
  [Feature #11140]

* test/ruby/test_autoload.rb: Test for change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-14 21:57:33 +00:00
sorah 71588d17e5 * enum.c (enum_grep_v, grep_i, grep_iter_i, Init_enum):
Implement Enumerable#grep_v.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-14 10:42:42 +00:00
nobu 60730d91ce parse.y: refine message for gvar w/o identitirs
* parse.y (parse_gvar): separate message for gvar without
  non-space characters from message for invalid identitirs.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-13 02:13:43 +00:00
nobu c3cc91f1b7 test_parse.rb: fix variable name
* test/ruby/test_parse.rb (test_dstr_disallowed_variable): fix
  duplicate variable name to be tested.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-13 02:10:29 +00:00
glass 95f54fb019 * enum.c (enum_to_a): fix incompatibility introduced in r50457.
[Bug #11130]

* test/ruby/test_enum.rb: test for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-12 13:24:53 +00:00
glass d88957abad * ext/zlib/zlib.c (rb_gzreader_external_encoding):
define GzipReader#external_encoding.
  [Bug #10900]

* test/zlib/test_zlib.rb: test for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-10 03:43:22 +00:00
glass 0c14c3ab0b * ext/win32ole/win32ole_variant.c: fix typo "indicies".
the patch is from davydovanton <antondavydov.o at gmail.com>.
  [fix GH-892]

* lib/rubygems/indexer.rb: ditto.

* test/rubygems/test_gem_indexer.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-10 03:01:18 +00:00
glass f64ac5d4cd * string.c (rb_str_crypt): Raise ArgumentError when
string passed to String#crypt contains null.
  the patch is from jrusnack <jrusnack at redhat.com>.
  [Bug #10988] [fix GH-853]

* test/ruby/test_string.rb: test for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-10 02:49:01 +00:00
nobu fb684ba4c2 test_matrix.rb: Refactor on Matrix#determinant
* test/matrix/test_matrix.rb (test_determinant): refactor test on
  Matrix#determinant, by merging with test_det for an alias method
  det.  [Fix GH-897]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-08 13:57:27 +00:00
shugo f954f0d840 * lib/net/imap.rb (body_ext_mpart): should work even if body-fld-dsp
is omitted.  [ruby-core:69093] [Bug #11128]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-08 06:46:18 +00:00
nobu bd872a544c vm_eval.c: resolve refined method entry
* vm_eval.c (rb_method_call_status): resolve refined method entry
  to check if undefined.  [ruby-core:69064] [Bug #11117]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-08 03:11:35 +00:00
nobu 93ce79dc34 test/excludes: expensive tests
* test/excludes/TestConst.rb: skip very expensive test.

* test/excludes/TestThread.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-06 22:46:52 +00:00
nobu a870f4fcfd vm_eval.c: undefined refined check_funcall
* vm_eval.c (rb_method_call_status): undefined refined method is
  not callable unless using.  [ruby-core:69064] [Bug #11117]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-06 13:49:57 +00:00
nobu b0616346f8 range.c: covered for linear objects
* range.c (linear_object_p, range_include): test if covered for
  linear objects.  [ruby-core:69052] [Bug #11113]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-03 01:02:15 +00:00
nobu 4d12807e30 parse.y: %-string cannot be a label
* parse.y (parser_yylex): %-string cannot be a label even if
  terminated by single/double quotes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-30 14:36:19 +00:00
nobu 7132479960 compile.c: disallow private readers
* compile.c (iseq_compile_each): revert r46873 and r46875, not to
  allow to execute private readers by pretending op assign.
  [ruby-core:68984] [Bug #11096]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-30 10:51:13 +00:00
nobu fd0e9d2580 parse.y: push cmdarg_stack
* parse.y (lambda): push and reset cmdarg_stack in lambda body.
  [ruby-core:69017] [Bug #11107]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-30 07:22:19 +00:00
nobu 5d071fe381 cookie.rb: trailing comma
* lib/cgi/cookie.rb: add trailing comma for further lines.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-29 13:22:34 +00:00
nobu c2a04d87d0 vm_eval.c: allow symbols to instance_eval/exec
* vm_eval.c (rb_obj_instance_eval, rb_obj_instance_exec): allow
  symbols to just instance_eval/exec, execept for definition of
  singletons.  [ruby-core:68961] [Bug #11086]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-23 02:35:58 +00:00
gogotanaka 85147e903a * test/ruby/test_object.rb: add tests for Kernel#String and Kernel#Array.
[fix GH-879][fix GH-880] Patch by @yui-knk

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-22 03:48:23 +00:00
headius 2d1f3ed151 * test/ruby/test_m17n_comb.rb: test_str_crypt split into strict
and non-strict versions to allow masking out non-strict when
  glibc version cannot be determined (#11045).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-21 18:44:10 +00:00
hsbt 4bd7276247 * test/ruby/test_object.rb: renamed tests to explicitly class name.
[fix GH-877] Patch by @yui-knk

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-21 11:46:07 +00:00
nobu 191c8d9e13 test_enum.rb: use assert_warning
* test/ruby/test_enum.rb (test_slice_before): use assert_warning
  defined in test/lib/envutils.rb.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-20 02:44:59 +00:00
normal b88296be43 connect_nonblock(..., exception: false) does not raise EISCONN
* ext/socket/socket.c (sock_connect_nonblock): do not raise EISCONN
  [ruby-core:68926] [Feature #11072]
* test/socket/test_nonblock.rb: check non-EISCONN on 2nd connect

This is to reduce exceptions for code which issues a
(IMHO, unnecessary) second connect() syscall.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-20 02:11:10 +00:00
nobu adfeb95c87 hash.c: check env vars encoding
* hash.c (get_env_cstr): environment variables must be ASCII
  compatible, as dummy encodings and wide char encodings are
  unsupproted now.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-19 01:42:57 +00:00
nobu b38c0b7974 parser.rl: rb_enc_raise
* ext/json/parser/parser.rl: raise with messages in UTF-8
  encoding.  [ruby-core:67386] [Bug #10705]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-18 06:19:52 +00:00
nobu 26fa27fe12 string.c: clear NOFREE flag at embedding
* string.c (STR_SET_EMBED): clear NOFREE flag at embedding as
  embedded strings no longer refer static strings.
  [ruby-core:68436] [Bug #10942]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-17 02:58:37 +00:00
nobu 982a9d8e91 marshal.c: class name encoding
* marshal.c (r_object0): preserve the encoding of the class name
  in an error message, in the case of USRMARSHAL without
  marshal_load method.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-16 14:28:29 +00:00
nobu 0ea135d177 marshal.c: class name encoding
* marshal.c (r_object0): preserve the encoding of the class name
  in an error message, in the case of USERDEF without _load
  singleton method.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-16 14:25:33 +00:00
nobu 53e4fb8c80 marshal.c: class name encoding
* marshal.c (r_object0): preserve the encoding of the class name
  in an error message, in the case of no _load_data method.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-16 14:25:19 +00:00
nobu bdf16df33a marshal.c: class name encoding
* marshal.c (w_object): preserve the encoding of the class name in
  an error message, in the case of no _dump_data method.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-16 12:46:07 +00:00
nobu 2c1c5570e8 marshal.c: class name encoding
* marshal.c (w_object): preserve the encoding of the class name in
  an error message.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-16 11:43:37 +00:00
nobu c5e9beac25 thread.c: class name encoding
* thread.c (thread_s_new): preserve the encoding of the class name
  in an error message.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-16 08:29:21 +00:00
akr 3024fc235a * test/lib/envutil.rb (File.mkfifo): Defined using mkfifo command.
* test/ruby/test_io.rb: Ditto.

* test/ruby/test_file_exhaustive.rb: Use File.mkfifo.

* test/ruby/test_process.rb: Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-13 13:46:10 +00:00
nagachika 599bfa7233 * ext/openssl/lib/openssl/ssl.rb: stricter hostname verification
following RFC 6125. with the patch provided by Tony Arcieri and
  Hiroshi Nakamura [ruby-core:61545] [Bug #9644]
* test/openssl/test_ssl.rb: add tests for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-13 13:09:18 +00:00
hsbt 2e4f0af00f * ext/json/*, test/json/*: Reverted r50231. Because it's not works with
cross-compile environment.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 08:36:37 +00:00
nobu 7b14512bee test_io_wait.rb: no EOF test
* test/io/wait/test_io_wait.rb (test_wait_eof): just test
  timeout.  follow r50263.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 06:46:28 +00:00
nobu ee725321b6 parse.y: null by syntax error
* parse.y (arg): fix segfault by null caused by syntax error.
  [ruby-core:68851] [Bug #10957]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 06:35:02 +00:00