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

26657 Коммитов

Автор SHA1 Сообщение Дата
nobu 3dba6dabb6 printf.c: uint_to_str
* ext/-test-/printf/printf.c (uint_to_str): renamed to get rid of
  conflict on cygwin.  [ruby-core:68877] [Bug #11065]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-14 02:25:27 +00:00
zzak 9075d3ef51 * gc.c: [DOC] Improve documentation for ObjectSpace.count_objects
with regards to `:TOTAL` key, with patch by @schneems [Fixes GH-871]
  https://github.com/ruby/ruby/pull/871 [Bug #11067] [ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-14 00:01:03 +00:00
akr 9bf416badf Fix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-13 15:53:25 +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
nobu 732a26dff7 ChangeLog: fix log
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 14:31:27 +00:00
hsbt 1bc5669857 * ext/json/json.gemspec: bump version to 1.8.2.
* ext/json/lib/json/version.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 09:40:11 +00:00
hsbt 9829e91d34 * ext/json/json.gemspec, lib/rdoc/rdoc.gemspec: added gemspec directly.
* defs/default_gems, tool/rbinstall.rb: removed default_gems definition.
  it make simple installation for default gems.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 09:12:15 +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 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
hsbt e40ab5942b * lib/rubygems/test_case.rb: use explicitly exception class and reverted
to require JSON library for rubygems tests with Ruby 2.2.0 or earlier.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 06:14:29 +00:00
nobu a60e00fde8 wait.c: no EOF
* ext/io/wait/wait.c (io_wait_readable): simply returns that IO is
  readable without blocking, but no longer returns EOF.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 06:10:21 +00:00
nobu 1baa57b003 wait.c: poll over nread
* ext/io/wait/wait.c (io_ready_p, io_wait_readable): try polling
  first and check FIONREAD optionally to see if EOF.
  [ruby-core:36805] [Feature #4849]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 06:08:39 +00:00
hsbt 1cb2131153 * lib/rubygems/test_case.rb: fixed json load error for rubygems tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 05:53:30 +00:00
hsbt 1ed7fdf1fa * gc.c: Document require name for ObjectSpace methods.
[ci skip][fix GH-860] Patch by @schneems

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 05:19:22 +00:00
akr 2eb3c2c528 * test/ruby/test_io.rb: New test that open(fifo) doesn't block other
threads.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 04:55:46 +00:00
hsbt f662d31b6b * ext/coverage/coverage.c: Remove extension from require argument.
[ci skip][fix GH-870] Patch by @yui-knk

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 04:52:23 +00:00
normal c18df6d87c connect_nonblock supports "exception: false"
This is for consistency with accept_nonblock arguments and gives a
minor speedup from avoiding exceptions.
[ruby-core:68838] [Feature #11024]

* ext/openssl/ossl_ssl.c (ossl_ssl_connect_nonblock):
  support `exception: false'
* (get_no_exception): move function location
* ext/socket/socket.c (sock_connect_nonblock):
  support `exception: false'
* test/openssl/test_pair.rb (test_connect_accept_nonblock_no_exception):
  test `exception: false' on connect,
  rename from `test_accept_nonblock_no_exception'
* test/socket/test_nonblock.rb (test_connect_nonblock_no_exception):
  new test

Benchmark results:

default            0.050000   0.100000   0.150000 (  0.151307)
exception: false   0.030000   0.080000   0.110000 (  0.108840)

----------------------------8<-----------------------
require 'socket'
require 'benchmark'
require 'io/wait'
require 'tmpdir'

host = '127.0.0.1'
serv = TCPServer.new(host, 0) # UNIX sockets may not hit EINPROGRESS

nr = 5000 # few iterations to avoid running out of ports

addr = serv.getsockname
pid = fork do
  begin
    serv.accept.close
  rescue => e
    warn "#$$: #{e.message} (#{e.class})"
  end while true
end
at_exit { Process.kill(:TERM, pid) }
serv.close

Benchmark.bmbm do |x|
  x.report("default") do
    nr.times do
      s = Socket.new(:INET, :STREAM)
      s.setsockopt(:SOL_SOCKET, :SO_REUSEADDR, 1)
      begin
        s.connect_nonblock(addr)
      rescue IO::WaitWritable
        s.wait_writable
      end
      s.close
    end
  end
  x.report("exception: false") do
    nr.times do
      s = Socket.new(:INET, :STREAM)
      s.setsockopt(:SOL_SOCKET, :SO_REUSEADDR, 1)
      case s.connect_nonblock(addr, exception: false)
      when :wait_writable
        s.wait_writable
      end
      s.close
    end
  end
end

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 01:41:51 +00:00
akr 2722cb9ce1 * test/ruby/test_file_exhaustive.rb: Test a block device on GNU/Linux.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 00:57:49 +00:00
akr 77ea0461c9 * test/ruby/test_file_exhaustive.rb: Test a file not owned.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 00:24:53 +00:00
svn 2c292588ba * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 00:11:40 +00:00
akr 606274b55d * ext/fiddle/depend: Fix "Wrong mix of special targets" error with
OpenBSD make.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 00:10:52 +00:00
usa a2d1956454 * test/ruby/test_file_exhaustive.rb: Windows doesn't support Unix file
modes.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 00:06:20 +00:00
akr a96034cf10 * ext/-test-/file/fs.c: OpenBSD needs sys/param.h before sys/mount.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 00:01:11 +00:00
akr d51b836fdd * test/ruby/test_file_exhaustive.rb: Test suid, sgid and sticky file.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-11 23:52:34 +00:00
hsbt df7aac7c8d * template/fake.rb.in: Don't assign baseruby, Because it's affect to
Makefile of native gem like json on bundled gems.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-11 14:48:34 +00:00
akr 28ca0b0f20 * file.c (rb_f_test): Consider nsec for "=", "<" and ">" for "test"
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-11 14:34:26 +00:00
hsbt d266473283 * tool/rbinstall.rb: support destdir for native extention gem.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-11 14:26:44 +00:00
usa 7c9e01d3c8 * test/ruby/test_file_exhaustive.rb
(TestFileExhaustive#test_stat_socket_p): r50226 accidentally missed
  the guard for non-unix environments.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-11 12:03:31 +00:00
hsbt cfaddc2a32 * ext/json/*, test/json/*, defs/default_gems: Gemify JSON library.
[fix GH-867][Feature #11057]
* test/ruby/test_extlibs.rb: removed json gem from existence extentions.
* gems/bundled_gems: added json gem into bundled gem.
* lib/rdoc/rubygems_hook.rb: ignored no json environment.
* lib/rubygems/test_case.rb, test/rubygems/*: ditto.
* lib/rdoc/test_case.rb, test/rdoc/*: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-11 11:14:36 +00:00
akr 29de8ed499 * test/ruby/test_file_exhaustive.rb: Create sample files lazily.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-11 06:57:37 +00:00
akr 7156deb522 * test/ruby/test_file_exhaustive.rb: Test character device using
/dev/null.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-11 05:04:17 +00:00
nobu bb96ab6fb6 mkmf.rb: methods to append flags
* lib/mkmf.rb (append_cppflags, append_cflags, append_ldflags):
  utility methods to append compiler options.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-11 02:00:02 +00:00
hsbt 600d527333 * lib/rdoc/text.rb: removed duplicated code.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-10 23:22:28 +00:00
normal db2ff03bc0 lib/net/protocol.rb (rbuf_fill): avoid exception with read_nonblock
Exceptions are noisy in debug output and waste allocations.
Use "exception: false" introduced in 2.1 to return symbols for
common errors instead.

Follow-up commits will be prepared to reduce EOFError exceptions
to further quiet debug output and IO.select may be replaced by
io/wait methods if available to reduce allocations.

[ruby-core:68787] [Feature #11044]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-10 21:05:29 +00:00
nobu 9e459f7aa9 dir.c: getattrlist on OSX 10.5
* dir.c (need_normalization): use getattrlist() if fgetattrlist()
  is unavailable, on OSX 10.5.  [ruby-core:68829] [Bug #11054]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-10 14:57:47 +00:00
nobu aceb11dff4 mkmf.rb: fix werror option
* lib/mkmf.rb (try_compile): pass the given werror flag to try_do
  to check if stderr is empty.
* lib/mkmf.rb (try_cflags, try_ldflags): default werror to true.
* win32/Makefile.sub (WERRORFLAG): remove useless option.  VC does
  not make warnings of unknown command option an error.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-10 13:29:23 +00:00
akr 0ad3abe1f1 * test/ruby/test_file_exhaustive.rb: Test socket.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-10 10:52:29 +00:00
ko1 adabc801be * test/objspace/test_objspace.rb: remove debug prints.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-10 10:39:07 +00:00
ko1 7f75a1a810 * ext/objspace/objspace.c: add ObjectSpace.count_imemo_objects method
to count imemo objects for each type.
* test/objspace/test_objspace.rb: add a test.
* NEWS: describe about this addition.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-10 10:38:13 +00:00
akr deab71578b * test/ruby/test_file_exhaustive.rb: Test anonymous pipe.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-10 10:34:47 +00:00
akr dec7415126 * test/ruby/test_file_exhaustive.rb: Test named pipe.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-10 10:32:38 +00:00
ko1 1a688f001c * ext/objspace/objspace.c (setup_hash): unify common routine.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-10 10:13:00 +00:00
akr ff381ca19b * process.c (rb_execarg_parent_start1): Handle EINTR.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-10 09:45:29 +00:00
ko1 93df5a0a90 * vm.c (vm_exec): check other events when RETURN is thrown.
[Bug #10724]
* test/ruby/test_settracefunc.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-10 08:29:30 +00:00
akr 1eff125f8a Fix a typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-10 03:12:58 +00:00
nobu 54264f534a ext/date: reject unknown compiler option
* ext/date/extconf.rb: check warnings.
* lib/mkmf.rb (try_cflags): pass options to try_compile.
* win32/Makefile.sub (WERRORFLAG): make unknown command line
  options an error.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-10 02:44:12 +00:00
usa f40379378a * test/ruby/test_process.rb: unfortunately, windows is not POSIX...
cygwin has mkfifo command, but it does not affect system-wide.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-09 23:03:35 +00:00
akr 79f940cda1 * test/ruby/test_process.rb: Use mkfifo command instead of mknod
command to create a named file.  mkfifo commandis defined by POSIX.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-09 17:19:57 +00:00
akr ce28a7539d * process.c: Release GVL when opening a file in spawn() to avoid whole
process blocking when opening a named pipe.
  (open_func): New function.
  (rb_execarg_parent_start1): Extracted from rb_execarg_parent_start and
  use rb_thread_call_without_gvl2 to release GVL when opening a file.
  (rb_execarg_parent_start): Invoke rb_execarg_parent_start1 via
  rb_protect and invoke rb_execarg_parent_end when error.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-09 16:33:02 +00:00