summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-03-07 00:20:16 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-03-07 00:20:16 +0000
commitcde930a4a4005da1d8e1a1ced719433fd07e3d3f (patch)
treee196d0de10c091187b6d93225d2d9b0cd51ae0dc /lib
parent1c536c2a98fabbe6e5af65eea61617e2df06091c (diff)
* string.c (rb_str_cmp_m): should not return false but nil.
fixed: [ruby-dev:25811] * lib/cgi-lib.rb: add deprecation warning. [ruby-dev:25499] getopts.rb, parsearg.rb, importenv.rb as well. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/cgi-lib.rb2
-rw-r--r--lib/cgi/session.rb4
-rw-r--r--lib/date.rb2
-rw-r--r--lib/getopts.rb2
-rw-r--r--lib/importenv.rb2
-rw-r--r--lib/parsearg.rb2
6 files changed, 11 insertions, 3 deletions
diff --git a/lib/cgi-lib.rb b/lib/cgi-lib.rb
index bc780ffc4e..d6b60d66cc 100644
--- a/lib/cgi-lib.rb
+++ b/lib/cgi-lib.rb
@@ -1,3 +1,5 @@
+warn "Warning:#{caller[0].sub(/:in `.*'\z/, '')}: cgi-lib is deprecated after Ruby 1.8.1; use cgi instead"
+
=begin
= simple CGI support library
diff --git a/lib/cgi/session.rb b/lib/cgi/session.rb
index e475bd94c7..562e571cd5 100644
--- a/lib/cgi/session.rb
+++ b/lib/cgi/session.rb
@@ -155,8 +155,8 @@ class CGI
#
class Session
- #:nodoc:
- class NoSession < RuntimeError; end
+ class NoSession < RuntimeError #:nodoc:
+ end
# The id of this session.
attr_reader :session_id, :new_session
diff --git a/lib/date.rb b/lib/date.rb
index 0ae368fb98..c2070760ad 100644
--- a/lib/date.rb
+++ b/lib/date.rb
@@ -1258,7 +1258,7 @@ class DateTime < Date
new_with_hash(elem, sg)
end
- class << self; undef_method :today end
+ class << self; undef_method :today end rescue nil
# Create a new DateTime object representing the current time.
#
diff --git a/lib/getopts.rb b/lib/getopts.rb
index 34fb0d6442..f63bbfef6f 100644
--- a/lib/getopts.rb
+++ b/lib/getopts.rb
@@ -15,6 +15,8 @@
# rewritten by Akinori MUSHA <knu@ruby-lang.org>
#
+warn "Warning:#{caller[0].sub(/:in `.*'\z/, '')}: getopts is deprecated after Ruby 1.8.1; use optparse instead" if caller[0]
+
$RCS_ID=%q$Header$
diff --git a/lib/importenv.rb b/lib/importenv.rb
index 435d6f972a..8e1ba33b1d 100644
--- a/lib/importenv.rb
+++ b/lib/importenv.rb
@@ -7,6 +7,8 @@
# $USER = "matz"
# p ENV["USER"]
+warn "Warning:#{caller[0].sub(/:in `.*'\z/, '')}: importenv is deprecated after Ruby 1.8.1 (no replacement)"
+
for k,v in ENV
next unless /^[a-zA-Z][_a-zA-Z0-9]*/ =~ k
eval <<EOS
diff --git a/lib/parsearg.rb b/lib/parsearg.rb
index d5f3c9638d..9c67aca43e 100644
--- a/lib/parsearg.rb
+++ b/lib/parsearg.rb
@@ -10,6 +10,8 @@
#
#
+warn "Warning:#{caller[0].sub(/:in `.*'\z/, '')}: parsearg is deprecated after Ruby 1.8.1; use optparse instead"
+
$RCS_ID=%q$Header$
require "getopts"