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

39415 Коммитов

Автор SHA1 Сообщение Дата
hsbt e398e64ad7 * lib/matrix.rb: added documentation for Matrix#empty and Matrix#/
[Feature #10070][ruby-dev:48433] Patch by @gogotanaka

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-21 08:29:32 +00:00
ko1 f6e9524026 * proc.c: rename functions.
* method_get_def() -> method_def()
  * method_get_iseq() -> method_def_iseq()
  * method_get_cref() -> method_cref()



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-21 08:03:58 +00:00
ko1 1cc326a351 fix ChangeLog, too
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-21 08:02:31 +00:00
ko1 c0ce9a7227 commit miss. iseq.h should be commit with last commit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-21 08:01:59 +00:00
ko1 0dba10a47f * proc.c (rb_method_get_iseq): rename to rb_method_iseq.
* iseq.c: catch up this fix.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-21 07:54:44 +00:00
hsbt 0b5ecba435 * lib/net/telnet.rb: gemify net-telnet.
[Feature #11083]
* gems/bundled_gems: added net-telnet to bundled gems.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-21 06:46:14 +00:00
zzak 32a5a098e3 * vm_method.c: Remove private attribute warning [Bug #10967]
Patch by @spastorino [Fixes GH-849]
  https://github.com/ruby/ruby/pull/849

* test/ruby/test_module.rb: Update test for changes


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-21 06:40:27 +00:00
nobu ac9d6b050b digest.c: GC guard
* ext/digest/digest.c (hexencode_str_new, rb_digest_base_update):
  prevent argument strings from GC.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-21 05:03:55 +00:00
ko1 8147bd1e49 * proc.c (method_proc): rename to method_to_proc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-21 02:00:31 +00:00
nobu cac2c6d331 Fixes for grammar and style [ci skip]
* io.c (rb_f_select): [DOC] Fixes for grammar and style.
  [Fix GH-906]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-21 01:51:51 +00:00
normal 4b0987a629 variable.c: generic_iv_tbl is unavoidable
Even miniruby creates one generic ivar (plain "ruby" creates 9),
so there's no point in lazily allocating the table.

I dumped generic ivar counts with the following trivial patch:

  --- a/variable.c
  +++ b/variable.c
  @@ -24,6 +24,10 @@ static void check_before_mod_set(VALUE, ID, VALUE, const char *);
   static void setup_const_entry(rb_const_entry_t *, VALUE, VALUE, rb_const_flag_t);
   static int const_update(st_data_t *, st_data_t *, st_data_t, int);
   static st_table *generic_iv_tbl;
  +__attribute__((destructor)) static void count_genivar(void)
  +{
  +    fprintf(stderr, "genivars: %zu\n", (size_t)generic_iv_tbl->num_entries);
  +}

   void
   Init_var_tables(void)

* variable.c (Init_var_tables): init generic_iv_tbl
  (rb_generic_ivar_table, generic_ivar_get, generic_ivar_set,
   generic_ivar_defined, generic_ivar_remove,
   rb_mark_generic_ivar, givar_i, rb_mark_generic_ivar_tbl,
   rb_free_generic_ivar, rb_copy_generic_ivar, rb_ivar_foreach,
   rb_ivar_count): remove checks for uninitialize generic_iv_tbl
  [ruby-core:69155] [Feature #11146]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-21 00:15:00 +00:00
nobu ca61b4c4e0 vm.c: vm_invoke_bmethod
* vm.c (vm_invoke_bmethod): bmethod does not need EXEC_TAG as it
  does not set safe level.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-20 22:03:06 +00:00
svn a65ee87bf2 * 2015-05-21
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-20 19:12:19 +00:00
ko1 08f923bdc1 * iseq.c (exception_type2symbol): show correct bug message.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-20 19:11:47 +00:00
mame 7fc7651fc6 * lib/base64.rb: Fix rdoc-formatting for padding argument.
[fix GH-905][ci skip] Patch by @davydovanton

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-20 14:24:58 +00:00
nobu fdb957925f ruby.h: warn old names
* include/ruby/ruby.h (rb_data_typed_object_alloc),
  (rb_data_object_alloc): warn use of old names.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-20 05:09:00 +00:00
nobu 68426106a9 ruby.h: DEPRECATED_BY
* include/ruby/ruby.h (DEPRECATED_BY): fallback definition without
  additional messages.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-20 04:21:08 +00:00
nobu 408885c891 configure.in: DEPRECATED_BY
* configure.in (DEPRECATED_BY): deprecate warning with preferable
  alternative.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-20 04:16:46 +00:00
nobu 814b83918e configure.in: attribute arguments
* configure.in (RUBY_FUNC_ATTRIBUTE): allow attribute arguments in
  the macro.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-20 04:15:40 +00:00
nobu 50732b7b6e configure.in: pop macro
* configure.in (RUBY_FUNC_ATTRIBUTE): pop definition of macro
  `attrib_code`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-20 04:13:05 +00:00
naruse dd9265ecf3 * vm_dump.c (rb_print_backtrace): return value of libexec's backtrace
is size_t, so simply cast as int.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-20 02:24:17 +00:00
svn 9e80fb0751 * 2015-05-20
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-20 00:51:16 +00:00
hsbt 360c741abe added contributor name
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-20 00:50:30 +00:00
nobu 87e2c106a8 ChangeLog: fix typo
* ChangeLog: fix typo, "srouce" to "source".
  [ruby-core:69219] [Bug #11159]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-19 09:56:16 +00:00
nobu b813198627 iseq.c: check srouce type
* iseq.c (rb_iseq_compile_with_option): check srouce type, must be
  an IO or a String.  [ruby-core:69219] [Bug #11159]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-19 09:54:44 +00:00
hsbt cdea1553b3 * lib/benchmark.rb: Update Benchmark documentation and formatting.
[fix GH-903][ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-19 08:15:07 +00:00
nobu 59b089bd09 numeric.c: return true
* numeric.c (num_positive_p): return true instead of Fixnum 0.
  [ruby-core:69173] [Feature #11151]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-19 04:13:22 +00:00
nobu b4e5bff89d numeric.c: Bignum 0 is not positive
* numeric.c (num_positive_p): should false on Bignum 0.
  http://twitter.com/rafaelfranca/status/600509783427391488
  [ruby-core:69173] [Feature #11151]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-19 04:10:12 +00:00
naruse 8c7310e713 * lib/uri/rfc2396_parser.rb (initialize_pattern):
URI::Generic.build should accept port as a string.
  pattern[:PORT] is not defined for long.
  by Dave Slutzkin <daveslutzkin@fastmail.fm>
  https://github.com/ruby/ruby/pull/804 fix GH-804

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-19 02:34:47 +00:00
nobu 1443776cc9 ruby.h: add old names
* include/ruby/ruby.h (rb_data_typed_object_alloc),
  (rb_data_object_alloc): add old names for source level backward
  compatibilities.
* gc.c (rb_data_object_alloc, rb_data_typed_object_alloc): add
  aliases for binary level backward compatibilities.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-19 02:18:49 +00:00
nobu 11c8b83ab6 ruby.h: cast for C++
* include/ruby/ruby.h (Data_Make_Struct0): needs function pointer
  casts to fix function overloading in C++.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-19 00:54:46 +00:00
svn 0e55cbc2a1 * 2015-05-19
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-19 00:44:27 +00:00
nobu 356baf95db ruby.h: cast for C++
* include/ruby/ruby.h (Data_Make_Struct0, TypedData_Make_Struct0):
  explicit cast from void* is necessary as implicit cast is
  disallowed in C++.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-19 00:43:58 +00:00
kazu 53411d3ec5 fix a typo [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-18 13:30:54 +00:00
nobu 0a933cf3d4 nonblock.c: just yield if the flag is not changed
* ext/io/nonblock/nonblock.c (io_nonblock_set): return whether
  nonblock flag was changed.

* ext/io/nonblock/nonblock.c (rb_io_nonblock_block): nothing to
  restore but just yield unless nonblock flag is changed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-18 10:30:36 +00:00
nobu 903c0f55e9 test_nonblock.rb: refine failure message
* test/socket/test_nonblock.rb (test_accept_nonblock): refine
  assertion for better failure message.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-18 09:41:37 +00:00
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 bd40bd3393 gc.c: remove ifdef
* gc.c (obj_info): remove needless ifdef, and adjust indent.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-18 09:03:48 +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
svn 15b9748934 * 2015-05-18
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-18 04:56:34 +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
normal 29a914ff2e lib/webrick/utils.rb: simplify by avoiding fcntl
IO#nonblock= and IO#close_on_exec= methods are simpler-to-use
and potentially more portable to for future OSes.
IO#nonblock= and IO#close_on_exec= are also smart enough to avoid
redundantly setting flags so a syscall may be avoided.

These methods could probably be removed entirely and inlined, but
it's unclear if there is 3rd-party code which relies on them.

* lib/webrick/utils.rb (set_non_blocking): use IO#nonblock=
* (set_close_on_exec): use IO#close_on_exec=
  [Feature #11136]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-17 08:22:11 +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
nobu 8953b97d72 numeric.c: compare_with_zero
* numeric.c (compare_with_zero): raise TypeError when not
  comparable with 0.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-17 05:59:36 +00:00
normal ce34a90fb5 lib/webrick/server.rb: avoid redundant fcntl call
Sockets are close-on-exec by default since Ruby 2.0, so it
is redundant to set it again.

* lib/webrick/server.rb (accept_client): avoid redundant fcntl call
  [Feature #11137]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-17 05:59:08 +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