diff options
-rw-r--r-- | lib/cgi/core.rb | 2 | ||||
-rw-r--r-- | lib/cmath.rb | 2 | ||||
-rw-r--r-- | lib/delegate.rb | 2 | ||||
-rw-r--r-- | lib/drb/ssl.rb | 2 | ||||
-rw-r--r-- | lib/forwardable.rb | 2 | ||||
-rw-r--r-- | lib/ipaddr.rb | 4 | ||||
-rw-r--r-- | lib/irb/init.rb | 2 | ||||
-rw-r--r-- | lib/irb/locale.rb | 2 | ||||
-rw-r--r-- | lib/matrix.rb | 16 | ||||
-rw-r--r-- | lib/net/ftp.rb | 4 | ||||
-rw-r--r-- | lib/net/http.rb | 2 | ||||
-rw-r--r-- | lib/net/http/generic_request.rb | 4 | ||||
-rw-r--r-- | lib/net/http/header.rb | 4 | ||||
-rw-r--r-- | lib/net/http/response.rb | 6 | ||||
-rw-r--r-- | lib/net/imap.rb | 12 | ||||
-rw-r--r-- | lib/ostruct.rb | 4 | ||||
-rw-r--r-- | lib/rexml/cdata.rb | 2 | ||||
-rw-r--r-- | lib/rexml/comment.rb | 2 | ||||
-rw-r--r-- | lib/rexml/element.rb | 2 | ||||
-rw-r--r-- | lib/rexml/instruction.rb | 2 | ||||
-rw-r--r-- | lib/rexml/node.rb | 2 | ||||
-rw-r--r-- | lib/rexml/text.rb | 2 | ||||
-rw-r--r-- | lib/rss/rss.rb | 5 | ||||
-rw-r--r-- | lib/tempfile.rb | 6 | ||||
-rw-r--r-- | lib/timeout.rb | 2 | ||||
-rw-r--r-- | lib/uri/common.rb | 8 | ||||
-rw-r--r-- | lib/uri/generic.rb | 2 | ||||
-rw-r--r-- | lib/webrick/server.rb | 2 | ||||
-rw-r--r-- | lib/webrick/utils.rb | 2 | ||||
-rw-r--r-- | lib/yaml.rb | 6 |
30 files changed, 55 insertions, 60 deletions
@@ -267,7 +267,7 @@ class CGI def _header_for_modruby(buf) #:nodoc: request = Apache::request buf.scan(/([^:]+): (.+)#{EOL}/o) do |name, value| - warn sprintf("name:%s value:%s\n", name, value) if $DEBUG case name when 'Set-Cookie' request.headers_out.add(name, value) @@ -50,7 +50,7 @@ module CMath atanh ].each do |meth| define_method(meth + '!') do |*args, &block| - warn("CMath##{meth}! is deprecated; use CMath##{meth} or Math##{meth}") if $VERBOSE RealMath.send(meth, *args, &block) end end @@ -97,7 +97,7 @@ class Delegator < BasicObject target = self.__getobj__ {r = false} r &&= target.respond_to?(m, include_private) if r && include_private && !target.respond_to?(m, false) - warn "#{caller(3, 1)[0]}: delegator does not forward private method \##{m}" return false end r @@ -336,7 +336,7 @@ module DRb end self.class.new(uri, ssl, @config, true) rescue OpenSSL::SSL::SSLError - warn("#{__FILE__}:#{__LINE__}: warning: #{$!.message} (#{$!.class})") if @config[:verbose] retry end end @@ -206,7 +206,7 @@ module Forwardable method_call = "#{<<-"begin;"}\n#{<<-"end;".chomp}" begin; unless defined? _.#{method} - ::Kernel.warn "\#{caller_locations(1)[0]}: "#{mesg.dump}"\#{_.class}"'##{method}' _#{method_call} else _.#{method}(*args, &block) @@ -310,7 +310,7 @@ class IPAddr # Returns true if the ipaddr is an IPv4-compatible IPv6 address. def ipv4_compat? - warn "#{caller(1, 1)[0]}: warning: IPAddr\##{__callee__} is obsolete" if $VERBOSE _ipv4_compat? end @@ -336,7 +336,7 @@ class IPAddr # Returns a new ipaddr built by converting the native IPv4 address # into an IPv4-compatible IPv6 address. def ipv4_compat - warn "#{caller(1, 1)[0]}: warning: IPAddr\##{__callee__} is obsolete" if $VERBOSE if !ipv4? raise InvalidAddressError, "not an IPv4 address" end @@ -277,7 +277,7 @@ module IRB # :nodoc: begin require m rescue LoadError => err - warn err.backtrace[0] << ":#{err.class}: #{err}" end end end @@ -31,7 +31,7 @@ module IRB # :nodoc: if @encoding_name begin load 'irb/encoding_aliases.rb'; rescue LoadError; end if @encoding = @@legacy_encoding_alias_map[@encoding_name] - warn "%s is obsolete. use %s" % ["#{@lang}_#{@territory}.#{@encoding_name}", "#{@lang}_#{@territory}.#{@encoding.name}"] end @encoding = Encoding.find(@encoding_name) rescue nil end @@ -1184,7 +1184,7 @@ class Matrix # deprecated; use Matrix#determinant # def determinant_e - warn "#{caller(1, 1)[0]}: warning: Matrix#determinant_e is deprecated; use #determinant" determinant end alias det_e determinant_e @@ -1242,7 +1242,7 @@ class Matrix # deprecated; use Matrix#rank # def rank_e - warn "#{caller(1, 1)[0]}: warning: Matrix#rank_e is deprecated; use #rank" rank end @@ -1435,17 +1435,17 @@ class Matrix end def elements_to_f - warn "#{caller(1, 1)[0]}: warning: Matrix#elements_to_f is deprecated, use map(&:to_f)" map(&:to_f) end def elements_to_i - warn "#{caller(1, 1)[0]}: warning: Matrix#elements_to_i is deprecated, use map(&:to_i)" map(&:to_i) end def elements_to_r - warn "#{caller(1, 1)[0]}: warning: Matrix#elements_to_r is deprecated, use map(&:to_r)" map(&:to_r) end @@ -2098,17 +2098,17 @@ class Vector end def elements_to_f - warn "#{caller(1, 1)[0]}: warning: Vector#elements_to_f is deprecated" map(&:to_f) end def elements_to_i - warn "#{caller(1, 1)[0]}: warning: Vector#elements_to_i is deprecated" map(&:to_i) end def elements_to_r - warn "#{caller(1, 1)[0]}: warning: Vector#elements_to_r is deprecated" map(&:to_r) end @@ -310,13 +310,13 @@ module Net # Obsolete def return_code # :nodoc: - $stderr.puts("warning: Net::FTP#return_code is obsolete and do nothing") return "\n" end # Obsolete def return_code=(s) # :nodoc: - $stderr.puts("warning: Net::FTP#return_code= is obsolete and do nothing") end # Constructs a socket with +host+ and +port+. @@ -708,7 +708,7 @@ module Net #:nodoc: # http.start { .... } # def set_debug_output(output) - warn 'Net::HTTP#set_debug_output called after HTTP started' if started? @debug_output = output end @@ -82,7 +82,7 @@ class Net::HTTPGenericRequest end def body_exist? - warn "Net::HTTPRequest#body_exist? is obsolete; use response_body_permitted?" if $VERBOSE response_body_permitted? end @@ -299,7 +299,7 @@ class Net::HTTPGenericRequest def supply_default_content_type return if content_type() - warn 'net/http: warning: Content-Type did not set; using application/x-www-form-urlencoded' if $VERBOSE set_content_type 'application/x-www-form-urlencoded' end @@ -14,9 +14,9 @@ module Net::HTTPHeader @header = {} return unless initheader initheader.each do |key, value| - warn "net/http: warning: duplicated HTTP header: #{key}" if key?(key) and $VERBOSE if value.nil? - warn "net/http: warning: nil HTTP header: #{key}" if $VERBOSE else @header[key.downcase] = [value.strip] end @@ -140,17 +140,17 @@ class Net::HTTPResponse # def response #:nodoc: - warn "#{caller(1, 1)[0]}: warning: Net::HTTPResponse#response is obsolete" if $VERBOSE self end def header #:nodoc: - warn "#{caller(1, 1)[0]}: warning: Net::HTTPResponse#header is obsolete" if $VERBOSE self end def read_header #:nodoc: - warn "#{caller(1, 1)[0]}: warning: Net::HTTPResponse#read_header is obsolete" if $VERBOSE self end @@ -2032,8 +2032,7 @@ module Net # generate a warning message to +stderr+, then return # the value of +subtype+. def media_subtype - $stderr.printf("warning: media_subtype is obsolete.\n") - $stderr.printf(" use subtype instead.\n") return subtype end end @@ -2060,8 +2059,7 @@ module Net # generate a warning message to +stderr+, then return # the value of +subtype+. def media_subtype - $stderr.printf("warning: media_subtype is obsolete.\n") - $stderr.printf(" use subtype instead.\n") return subtype end end @@ -2090,8 +2088,7 @@ module Net # generate a warning message to +stderr+, then return # the value of +subtype+. def media_subtype - $stderr.printf("warning: media_subtype is obsolete.\n") - $stderr.printf(" use subtype instead.\n") return subtype end end @@ -2151,8 +2148,7 @@ module Net # generate a warning message to +stderr+, then return # the value of +subtype+. def media_subtype - $stderr.printf("warning: media_subtype is obsolete.\n") - $stderr.printf(" use subtype instead.\n") return subtype end end @@ -162,7 +162,7 @@ class OpenStruct end private :modifiable? - # ::Kernel.warn("#{caller(1, 1)[0]}: do not use OpenStruct#modifiable") alias modifiable modifiable? # :nodoc: protected :modifiable @@ -181,7 +181,7 @@ class OpenStruct end private :new_ostruct_member! - # ::Kernel.warn("#{caller(1, 1)[0]}: do not use OpenStruct#new_ostruct_member") alias new_ostruct_member new_ostruct_member! # :nodoc: protected :new_ostruct_member @@ -58,7 +58,7 @@ module REXML # c = CData.new( " Some text " ) # c.write( $stdout ) #-> <![CDATA[ Some text ]]> def write( output=$stdout, indent=-1, transitive=false, ie_hack=false ) - Kernel.warn( "#{self.class.name}.write is deprecated" ) indent( output, indent ) output << START output << @string @@ -48,7 +48,7 @@ module REXML # ie_hack:: # Needed for conformity to the child API, but not used by this class. def write( output, indent=-1, transitive=false, ie_hack=false ) - Kernel.warn("Comment.write is deprecated. See REXML::Formatters") indent( output, indent ) output << START output << @string @@ -710,7 +710,7 @@ module REXML # doc.write( out ) #-> doc is written to the string 'out' # doc.write( $stdout ) #-> doc written to the console def write(output=$stdout, indent=-1, transitive=false, ie_hack=false) - Kernel.warn("#{self.class.name}.write is deprecated. See REXML::Formatters") formatter = if indent > -1 if transitive require "rexml/formatters/transitive" @@ -43,7 +43,7 @@ module REXML # See the rexml/formatters package # def write writer, indent=-1, transitive=false, ie_hack=false - Kernel.warn( "#{self.class.name}.write is deprecated" ) indent(writer, indent) writer << START.sub(/\\/u, '') writer << @target @@ -26,7 +26,7 @@ module REXML # REXML::Formatters package for changing the output style. def to_s indent=nil unless indent.nil? - Kernel.warn( "#{self.class.name}.to_s(indent) parameter is deprecated" ) f = REXML::Formatters::Pretty.new( indent ) f.write( self, rv = "" ) else @@ -293,7 +293,7 @@ module REXML # See REXML::Formatters # def write( writer, indent=-1, transitive=false, ie_hack=false ) - Kernel.warn("#{self.class.name}.write is deprecated. See REXML::Formatters") formatter = if indent > -1 REXML::Formatters::Pretty.new( indent ) else @@ -596,11 +596,10 @@ EOC def #{accessor_name}=(*args) receiver = self.class.name - warn("Warning:\#{caller.first.sub(/:in `.*'\z/, '')}: " \ - "Don't use `\#{receiver}\##{accessor_name} = XXX'/" \ "`\#{receiver}\#set_#{accessor_name}(XXX)'. " \ "Those APIs are not sense of Ruby. " \ - "Use `\#{receiver}\##{plural_name} << XXX' instead of them.") if args.size == 1 @#{accessor_name}.push(args[0]) else @@ -124,7 +124,7 @@ class Tempfile < DelegateClass(File) # If Tempfile.new cannot find a unique filename within a limited # number of tries, then it will raise an exception. def initialize(basename="", tmpdir=nil, mode: 0, **options) - warn "Tempfile.new doesn't call the given block." if block_given? @unlinked = false @mode = mode|File::RDWR|File::CREAT|File::EXCL @@ -250,7 +250,7 @@ class Tempfile < DelegateClass(File) def call(*args) return if @pid != Process.pid - warn "removing #{@tmpfile.path}..." if $DEBUG @tmpfile.close begin @@ -258,7 +258,7 @@ class Tempfile < DelegateClass(File) rescue Errno::ENOENT end - warn "done" if $DEBUG end end @@ -118,7 +118,7 @@ module Timeout end def timeout(*args, &block) - warn "#{caller_locations(1, 1)[0]}: Object##{__method__} is deprecated, use Timeout.timeout instead." Timeout.timeout(*args, &block) end @@ -100,7 +100,7 @@ module URI # # => "@%3F@%21" # def escape(*arg) - warn "#{caller(1, 1)[0]}: warning: URI.escape is obsolete" if $VERBOSE DEFAULT_PARSER.escape(*arg) end alias encode escape @@ -132,7 +132,7 @@ module URI # # => "http://example.com/?a=\t\r" # def unescape(*arg) - warn "#{caller(1, 1)[0]}: warning: URI.unescape is obsolete" if $VERBOSE DEFAULT_PARSER.unescape(*arg) end alias decode unescape @@ -300,7 +300,7 @@ module URI # # => ["http://foo.example.com/bla", "mailto:[email protected]"] # def self.extract(str, schemes = nil, &block) - warn "#{caller(1, 1)[0]}: warning: URI.extract is obsolete" if $VERBOSE DEFAULT_PARSER.extract(str, schemes, &block) end @@ -336,7 +336,7 @@ module URI # end # def self.regexp(schemes = nil) - warn "#{caller(1, 1)[0]}: warning: URI.regexp is obsolete" if $VERBOSE DEFAULT_PARSER.make_regexp(schemes) end @@ -1517,7 +1517,7 @@ module URI elsif name == 'http_proxy' unless proxy_uri = env[name] if proxy_uri = env[name.upcase] - warn 'The environment variable HTTP_PROXY is discouraged. Use http_proxy.' end end else @@ -103,7 +103,7 @@ module WEBrick @shutdown_pipe = nil unless @config[:DoNotListen] if @config[:Listen] - warn(":Listen option is deprecated; use GenericServer#listen") end listen(@config[:BindAddress], @config[:Port]) if @config[:Port] == 0 @@ -37,7 +37,7 @@ module WEBrick Process::Sys::setgid(pw.gid) Process::Sys::setuid(pw.uid) else - warn("WEBrick::Utils::su doesn't work on this platform") end end module_function :su @@ -5,9 +5,9 @@ begin require 'psych' rescue LoadError - warn "#{caller[0]}:" - warn "It seems your ruby installation is missing psych (for YAML output)." - warn "To eliminate this warning, please install libyaml and reinstall your ruby." raise end |