aboutsummaryrefslogtreecommitdiffstats
path: root/lib/timeout.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-13 10:11:38 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-13 10:11:38 +0000
commit06a223fb06a6c567b2032401fd1f7dfa8a1e1ad8 (patch)
tree96934f2f98ff0850fe58be5734a5bef1fa8f5190 /lib/timeout.rb
parent29ed37d05fc67b8e7a1640c7a8c83731f9641a5f (diff)
downloadruby-06a223fb06a6c567b2032401fd1f7dfa8a1e1ad8.tar.gz
timeout.rb: warn deprecated method
* 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
Diffstat (limited to 'lib/timeout.rb')
-rw-r--r--lib/timeout.rb11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/timeout.rb b/lib/timeout.rb
index fcb3a0cce1..5dd061cf43 100644
--- a/lib/timeout.rb
+++ b/lib/timeout.rb
@@ -112,14 +112,9 @@ module Timeout
module_function :timeout
end
-# Identical to:
-#
-# Timeout::timeout(n, e, &block).
-#
-# This method is deprecated and provided only for backwards compatibility.
-# You should use Timeout#timeout instead.
-def timeout(n, e = nil, &block)
- Timeout::timeout(n, e, &block)
+def timeout(*args, &block)
+ warn "#{caller_locations(1, 1)[0]}: Object##{__method__} is deprecated, use Timeout.timeout instead."
+ Timeout.timeout(*args, &block)
end
# Another name for Timeout::Error, defined for backwards compatibility with