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

39296 Коммитов

Автор SHA1 Сообщение Дата
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
nobu a4f7274423 wait.c: fix rdoc
* ext/io/wait/wait.c (io_wait_writable): fix rdoc.  no EOF to
  write.  retursn nil when timeout, not self.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 06:07:48 +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
akr 2abf47bff9 Test fifo without sleep.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 05:22:28 +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
nobu 143a2817f2 test_file_exhaustive.rb: assert_predicate
* test/ruby/test_file_exhaustive.rb: use assert_predicate and
  assert_not_predicate for better failure messages.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 02:32:10 +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 525d2102fc Consider more block devices.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 01:33:19 +00:00
nobu a062d71b15 test_file_exhaustive.rb: NTFS
* test/ruby/test_file_exhaustive.rb (NTFS): flag for test of NTFS.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 01:26:28 +00:00
nobu 640ad73bcc test_file_exhaustive.rb: POSIX-like tests
* test/ruby/test_file_exhaustive.rb: define POSIX-like filesystem
  depenedent tests only on POSIX-like systems.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 01:22:19 +00:00
nobu c305a5aac2 test_file_exhaustive.rb: POSIX
* test/ruby/test_file_exhaustive.rb (POSIX): flag for test of
  POSIX-like filesystems.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 01:13:50 +00:00
nobu fe294d75fe test_file_exhaustive.rb: skip when root
* test/ruby/test_file_exhaustive.rb (test_owned_p): skipt when
  running as super user.

* test/ruby/test_file_exhaustive.rb (test_stat_owned_p): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 01:03:30 +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
nobu b850ec4680 wait.c: wait_for_single_fd
* ext/io/wait/wait.c (wait_for_single_fd): extract wrapper
  function of rb_wait_for_single_fd().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 00:53:28 +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
nobu f7dca1d7cd wait.c: get_timeout
* ext/io/wait/wait.c (get_timeout): extract function to get
  timeout value.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 00:24:12 +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
svn 240cc5649d * 2015-04-12
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-11 23:32:15 +00:00
nobu 3cb0c6e39e rbinstall.rb: destdir
* tool/rbinstall.rb (gem): use installed ruby under destdir.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-11 23:31:48 +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 cd06ce2e5a * ext/json, test/json: removed empty directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-11 14:32:17 +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
nobu 42e149c9ad mkmf.rb: fix VC failures
* lib/mkmf.rb (xsystem): assume all warnings go to stderr but not
  stdout.  cl.exe always prints input file names.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-11 13:49:02 +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 8e7b572d97 Delay signal bit more.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-11 09:00:39 +00:00
akr 3d2468240d simplified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-11 07:34:06 +00:00
akr 7ca24e0b1b refactored to make code consistent around sleep.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-11 07:22:53 +00:00
akr aed411d561 reorder invocations in test_stat_init.
This doesn't change actual behavior because hardlinkfile invokes regular_file.
This change make it more explicit.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-11 07:06:34 +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 335cd8ab6a mkmf.rb: fix syntax errors
* lib/mkmf.rb (append_cppflags, append_cflags, append_ldflags):
  fix missing parentheses.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-11 02:01:57 +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
nobu 1b1a0bda67 README.md: fix inline markups
* README.md, README.ja.md: don't break inside inline markups.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-11 00:48:37 +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
svn 39e2f04e04 * 2015-04-11
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-10 21:05:48 +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
akr b75b040e04 Use more shorter filenames to avoid sockaddr_un size limitation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-10 14:47:28 +00:00
nobu f168f23f82 mkmf.rb: werror of try_cppflags
* lib/mkmf.rb (try_cppflags): set werror flag as same as cflags
  and ldflags.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-10 13:36:59 +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 6f636adad0 Use shorter filenames to avoid sockaddr_un size limitation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-10 11:52:29 +00:00