diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-06 03:56:38 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-06 03:56:38 +0000 |
commit | 287a34ae0dfc23e4158f67cb7783d239f202c368 (patch) | |
tree | 5e35d5b41aae961b37cf6632f60c42f51c7aa775 /ext/tk/lib/tk/timer.rb | |
parent | 9b52ae2e6491bb5d6c59e1799449f6268baf6f89 (diff) |
* {ext,lib,test}/**/*.rb: removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/tk/timer.rb')
-rw-r--r-- | ext/tk/lib/tk/timer.rb | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/ext/tk/lib/tk/timer.rb b/ext/tk/lib/tk/timer.rb index 91840d0575..686d4bd483 100644 --- a/ext/tk/lib/tk/timer.rb +++ b/ext/tk/lib/tk/timer.rb @@ -76,7 +76,7 @@ class TkTimer rescue Interrupt exit!(1) rescue Exception => e - if @cancel_on_exception && + if @cancel_on_exception && @cancel_on_exception.find{|exc| e.kind_of?(exc)} cancel @return_value = e @@ -180,12 +180,12 @@ class TkTimer @after_script = nil @cancel_on_exception = DEFAULT_IGNORE_EXCEPTIONS - # Unless @cancel_on_exception, Ruby/Tk shows an error dialog box when - # an excepsion is raised on TkTimer callback procedure. - # If @cancel_on_exception is an array of exception classes and the raised - # exception is included in the array, Ruby/Tk cancels executing TkTimer - # callback procedures silently (TkTimer#cancel is called and no dialog is - # shown). + # Unless @cancel_on_exception, Ruby/Tk shows an error dialog box when + # an excepsion is raised on TkTimer callback procedure. + # If @cancel_on_exception is an array of exception classes and the raised + # exception is included in the array, Ruby/Tk cancels executing TkTimer + # callback procedures silently (TkTimer#cancel is called and no dialog is + # shown). if b case args.size @@ -229,7 +229,7 @@ class TkTimer end def current_status - [@running, @current_sleep, @current_proc, @current_args, + [@running, @current_sleep, @current_proc, @current_args, @do_loop, @cancel_on_exception] end @@ -484,11 +484,11 @@ class TkTimer def at_end(*arg, &b) if arg.empty? - if b + if b @at_end_proc = b - else + else # no proc - return @at_end_proc + return @at_end_proc end else fail ArgumentError, "wrong number of arguments" if arg.length != 1 || b @@ -504,17 +504,17 @@ class TkTimer unless @running if @return_value.kind_of?(Exception) - fail @return_value + fail @return_value else - return @return_value + return @return_value end end @wait_var.wait(on_thread, check_root) if @return_value.kind_of?(Exception) - fail @return_value + fail @return_value else - @return_value + @return_value end end def eventloop_wait(check_root = false) @@ -628,12 +628,12 @@ class TkRTTimer < TkTimer if @est_time @est_time = Time.at(@est_time.to_i, @est_time.usec + sleep*1000) else - @est_time = Time.at(@cb_start_time.to_i, + @est_time = Time.at(@cb_start_time.to_i, @cb_start_time.usec + sleep*1000) end now = Time.now - real_sleep = ((@est_time.to_i - now.to_i + @offset_s)*1000.0 + + real_sleep = ((@est_time.to_i - now.to_i + @offset_s)*1000.0 + (@est_time.usec - now.usec + @offset_u)/1000.0).round if real_sleep <= 0 real_sleep = 0 @@ -653,7 +653,7 @@ class TkRTTimer < TkTimer if @current_sleep == 0 @offset_list.push([ - @offset_s - @cb_start_time.to_i, + @offset_s - @cb_start_time.to_i, @offset_u - @cb_start_time.usec ]) else |