From: Ian Macdonald Date: 2004-03-29T16:04:37+09:00 Subject: one more round of exception message clean-up --ieNMXl1Fr3cevapt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello, Here is a patch against the latest CVS that cleans up the exception messages in the *.rb files. Spelling and grammar mistakes have been corrected and the English now sounds a little more natural. Regards, Ian -- Ian Macdonald | An editor is one who separates the wheat System Administrator | from the chaff and prints the chaff. -- ian@caliban.org | Adlai Stevenson http://www.caliban.org | | --ieNMXl1Fr3cevapt Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="cleanup.diff" Index: lib/cgi.rb =================================================================== RCS file: /src/ruby/lib/cgi.rb,v retrieving revision 1.72 diff -u -r1.72 cgi.rb --- lib/cgi.rb 13 Feb 2004 16:15:54 -0000 1.72 +++ lib/cgi.rb 29 Mar 2004 06:59:08 -0000 @@ -30,7 +30,7 @@ # See http://www.w3.org/CGI/ for more information on the CGI # protocol. -raise "Please, use ruby1.5.4 or later." if RUBY_VERSION < "1.5.4" +raise "Please, use Ruby 1.5.4 or later." if RUBY_VERSION < "1.5.4" require 'English' Index: lib/csv.rb =================================================================== RCS file: /src/ruby/lib/csv.rb,v retrieving revision 1.5 diff -u -r1.5 csv.rb --- lib/csv.rb 16 Feb 2004 14:41:49 -0000 1.5 +++ lib/csv.rb 29 Mar 2004 06:59:09 -0000 @@ -557,7 +557,7 @@ private def initialize(dev) - raise RuntimeError.new('do not instanciate this class directly') + raise RuntimeError.new('do not instantiate this class directly') end def get_row(row) @@ -709,7 +709,7 @@ private def initialize(dev) - raise RuntimeError.new('do not instanciate this class directly') + raise RuntimeError.new('do not instantiate this class directly') end def terminate @@ -801,7 +801,7 @@ # end # end # - class StreamBuf # pure virtual. (do not instanciate it directly) + class StreamBuf # pure virtual. (do not instantiate it directly) # get a char or a partial string from the stream. # idx: index of a string to specify a start point of a string to get. @@ -893,7 +893,7 @@ return idx_is_eos?(0) end - # WARN: Do not instanciate this class directly. Define your own class + # WARN: Do not instantiate this class directly. Define your own class # which derives this class and define 'read' instance method. def initialize @buf_list = [] Index: lib/generator.rb =================================================================== RCS file: /src/ruby/lib/generator.rb,v retrieving revision 1.3 diff -u -r1.3 generator.rb --- lib/generator.rb 16 Feb 2004 13:24:07 -0000 1.3 +++ lib/generator.rb 29 Mar 2004 06:59:09 -0000 @@ -125,7 +125,7 @@ # Returns the element at the current position and moves forward. def next() if end? - raise EOFError, "no more element is supplied" + raise EOFError, "no more elements available" end if @cont_next = callcc { |c| c } @@ -140,7 +140,7 @@ # Returns the element at the current position. def current() if @queue.empty? - raise EOFError, "no more element is supplied" + raise EOFError, "no more elements available" end @queue.first Index: lib/open-uri.rb =================================================================== RCS file: /src/ruby/lib/open-uri.rb,v retrieving revision 1.22 diff -u -r1.22 open-uri.rb --- lib/open-uri.rb 27 Mar 2004 12:43:01 -0000 1.22 +++ lib/open-uri.rb 29 Mar 2004 06:59:09 -0000 @@ -501,7 +501,7 @@ if proxy_uri proxy_uri = URI.parse(proxy_uri) unless URI::HTTP === proxy_uri - raise "Non-http proxy URI: #{proxy_uri}" + raise "Non-HTTP proxy URI: #{proxy_uri}" end name = 'no_proxy' if no_proxy = ENV[name] || ENV[name.upcase] Index: lib/ostruct.rb =================================================================== RCS file: /src/ruby/lib/ostruct.rb,v retrieving revision 1.10 diff -u -r1.10 ostruct.rb --- lib/ostruct.rb 20 Feb 2004 10:11:25 -0000 1.10 +++ lib/ostruct.rb 29 Mar 2004 06:59:09 -0000 @@ -63,7 +63,7 @@ len = args.length if mname =~ /=$/ if len != 1 - raise ArgumentError, "wrong # of arguments (#{len} for 1)", caller(1) + raise ArgumentError, "wrong number of arguments (#{len} for 1)", caller(1) end if self.frozen? raise TypeError, "can't modify frozen #{self.class}", caller(1) Index: lib/rational.rb =================================================================== RCS file: /src/ruby/lib/rational.rb,v retrieving revision 1.13 diff -u -r1.13 rational.rb --- lib/rational.rb 17 Jul 2003 08:58:16 -0000 1.13 +++ lib/rational.rb 29 Mar 2004 06:59:09 -0000 @@ -48,7 +48,7 @@ @RCS_ID='-$Id: rational.rb,v 1.7 1999/08/24 12:49:28 keiju Exp keiju $-' def Rational.reduce(num, den = 1) - raise ZeroDivisionError, "denominator is 0" if den == 0 + raise ZeroDivisionError, "denominator is zero" if den == 0 if den < 0 num = -num @@ -135,7 +135,7 @@ den = @denominator * a.numerator Rational(num, den) elsif a.kind_of?(Integer) - raise ZeroDivisionError, "divided by 0" if a == 0 + raise ZeroDivisionError, "division by zero" if a == 0 self / Rational.new!(a, 1) elsif a.kind_of?(Float) Float(self) / a Index: lib/resolv.rb =================================================================== RCS file: /src/ruby/lib/resolv.rb,v retrieving revision 1.17 diff -u -r1.17 resolv.rb --- lib/resolv.rb 16 Oct 2003 17:47:18 -0000 1.17 +++ lib/resolv.rb 29 Mar 2004 06:59:11 -0000 @@ -1157,9 +1157,9 @@ @limit = @index + len d = yield(len) if @index < @limit - raise DecodeError.new("junk exist") + raise DecodeError.new("junk exists") elsif @limit < @index - raise DecodeError.new("limit exceed") + raise DecodeError.new("limit exceeded") end @limit = save_limit return d @@ -1185,7 +1185,7 @@ raise StandardError.new("unsupported template: '#{byte.chr}' in '#{template}'") end } - raise DecodeError.new("limit exceed") if @limit < @index + len + raise DecodeError.new("limit exceeded") if @limit < @index + len arr = @data.unpack("@#{@index}#{template}") @index += len return arr @@ -1193,7 +1193,7 @@ def get_string len = @data[@index] - raise DecodeError.new("limit exceed") if @limit < @index + 1 + len + raise DecodeError.new("limit exceeded") if @limit < @index + 1 + len d = @data[@index + 1, len] @index += 1 + len return d @@ -1554,7 +1554,7 @@ raise ArgumentError.new("IPv4 address with invalid value: " + arg) end else - raise ArgumentError.new("cannot interprete as IPv4 address: #{arg.inspect}") + raise ArgumentError.new("cannot interpret as IPv4 address: #{arg.inspect}") end end @@ -1662,7 +1662,7 @@ end return IPv6.new(address) else - raise ArgumentError.new("cannot interprete as IPv6 address: #{arg.inspect}") + raise ArgumentError.new("cannot interpret as IPv6 address: #{arg.inspect}") end end Index: lib/net/http.rb =================================================================== RCS file: /src/ruby/lib/net/http.rb,v retrieving revision 1.114 diff -u -r1.114 http.rb --- lib/net/http.rb 8 Mar 2004 14:16:21 -0000 1.114 +++ lib/net/http.rb 29 Mar 2004 06:59:12 -0000 @@ -121,7 +121,7 @@ # # def fetch( uri_str, limit = 10 ) # # You should choose better exception. - # raise ArgumentError, 'http redirect too deep' if limit == 0 + # raise ArgumentError, 'HTTP redirect too deep' if limit == 0 # # response = Net::HTTP.get_response(URI.parse(uri_str)) # case response @@ -480,7 +480,7 @@ # Finishes HTTP session and closes TCP connection. # Raises IOError if not started. def finish - raise IOError, 'HTTP session not started yet' unless started? + raise IOError, 'HTTP session not yet started' unless started? do_finish end @@ -2058,11 +2058,11 @@ end def stream_check - raise IOError, 'try to read body out of block' if @socket.closed? + raise IOError, 'attempt to read body out of block' if @socket.closed? end def procdest(dest, block) - raise ArgumentError, 'both of arg and block are given for HTTP method' \ + raise ArgumentError, 'both arg and block given for HTTP method' \ if dest and block if block ReadAdapter.new(block) Index: lib/net/https.rb =================================================================== RCS file: /src/ruby/lib/net/https.rb,v retrieving revision 1.1 diff -u -r1.1 https.rb --- lib/net/https.rb 6 Mar 2004 17:08:21 -0000 1.1 +++ lib/net/https.rb 29 Mar 2004 06:59:12 -0000 @@ -123,7 +123,7 @@ # a Net::HTTP object raises IOError. def use_ssl=(flag) flag = (flag ? true : false) - raise IOError, "use_ssl value changed but session already started" \ + raise IOError, "use_ssl value changed, but session already started" \ if started? and @use_ssl != flag if flag and not @ssl_context @ssl_context = OpenSSL::SSL::SSLContext.new Index: lib/net/pop.rb =================================================================== RCS file: /src/ruby/lib/net/pop.rb,v retrieving revision 1.67 diff -u -r1.67 pop.rb --- lib/net/pop.rb 28 Mar 2004 05:23:13 -0000 1.67 +++ lib/net/pop.rb 29 Mar 2004 06:59:13 -0000 @@ -293,7 +293,7 @@ # This method must not be called while POP3 session is opened. # This method raises POPAuthenticationError if authentication fails. def auth_only(account, password) - raise IOError, 'opening already opened POP session' if started? + raise IOError, 'opening previously opened POP session' if started? start(account, password) { ; } @@ -449,7 +449,7 @@ # Finishes a POP3 session and closes TCP connection. def finish - raise IOError, 'POP session not started yet' unless started? + raise IOError, 'POP session not yet started' unless started? do_finish end @@ -754,7 +754,7 @@ end def apop(account, password) - raise POPAuthenticationError, 'not APOP server; cannot login' \ + raise POPAuthenticationError, 'not APOP server; cannot log in' \ unless @apop_stamp check_response_auth(critical { get_response('APOP %s %s', Index: lib/net/smtp.rb =================================================================== RCS file: /src/ruby/lib/net/smtp.rb,v retrieving revision 1.70 diff -u -r1.70 smtp.rb --- lib/net/smtp.rb 6 Mar 2004 17:08:21 -0000 1.70 +++ lib/net/smtp.rb 29 Mar 2004 06:59:13 -0000 @@ -373,7 +373,7 @@ # Finishes the SMTP session and closes TCP connection. # Raises IOError if not started. def finish - raise IOError, 'not started yet' unless started? + raise IOError, 'not yet started' unless started? do_finish end @@ -474,7 +474,7 @@ def send0( from_addr, to_addrs ) raise IOError, 'closed session' unless @socket - raise ArgumentError, 'mail destination does not given' if to_addrs.empty? + raise ArgumentError, 'mail destination not given' if to_addrs.empty? if $SAFE > 0 raise SecurityError, 'tainted from_addr' if from_addr.tainted? to_addrs.each do |to| @@ -501,7 +501,7 @@ private def check_auth_args( user, secret, authtype ) - raise ArgumentError, 'both of user and secret are required'\ + raise ArgumentError, 'both user and secret are required'\ unless user and secret auth_method = "auth_#{authtype || 'cram_md5'}" raise ArgumentError, "wrong auth type #{authtype}"\ Index: lib/wsdl/operation.rb =================================================================== RCS file: /src/ruby/lib/wsdl/operation.rb,v retrieving revision 1.2 diff -u -r1.2 operation.rb --- lib/wsdl/operation.rb 25 Nov 2003 07:31:30 -0000 1.2 +++ lib/wsdl/operation.rb 29 Mar 2004 06:59:14 -0000 @@ -119,7 +119,7 @@ return parts.dup end if parts.length != result.length - raise RuntimeError.new("Incomplete prarmeterOrder list.") + raise RuntimeError.new("Incomplete parameter order list.") end result end Index: lib/xmlrpc/parser.rb =================================================================== RCS file: /src/ruby/lib/xmlrpc/parser.rb,v retrieving revision 1.3 diff -u -r1.3 parser.rb --- lib/xmlrpc/parser.rb 11 Nov 2003 13:08:16 -0000 1.3 +++ lib/xmlrpc/parser.rb 29 Mar 2004 06:59:14 -0000 @@ -467,7 +467,7 @@ else # is a normal return value raise "Missing return value!" if parser.params.size == 0 - raise "To many return values. Only one allowed!" if parser.params.size > 1 + raise "Too many return values. Only one allowed!" if parser.params.size > 1 [true, parser.params[0]] end end --ieNMXl1Fr3cevapt--