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

39728 Коммитов

Автор SHA1 Сообщение Дата
akr 07a296cead * ext/rbconfig/sizeof/extconf.rb: Check __float80.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-17 11:24:00 +00:00
nobu e521b916ec util.c: fix off-by-one error
* util.c (ruby_scan_digits): fix the return length off-by-one
  error when the length is given and the last char is a digit.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-17 07:21:41 +00:00
usa aabe6b46a8 * ChangeLog: typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-17 06:25:05 +00:00
usa f9fca8316a * safe.rb (safe_setter): of course, don't have to warn the limitation of
$SAFE=3 after it's removed.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-17 06:17:21 +00:00
hsbt bbf440c90b * include/ruby/ruby.h: $SAFE=3 is now obsolete.
* ext/socket/init.c, ext/socket/socket.c, ext/socket/tcpsocket.c
  ext/socket/udpsocket.c, gc.c, object.c, re.c, safe.c: removed code
  for $SAFE=3
* bootstraptest/test_method.rb, test/erb/test_erb.rb, test/ruby/test_dir.rb
  test/ruby/test_file.rb, test/ruby/test_method.rb, test/ruby/test_regexp.rb
  test/ruby/test_thread.rb: remove tests for $SAFE=3

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-17 05:29:51 +00:00
hsbt 3759dfa23e * ChangeLog: added contibutor name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-17 03:13:42 +00:00
hsbt 96fb819676 * lib/csv.rb: accept to use Range object for row selection.
[Feature #11267][ruby-dev:49091]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-17 01:58:34 +00:00
nobu e5471cbe63 servlet.rb: requires json
* lib/rdoc/servlet.rb (documentation_search, root_search):
  requires json for JSON.dump and fix sporadic failures due to
  the loading order.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-17 00:50:15 +00:00
nobu db577345ca mkmf.rb: suppress warnings
* lib/mkmf.rb (try_func): suppress implicit-function-declaration
  warnings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-17 00:46:30 +00:00
svn 3c5f42a90a * 2015-06-17
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-17 00:13:05 +00:00
nobu 71ebbe334d mkmf.rb: suppress warnings
* lib/mkmf.rb (try_func, try_var): suppress
  unused-but-set-variable warnings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-17 00:12:30 +00:00
kazu af68619a6c fix unbalanced square brackets
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-16 14:40:20 +00:00
kazu 02f2b5eff6 fix a typo [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-16 14:40:00 +00:00
akr 96593ece29 * ext/rbconfig/sizeof/extconf.rb: Check several types defined in C99
and x86_64 ABI.

* template/sizes.c.tmpl: Relax a pattern for types.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-16 10:22:16 +00:00
nobu e4d0f54b1b date_parse.c: use ALLOCV
* ext/date/date_parse.c (s3e, date_zone_to_diff, parse_ddd_cb):
  use ALLOCV instead of ALLOCA get rid of stack overflow.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-16 09:46:06 +00:00
nobu d1496e8b8c date_strptime.c: use ALLOCV
* ext/date/date_strptime.c (read_digits): use ALLOCV instead of
  ALLOCA get rid of stack overflow.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-16 09:45:50 +00:00
nobu c2c81723a4 test_nonblock.rb: use assert_predicate
* test/socket/test_nonblock.rb (test_recv_nonblock_no_exception),
  (test_recvfrom_nonblock_no_exception): use assert_predicate for
  failure messages.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-16 09:29:17 +00:00
nobu 85d5df5528 test_nonblock.rb: fix failure on OSX
* test/socket/test_nonblock.rb (test_recvfrom_nonblock_no_exception):
  no destination to already connected socket.  fix failure on OSX.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-16 09:26:26 +00:00
ko1 cbffea05bd add ref to [Bug #10852].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-16 08:43:49 +00:00
ko1 5a17488189 * test/objspace/test_objspace.rb: relax pattern because uncollectible
flag and marked flag can be false at major GC.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-16 08:38:55 +00:00
normal d51065b011 NEWS: update for socket API changes [ci skip]
[Feature #11242] [Feature #11229]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-15 21:28:00 +00:00
normal a02a3f4649 socket: allow explicit buffer for recv and recv_nonblock
This reduces GC overhead and makes the API more consistent
with IO#read and IO#read_nonblock.

* ext/socket/basicsocket.c (bsock_recv): document outbuf
* ext/socket/unixsocket.c (unix_recvfrom): ditto
* ext/socket/init.c (rsock_strbuf, recvfrom_locktmp): new functions
  (rsock_s_recvfrom): support destination buffer as 3rd arg
  (rsock_s_recvfrom_nonblock): ditto
* string.c (rb_str_locktmp_ensure): export for internal ext
* test/socket/test_nonblock.rb: test recv_nonblock
* test/socket/test_unix.rb: test recv
  [ruby-core:69543] [Feature #11242]

Benchmark results:

             user     system      total        real
alloc    0.130000   0.280000   0.410000 (  0.420656)
extbuf   0.100000   0.220000   0.320000 (  0.318708)

-------------------8<--------------------
require 'socket'
require 'benchmark'
nr = 100000
msg = ' ' * 16384
size = msg.bytesize
buf = ' ' * size
UNIXSocket.pair(:DGRAM) do |a, b|
  Benchmark.bmbm do |x|
    x.report('alloc') do
      nr.times do
        b.send(msg, 0)
        a.recv(size, 0)
      end
    end

    x.report('extbuf') do
      nr.times do
        b.send(msg, 0)
        a.recv(size, 0, buf)
      end
    end
  end
end

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-15 20:02:43 +00:00
svn 56368a06a6 * 2015-06-16
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-15 19:39:56 +00:00
normal b9a91334c5 socket: allow exception-free nonblocking sendmsg/recvmsg
As documented before, exceptions are expensive and IO::Wait*able are too
common in socket applications to be the exceptional case.  Datagram
sockets deserve the same API which stream sockets are allowed with
read_nonblock and write_nonblock.

Note: this does not offer a performance advantage under optimal
conditions when both ends are equally matched in speed, but it it
does make debug output cleaner by avoiding exceptions whenever
the receiver slows down.

* ext/socket/ancdata.c (bsock_sendmsg_internal, bsock_recvmsg_internal):
  support "exception: false" kwarg
* ext/socket/init.c (rsock_s_recvfrom_nonblock):
  ditto
* ext/socket/init.c (rsock_s_recvfrom_nonblock): use rsock_opt_false_p
* ext/socket/socket.c (sock_connect_nonblock): ditto
* ext/socket/rubysocket.h (rsock_opt_false_p): new function
* ext/socket/basicsocket.c (bsock_recv_nonblock): update rdoc
* ext/socket/udpsocket.c (udp_recvfrom_nonblock): ditto
* test/socket/test_nonblock.rb: new tests

[ruby-core:69542] [Feature #11229]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-15 19:38:49 +00:00
nobu 91af3e00d1 proc.c: reduce type checks
* proc.c (rb_mod_define_method): no needs to check same type
  twice.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-15 08:18:18 +00:00
knu 9f2e41b7e0 * lib/set.rb: Make Set#each and SortedSet#each generate a sized
enumerator. [GH-931] by kachick (Kenichi Kamiya)

* test/test_set.rb: Import tests from Set into SortedSet. [GH-931]
  by kachick (Kenichi Kamiya)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-15 05:37:38 +00:00
naruse bab5bf0c79 * lib/net/http.rb (Net::HTTP#connect): use connect_nonblock and
io/wait. fix GH-899

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-15 02:11:20 +00:00
nobu 23f371fd19 envutil.rb: show failure description
* test/lib/envutil.rb (assert_separately): always show failure
  description.  signals are not available on Windows.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-15 01:52:00 +00:00
nobu 5c5b2505a1 envutil.rb: no signal description iff possible
* test/lib/envutil.rb (FailDesc): show signal description only if
  it is available, or nothing if not killed by a signal.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-15 01:51:49 +00:00
nobu 1ab22a5672 raddrinfo.c: suppress a warning
* ext/socket/raddrinfo.c (parse_numeric_port): used only when
  inet_pton() is available.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14 23:40:51 +00:00
nobu efb9a0fc18 call_without_gvl.c: no sys/select.h
* ext/-test-/gvl/call_without_gvl/call_without_gvl.c: sys/select.h
  is included by ruby/define.h if available.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14 23:23:48 +00:00
nobu 03ced98dfe test_require.rb: wait loadig
* test/ruby/test_require.rb (test_loading_fifo_threading): wait
  until the main thread blocks by loading.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14 23:05:52 +00:00
svn c927991601 * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14 22:52:30 +00:00
kosaki 8ecd3b7114 * thread.c (thread_start_func_2): don't interrupt when last thread exit
unless main thread is already exited. Otherwise main thread could be
  wrongly interrupted when it uses rb_thread_call_without_gvl(). Patch
  by Takehiro Kubo. [Bug #11237][ruby-dev:49044][GH-898]
* test/-ext-/gvl/test_last_thread.rb: new test for the above fix.
* ext/-test-/gvl/call_without_gvl/call_without_gvl.c: new ext for the
  above test.
* ext/-test-/gvl/call_without_gvl/extconf.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14 22:52:01 +00:00
svn 95f251b465 * 2015-06-15
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14 15:14:55 +00:00
akr 8bb581f8dd * ext/pathname/lib/pathname.rb (descend): Blockless form supported.
(ascend): Ditto.
  [ruby-core:68820] [Feature #11052] Patch by Piotr Szotkowski.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14 15:14:46 +00:00
usa 16917fa698 * test/ruby/test_require.rb (TestRequire#test_loading_fifo_threading): omit on
Windows.  the platform does not support fifo.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14 13:48:17 +00:00
akr 35808bbf4b show pathname of failed file.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14 13:35:05 +00:00
nobu d4440631b7 raddrinfo.c: suppress a warning
* ext/socket/raddrinfo.c (parse_numeric_port): explict cast to
  suppress a warning for precision losing conversion.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14 12:25:42 +00:00
nobu 0b2f4ab07e test_prime.rb: descriptive assertions
* test/test_prime.rb: use more descriptive assertions for better
  failure meessages, instead of simple assert.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14 12:13:04 +00:00
akr 3093ffab83 * time.c (time_getlocaltime): [DOC] Add examples of valid utc_offset
formats.
  [ruby-core:68306] [Misc #10905] Patch by Charles Korn.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14 11:10:49 +00:00
akr 9bcff8dbe9 [DOC]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14 10:43:12 +00:00
akr 2f8d3280e0 * ext/socket/raddrinfo.c (parse_numeric_port): Detect
port overflow.
  (numeric_getaddrinfo): Use parse_numeric_port.
  numeric_getaddrinfo fails if port is too big now.
  This makes rb_getaddrinfo invokes the real getaddrinfo()
  on such condition.
  This change is related to [ruby-core:69355] [Bug #11179].



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14 10:11:01 +00:00
akr 11aa7c9604 * enum.c (enum_chunk_while): New method Enumerable#chunk_while.
[ruby-core:67738] [Feature #10769] proposed by Tsuyoshi Sawada.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14 08:54:19 +00:00
akr 07736e3d7d Add ticket numbers.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14 08:53:27 +00:00
nobu 0b3ef899f2 file.c: open without gvl
* file.c (rb_file_load_ok): try opening file without gvl not to
  lock entire process.  [Bug #11060]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14 08:20:43 +00:00
usa 9b04c1dd42 * tool/runruby.rb: just remove the lines of RUBY_VERSION check and raise
instead of replacing the check to `true`, for getting rid of a
  warning `possibly useless use of true in void context`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14 01:46:22 +00:00
kou f4a5136504 * lib/rexml/source.rb (REXML::IOSource#scan): Fix a typo in
document. [fix GH-934] [ci skip]
  Patch by Anton Davydov. Thanks!!!

    warrent
    warrant
        ?


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14 01:14:38 +00:00
kou 924baabddb * lib/rexml/attlistdecl.rb (REXML::AttlistDecl): Fix a typo in
document. [fix GH-934] [ci skip]
  Patch by Anton Davydov. Thanks!!!

    for seeable
    foreseeable
       +


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14 01:13:33 +00:00
usa cda0d56296 * test/test_unicode_normalize.rb: get rid of a warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50883 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14 00:59:23 +00:00