aboutsummaryrefslogtreecommitdiffstats
path: root/lib/timeout.rb
Commit message (Collapse)AuthorAgeFilesLines
* [ruby/timeout] Removed deprecated names that had been warned for 5 yearsNobuyoshi Nakada2021-01-031-12/+0
| | | | https://github.com/ruby/timeout/commit/f9a9758a41
* Update library versions of the default gems.Hiroshi SHIBATA2020-12-221-1/+1
| | | | | They are followed up with https://github.com/ruby/ruby/commit/8fb02b7a97317090e3946e6f2d4a7d034f9699f1
* Extract version number from the sourceNobuyoshi Nakada2020-07-301-0/+2
| | | | | | | | | | | "requiring version.rb" strategy has some issues. - cannot work when cross-compiling - often introduces wrong namespace - must know the superclasses - costs at each runtime than at build-time etc.
* Add some documentation to Timeout#timeout about possible issuesJeremy Evans2019-06-041-1/+3
| | | | Documentation requested in [Bug #15886].
* Add uplevel keyword to Kernel#warn and use itshyouhei2017-12-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If uplevel keyword is given, the warning message is prepended with caller file and line information and the string "warning: ". The use of the uplevel keyword makes Kernel#warn format output similar to how rb_warn formats output. This patch modifies net/ftp and net/imap to use Kernel#warn instead of $stderr.puts or $stderr.printf, since they are used for printing warnings. This makes lib/cgi/core and tempfile use $stderr.puts instead of warn for debug logging, since they are used for debug printing and not for warning. This does not modify bundler, rubygems, or rdoc, as those are maintained outside of ruby and probably wish to remain backwards compatible with older ruby versions. rb_warn_m code is originally from nobu, but I've changed it so that it only includes the path and lineno from uplevel (not the method), and also prepends the string "warning: ", to make it more similar to rb_warn. From: Jeremy Evans code@jeremyevans.net Signed-off-by: Urabe Shyouhei shyouhei@ruby-lang.org git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix typo in `Timeout` doc [ci skip]kazu2017-11-171-2/+2
| | | | | | | | Author: yuuji.yaginuma <yuuji.yaginuma@gmail.com> https://github.com/ruby/ruby/pull/1760 [Fix GH-1760] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix a typo [ci skip]kazu2016-09-071-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* timeout.rb: custom error messagenobu2016-09-071-2/+4
| | | | | | | * lib/timeout.rb (Timeout#timeout): add custom error message argument. [Feature #11650] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* timeout.rb: watcher thread namenobu2015-12-181-0/+2
| | | | | | | * lib/timeout.rb (Timeout#timeout): set watcher thread name to caller location for debugging. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-161-0/+1
| | | | | | When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* timeout.rb: freeze a string messagenobu2015-08-131-1/+1
| | | | | | | * lib/timeout.rb (Timeout#timeout): freeze a string message to reduce string allocations. [Fix GH-996] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: Module#deprecate_constantnobu2015-07-301-0/+3
| | | | | | | | * variable.c (rb_const_get_0): warn deprecated constant reference. * variable.c (rb_mod_deprecate_constant): mark constants to be warned as deprecated. [Feature #11398] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* timeout.rb: suppress a warningnobu2015-07-141-1/+1
| | | | | | * lib/timeout.rb (Timeout): get rid of an argument prefix warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* timeout.rb: warn deprecated methodnobu2015-07-131-8/+3
| | | | | | * lib/timeout.rb (timeout): warn as deprecated for a long time. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* timeout.rb: internal constantsnobu2015-07-131-0/+1
| | | | | | * lib/timeout.rb (Timeout): make internal constants private. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* timeout.rb: fix backtracenobu2015-07-111-3/+1
| | | | | | | * lib/timeout.rb (Timeout#timeout): remove regexp with wrong line nuber and fix caller depth. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* timeout.rb: removed and use Timeout::Errornobu2015-07-101-3/+1
| | | | | | | | * lib/timeout.rb (ExitException): removed internal exception class and use Timeout::Error instead, as using throw/catch to isolate each timeouts now. [ruby-dev:49179] [Bug #11344] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* timeout.rb: same object across fibernobu2014-11-171-2/+1
| | | | | | | | * lib/timeout.rb (Timeout::ExitException.catch): do not freeze the exception for tag, so that the same object can be passed to the target fiber without duplication to attach backtrace at raise. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* timeout.rb: use UncaughtThrowErrornobu2014-11-161-2/+1
| | | | | | | | * lib/timeout.rb (Timeout::ExitException#exception): rescue UncaughtThrowError which is specific for throw, instead of ArgumentError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/timeout.rb: fallback to Timeout::Errornobu2014-01-081-4/+12
| | | | | | | | | | | * lib/timeout.rb (Timeout::ExitException.catch): pass arguments for new instance. * lib/timeout.rb (Timeout::ExitException#exception): fallback to Timeout::Error if couldn't throw. [ruby-dev:47872] [Bug #9380] * lib/timeout.rb (Timeout#timeout): initialize ExitException with message for the fallback case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* timeout.rb: revert r44520nobu2014-01-071-7/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* timeout.rb: current_targetnobu2014-01-071-3/+7
| | | | | | | | | * lib/timeout.rb (Timeout::ExitException#target): rename attribute. * lib/timeout.rb (Timeout::ExitException.current_target): extract a method to achieve the target. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* timeout.rb: unused attributenobu2014-01-071-1/+1
| | | | | | | * lib/timeout.rb (Timeout::ExitException): remove unused attribute, klass. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* timeout.rb: fix for ExitExceptionnobu2014-01-071-7/+14
| | | | | | | | | * lib/timeout.rb (Timeout#timeout): should not rescue ordinarily raised ExitException, which should not be thrown. * lib/timeout.rb (Timeout::ExitException.catch): set @thread only if it ought to be caught. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* timeout.rb: defer creating custom exceptionnobu2014-01-071-2/+3
| | | | | | | | * lib/timeout.rb (Timeout#timeout): when a custom exception is given, no instance is needed to be caught, so defer creating new instance until it is raised. [ruby-core:59511] [Bug #9354] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/timeout.rb: Added note about change from #8730 [Fixes GH-440]zzak2013-11-101-0/+3
| | | | | | | | * NEWS: Improve grammar on change to Timeout Patched by @srawlins in https://github.com/ruby/ruby/pull/440 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* timeout.rb: raise given exceptionnobu2013-08-271-4/+7
| | | | | | | * lib/timeout.rb (Timeout#timeout): skip rescue clause only when no exception class is given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* timeout.rb: skip rescuenobu2013-08-261-14/+22
| | | | | | | * lib/timeout.rb (Timeout#timeout): should not be caught by rescue clause. [Bug #8730] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* doumentation by @toolmantim [GH fixes #270]hsbt2013-03-311-3/+4
| | | | | | | | * timeout.rb: Document Timeout::timeout 0 and nil argument behavior git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert r38216 and r38221. Release manager mark this feature as "next minor".kosaki2012-12-071-19/+17
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* timeout.rb: replace deferred exception after async_interrupt_timingnobu2012-12-071-13/+13
| | | | | | | | * lib/timeout.rb (Timeout#timeout): since async_interrupt_timing re-raises a deferred exception, replace the timeout exception with Timeout::Error after it. [Bug #7503] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/timeout.rb (Timeout#timeout): specify a exceptiontarui2012-12-051-2/+2
| | | | | | | more strictly at async_interrupt_timing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* adjust style and fix typo and indentkazu2012-12-051-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/timeout.rb (Timeout#timeout): setkosaki2012-12-051-29/+31
| | | | | | | | | | | | | async_interrupt_timeing(:on_blocking) by default. [Bug #7503] [ruby-core:50524] * test/test_timeout.rb (#test_timeout_blocking): test for the above. * test/test_timeout.rb (test_timeout_immediate): ditto * test/test_timeout.rb (test_timeout_immediate2): ditto. * NEWS: news for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/timeout.rb (timeout):zzak2012-10-111-3/+0
| | | | | | | | Remove paragraph on wrong implementation detail. [ruby-core:47739] [Bug #7088] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/timeout.rb: Clarify timeout duration types. Patch by Alf Mikula.drbrain2011-06-161-1/+2
| | | | | | | | [Ruby 1.9 - Bug #4791] * lib/net/http.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/timeout.rb: Improve documentation. Patch by David Copeland.drbrain2011-05-221-20/+27
| | | | | | | [Ruby 1.9 - Bug #4755] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/timeout.rb (Timeout#timeout): don't leak "execution expired"kosaki2011-05-181-15/+17
| | | | | | | | exception. [Bug #4283] [ruby-core:34534]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/timeout.rb (module Timeout): Hide internal constants. Patch bydrbrain2011-05-161-0/+2
| | | | | | | Pete Higgins. [Ruby 1.9 - Bug #4701] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/timeout.rb (Timeout#timeout): propagate errors to thenobu2010-04-191-2/+7
| | | | | | | caller. [ruby-dev:41010]' git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sample/timeout.rb: split from lib/timeout.rb.nobu2010-03-111-21/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * {ext,lib,test}/**/*.rb: removed trailing spaces.nobu2009-03-061-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/timeout.rb (Timeout::timeout): made sensitive to location on thenobu2008-02-131-3/+20
| | | | | | | stack. [ruby-core:15458] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/timeout.rb: join the background thread to make sure it is dead.akr2007-12-151-1/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/timeout.rb (Timeout.timeout): should return the block value always.aamine2007-03-051-7/+7
| | | | | | | | * lib/timeout.rb (Timeout.timeout): should yield sec argument always. * lib/timeout.rb (Timeout.timeout): fix document. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * Merge YARVko12006-12-311-35/+18
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Updated rdoc to fix timeout.rb and include rinda directory. By Eric Hodelryan2005-11-211-16/+32
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: replace rb_protect_inspect() and rb_inspecting_p() bymatz2005-03-041-21/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rb_exec_recursive() in eval.c. * eval.c (rb_exec_recursive): new function. * array.c (rb_ary_join): use rb_exec_recursive(). * array.c (rb_ary_inspect, rb_ary_hash): ditto. * file.c (rb_file_join): ditto. * hash.c (rb_hash_inspect, rb_hash_to_s, rb_hash_hash): ditto. * io.c (rb_io_puts): ditto. * object.c (rb_obj_inspect): ditto * struct.c (rb_struct_inspect): ditto. * lib/set.rb (SortedSet::setup): a hack to shut up warning. [ruby-talk:132866] * lib/time.rb (Time::strptime): add new function. inspired by [ruby-talk:132815]. * lib/parsedate.rb (ParseDate::strptime): ditto. * regparse.c: move st_*_strend() functions from st.c. fixed some potential memory leaks. * exception error messages updated. [ruby-core:04497] * ext/socket/socket.c (Init_socket): add bunch of Socket constants. Patch from Sam Roberts <sroberts@uniserve.com>. [ruby-core:04409] * array.c (rb_ary_s_create): no need for negative argc check. [ruby-core:04463] * array.c (rb_ary_unshift_m): ditto. * lib/xmlrpc/parser.rb (XMLRPC::FaultException): make it subclass of StandardError class, not Exception class. [ruby-core:04429] * parse.y (fcall_gen): lvar(arg) will be evaluated as lvar.call(arg) when lvar is a defined local variable. [new] * object.c (rb_class_initialize): call inherited method before calling initializing block. * eval.c (rb_thread_start_1): initialize newly pushed frame. * lib/open3.rb (Open3::popen3): $? should not be EXIT_FAILURE. fixed: [ruby-core:04444] * eval.c (is_defined): NODE_IASGN is an assignment. * ext/readline/readline.c (Readline.readline): use rl_outstream and rl_instream. [ruby-dev:25699] * ext/etc/etc.c (Init_etc): sGroup needs HAVE_ST_GR_PASSWD check [ruby-dev:25675] * misc/ruby-mode.el: [ruby-core:04415] * lib/rdoc/generators/html_generator.rb: [ruby-core:04412] * lib/rdoc/generators/ri_generator.rb: ditto. * struct.c (make_struct): fixed: [ruby-core:04402] * ext/curses/curses.c (window_color_set): [ruby-core:04393] * ext/socket/socket.c (Init_socket): SO_REUSEPORT added. [ruby-talk:130092] * object.c: [ruby-doc:818] * parse.y (open_args): fix too verbose warnings for the space before argument parentheses. [ruby-dev:25492] * parse.y (parser_yylex): ditto. * parse.y (parser_yylex): the first expression in the parentheses should not be a command. [ruby-dev:25492] * lib/irb/context.rb (IRB::Context::initialize): [ruby-core:04330] * object.c (Init_Object): remove Object#type. [ruby-core:04335] * st.c (st_foreach): report success/failure by return value. [ruby-Bugs-1396] * parse.y: forgot to initialize parser struct. [ruby-dev:25492] * parse.y (parser_yylex): no tLABEL on EXPR_BEG. [ruby-talk:127711] * document updates - [ruby-core:04296], [ruby-core:04301], [ruby-core:04302], [ruby-core:04307] * dir.c (rb_push_glob): should work for NUL delimited patterns. * dir.c (rb_glob2): should aware of offset in the pattern. * string.c (rb_str_new4): should propagate taintedness. * env.h: rename member names in struct FRAME; last_func -> callee, orig_func -> this_func, last_class -> this_class. * struct.c (rb_struct_set): use original method name, not callee name, to retrieve member slot. [ruby-core:04268] * time.c (time_strftime): protect from format modification from GC finalizers. * object.c (Init_Object): remove rb_obj_id_obsolete() * eval.c (rb_mod_define_method): incomplete subclass check. [ruby-dev:25464] * gc.c (rb_data_object_alloc): klass may be NULL. [ruby-list:40498] * bignum.c (rb_big_rand): should return positive random number. [ruby-dev:25401] * bignum.c (rb_big_rand): do not use rb_big_modulo to generate random bignums. [ruby-dev:25396] * variable.c (rb_autoload): [ruby-dev:25373] * eval.c (svalue_to_avalue): [ruby-dev:25366] * string.c (rb_str_justify): [ruby-dev:25367] * io.c (rb_f_select): [ruby-dev:25312] * ext/socket/socket.c (sock_s_getservbyport): [ruby-talk:124072] * struct.c (make_struct): [ruby-dev:25249] * dir.c (dir_open_dir): new function. [ruby-dev:25242] * io.c (rb_f_open): add type check for return value from to_open. * lib/pstore.rb (PStore#transaction): Use the empty content when a file is not found. [ruby-dev:24561] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_min_by): new method Enum#min_by. added Enum#max_bymatz2004-07-141-0/+1
| | | | | | | as well. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dln.c, io.c, pack.c, lib/benchmark.rb, lib/cgi.rb, lib/csv.rb,nobu2004-04-181-2/+2
| | | | | | | | | | | | | | lib/date.rb, lib/ftools.rb, lib/getoptlong.rb, lib/logger.rb, lib/matrix.rb, lib/monitor.rb, lib/set.rb, lib/thwait.rb, lib/timeout.rb, lib/yaml.rb, lib/drb/drb.rb, lib/irb/workspace.rb, lib/net/ftp.rb, lib/net/http.rb, lib/net/imap.rb, lib/net/pop.rb, lib/net/telnet.rb, lib/racc/parser.rb, lib/rinda/rinda.rb, lib/rinda/tuplespace.rb, lib/shell/command-processor.rb, lib/soap/rpc/soaplet.rb, lib/test/unit/testcase.rb, lib/test/unit/testsuite.rb: typo fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e