From 6abca35457d4e16b561fed8b7936b06068b33697 Mon Sep 17 00:00:00 2001 From: akr Date: Wed, 7 Jan 2004 11:31:21 +0000 Subject: fix typos. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/open-uri.rb | 14 +++++++------- lib/pp.rb | 6 +++--- lib/prettyprint.rb | 4 ++-- lib/time.rb | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) (limited to 'lib') diff --git a/lib/open-uri.rb b/lib/open-uri.rb index 116644ce07..e448e47af5 100644 --- a/lib/open-uri.rb +++ b/lib/open-uri.rb @@ -66,7 +66,7 @@ module Kernel # If the first argument respond to `open' method, # the method is called with the rest arguments. # - # If the first argument is a string and begins with xxx://, + # If the first argument is a string which begins with xxx://, # it is parsed by URI.parse. If the parsed object respond to `open' method, # the method is called with the rest arguments. # @@ -79,7 +79,7 @@ module Kernel def open(name, *rest, &block) if name.respond_to?(:open) name.open(*rest, &block) - elsif name.respond_to?("to_str") && + elsif name.respond_to?(:to_str) && %r{\A[A-Za-z][A-Za-z0-9+\-\.]*://} =~ name && (uri = URI.parse(name)).respond_to?(:open) uri.open(*rest, &block) @@ -250,7 +250,7 @@ module OpenURI end end - # returns an Array which consits status code and message. + # returns an Array which consists status code and message. attr_accessor :status # returns a URI which is base of relative URIs in the data. @@ -449,14 +449,14 @@ module URI # But http_proxy and HTTP_PROXY is treated specially under CGI environment. # It's because HTTP_PROXY may be set by Proxy: header. # So HTTP_PROXY is not used. - # http_proxy is not used too if the variable is case insentitive. + # http_proxy is not used too if the variable is case insensitive. # CGI_HTTP_PROXY can be used instead. def find_proxy name = self.scheme.downcase + '_proxy' proxy_uri = nil if name == 'http_proxy' && ENV.include?('REQUEST_METHOD') # CGI? # HTTP_PROXY conflicts with *_proxy for proxy settings and - # HTTP_* for header informatin in CGI. + # HTTP_* for header information in CGI. # So it should be careful to use it. pairs = ENV.reject {|k, v| /\Ahttp_proxy\z/i !~ k } case pairs.length @@ -465,12 +465,12 @@ module URI when 1 k, v = pairs.shift if k == 'http_proxy' && ENV[k.upcase] == nil - # http_proxy is safe to use becase ENV is case sensitive. + # http_proxy is safe to use because ENV is case sensitive. proxy_uri = ENV[name] else proxy_uri = nil end - else # http_proxy is safe to use becase ENV is case sensitive. + else # http_proxy is safe to use because ENV is case sensitive. proxy_uri = ENV[name] end if !proxy_uri diff --git a/lib/pp.rb b/lib/pp.rb index 03d9248218..c366e25932 100644 --- a/lib/pp.rb +++ b/lib/pp.rb @@ -51,8 +51,8 @@ PP#pp to print the object. outputs ((|obj|)) to ((|out|)) in pretty printed format of ((|width|)) columns in width. - If ((|out|)) is ommitted, (({$>})) is assumed. - If ((|width|)) is ommitted, 79 is assumed. + If ((|out|)) is omitted, (({$>})) is assumed. + If ((|width|)) is omitted, 79 is assumed. PP.pp returns ((|out|)). @@ -269,7 +269,7 @@ class PP < PrettyPrint def pretty_print_inspect if /\(PP::ObjectMixin\)#/ =~ method(:pretty_print).inspect - raise "pretty_print is not overriden." + raise "pretty_print is not overridden." end PP.singleline_pp(self, '') end diff --git a/lib/prettyprint.rb b/lib/prettyprint.rb index 0aa54e91f9..70b6da7924 100644 --- a/lib/prettyprint.rb +++ b/lib/prettyprint.rb @@ -7,14 +7,14 @@ It finds line breaks and nice indentations for grouped structure. By default, the class assumes that primitive elements are strings and each byte in the strings have single column in width. -But it can be used for other situasions +But it can be used for other situations by giving suitable arguments for some methods: newline object and space generation block for (({PrettyPrint.new})), optional width argument for (({PrettyPrint#text})), (({PrettyPrint#breakable})), etc. There are several candidates to use them: text formatting using proportional fonts, -multibyte characters which has columns diffrent to number of bytes, +multibyte characters which has columns different to number of bytes, non-string formatting, etc. == class methods diff --git a/lib/time.rb b/lib/time.rb index 9d2ac558d9..17f30e34c6 100644 --- a/lib/time.rb +++ b/lib/time.rb @@ -13,7 +13,7 @@ # # === Specialized interface # -# This library provides methods dedicated to special puposes: +# This library provides methods dedicated to special purposes: # * RFC 2822, RFC 2616 and XML Schema. # * They makes usual life easier. # @@ -353,7 +353,7 @@ class Time # If self is a UTC time, Z is used as TZD. [+-]hh:mm is used otherwise. # # +fractional_seconds+ specifies a number of digits of fractional seconds. - # Its default value os 0. + # Its default value is 0. # def xmlschema(fraction_digits=0) sprintf('%d-%02d-%02dT%02d:%02d:%02d', -- cgit v1.2.3