From 61f46bafa47df9d5aa9bd79b565a3d8bf44b946c Mon Sep 17 00:00:00 2001 From: kazu Date: Wed, 5 Dec 2012 15:48:11 +0000 Subject: adjust style and fix typo and indent git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++-- lib/timeout.rb | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7969290500..f2bb22771c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,10 @@ Wed Dec 5 04:50:17 2012 KOSAKI Motohiro + * lib/timeout.rb (Timeout#timeout): set - async_interrupt_timeing(:on_blocking) by default. + async_interrupt_timing(: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_blocking): test for the above. * test/test_timeout.rb (test_timeout_immediate): ditto * test/test_timeout.rb (test_timeout_immediate2): ditto. diff --git a/lib/timeout.rb b/lib/timeout.rb index 12c110647e..da4eae39a1 100644 --- a/lib/timeout.rb +++ b/lib/timeout.rb @@ -48,7 +48,7 @@ module Timeout # Timeout into your classes so they have a #timeout method, as well as # a module method, so you can call it directly as Timeout.timeout(). def timeout(sec, klass = nil, immediate: false) #:yield: +sec+ - return yield(sec) if sec == nil or sec.zero? + return yield(sec) if sec == nil or sec.zero? Thread.async_interrupt_timing(klass ? klass : ExitException => immediate ? :immediate : :on_blocking) do exception = klass || Class.new(ExitException) begin -- cgit v1.2.3