summaryrefslogtreecommitdiff
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
commitfa474e56cd9aac932454bf5fb9748d5472a946fb (patch)
tree96934f2f98ff0850fe58be5734a5bef1fa8f5190
parentbeb1c085d582b4ac187309560eb871dda5bc3c28 (diff)
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
-rw-r--r--ChangeLog4
-rw-r--r--NEWS3
-rw-r--r--lib/timeout.rb11
3 files changed, 10 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index d1ee353..c706c61 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Mon Jul 13 19:11:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/timeout.rb (timeout): warn as deprecated for a long time.
+
Mon Jul 13 01:37:27 2015 Zachary Scott <zzak@ruby-lang.org>
* ext/openssl/ossl.c: [DOC] Backport ruby/openssl@dbb3fdb [Bug #11345]
diff --git a/NEWS b/NEWS
index b1e80ec..f4b4b78 100644
--- a/NEWS
+++ b/NEWS
@@ -108,6 +108,9 @@ with all sufficient information, see the ChangeLog file.
* IO#wait_readable no longer checks FIONREAD, it may be used for
non-bytestream IO such as listen sockets.
+* timeout
+ * Object#timeout is now warned as deprecated when called.
+
=== Stdlib compatibility issues (excluding feature bug fixes)
* lib/webrick/utils.rb
diff --git a/lib/timeout.rb b/lib/timeout.rb
index fcb3a0c..5dd061c 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