From 972e4cc6f6190ba141da4a8a2151e63a1ab0f170 Mon Sep 17 00:00:00 2001
From: Luke Gruber <luke.gru@gmail.com>
Date: Thu, 18 Aug 2011 17:27:04 -0400
Subject: [PATCH] fix grammar mistakes and typos mainly in standard lib

---
 ext/json/lib/json.rb         |    8 ++--
 ext/json/lib/json/common.rb  |   64 +++++++++++++++++++++---------------------
 ext/pathname/lib/pathname.rb |    4 +-
 ext/pty/lib/expect.rb        |    2 +-
 lib/mathn.rb                 |   16 +++++-----
 lib/net/http.rb              |    4 +-
 lib/open-uri.rb              |   48 +++++++++++++++---------------
 lib/ostruct.rb               |    6 ++--
 lib/rdoc/markup.rb           |   12 ++++----
 lib/rdoc/parser.rb           |   10 +++---
 lib/tempfile.rb              |    2 +-
 lib/thread.rb                |    4 +-
 lib/weakref.rb               |    2 +-
 sample/webrick/httpproxy.rb  |    4 +-
 14 files changed, 93 insertions(+), 93 deletions(-)

diff --git a/ext/json/lib/json.rb b/ext/json/lib/json.rb
index d7bc1a2..00fe4ca 100644
--- a/ext/json/lib/json.rb
+++ b/ext/json/lib/json.rb
@@ -7,13 +7,13 @@
 #
 # Built on two universally available structures:
 #   1. A collection of name/value pairs. Often referred to as an _object_, hash table, record, struct, keyed list, or associative array.
-#   2. An orderd list of values. More commonly named as an _array_, vector, sequence, or list.
+#   2. An ordered list of values. More commonly called an _array_, vector, sequence or list.
 #
 # To read more about JSON visit: http://json.org
 #
 # == Parsing JSON
 #
-# To parse a JSON string received by another application, or generated within
+# To parse a JSON string received by another application or generated within
 # your existing application:
 #
 #   require 'json'
@@ -42,8 +42,8 @@
 #   puts {:hello => "goodbye"}.to_json => "{\"hello\":\"goodbye\"}"
 #
 # <tt>JSON.generate</tt> only allows objects or arrays to be converted
-# to JSON syntax. While <tt>to_json</tt> accepts many Ruby classes
-# even though it only acts a method for serialization:
+# to JSON syntax. <tt>to_json</tt>, however, accepts many Ruby classes
+# even though it acts only as a method for serialization:
 #
 #   require 'json'
 #
diff --git a/ext/json/lib/json/common.rb b/ext/json/lib/json/common.rb
index 1a5f048..bc8c952 100644
--- a/ext/json/lib/json/common.rb
+++ b/ext/json/lib/json/common.rb
@@ -2,11 +2,11 @@ require 'json/version'
 
 module JSON
   class << self
-    # If _object_ is string-like parse the string and return the parsed result
+    # If _object_ is string-like, parse the string and return the parsed result
     # as a Ruby data structure. Otherwise generate a JSON text from the Ruby
     # data structure object and return it.
     #
-    # The _opts_ argument is passed through to generate/parse respectively, see
+    # The _opts_ argument is passed through to generate/parse respectively. See
     # generate and parse for their documentation.
     def [](object, opts = {})
       if object.respond_to? :to_str
@@ -16,7 +16,7 @@ module JSON
       end
     end
 
-    # Returns the JSON parser class, that is used by JSON. This might be either
+    # Returns the JSON parser class that is used by JSON. This is either
     # JSON::Ext::Parser or JSON::Pure::Parser.
     attr_reader :parser
 
@@ -28,7 +28,7 @@ module JSON
     end
 
     # Return the constant located at _path_. The format of _path_ has to be
-    # either ::A::B::C or A::B::C. In any case A has to be located at the top
+    # either ::A::B::C or A::B::C. In any case, A has to be located at the top
     # level (absolute namespace path?). If there doesn't exist a constant at
     # the given path, an ArgumentError is raised.
     def deep_const_get(path) # :nodoc:
@@ -81,15 +81,15 @@ module JSON
       $VERBOSE = old
     end
 
-    # Returns the JSON generator modul, that is used by JSON. This might be
+    # Returns the JSON generator module that is used by JSON. This is
     # either JSON::Ext::Generator or JSON::Pure::Generator.
     attr_reader :generator
 
-    # Returns the JSON generator state class, that is used by JSON. This might
-    # be either JSON::Ext::Generator::State or JSON::Pure::Generator::State.
+    # Returns the JSON generator state class that is used by JSON. This is
+    # either JSON::Ext::Generator::State or JSON::Pure::Generator::State.
     attr_accessor :state
 
-    # This is create identifier, that is used to decide, if the _json_create_
+    # This is create identifier, which is used to decide if the _json_create_
     # hook of a class should be called. It defaults to 'json_class'.
     attr_accessor :create_id
   end
@@ -104,10 +104,10 @@ module JSON
   # The base exception for JSON errors.
   class JSONError < StandardError; end
 
-  # This exception is raised, if a parser error occurs.
+  # This exception is raised if a parser error occurs.
   class ParserError < JSONError; end
 
-  # This exception is raised, if the nesting of parsed datastructures is too
+  # This exception is raised if the nesting of parsed data structures is too
   # deep.
   class NestingError < ParserError; end
 
@@ -115,13 +115,13 @@ module JSON
   class CircularDatastructure < NestingError; end
   # :startdoc:
 
-  # This exception is raised, if a generator or unparser error occurs.
+  # This exception is raised if a generator or unparser error occurs.
   class GeneratorError < JSONError; end
   # For backwards compatibility
   UnparserError = GeneratorError
 
-  # This exception is raised, if the required unicode support is missing on the
-  # system. Usually this means, that the iconv library is not installed.
+  # This exception is raised if the required unicode support is missing on the
+  # system. Usually this means that the iconv library is not installed.
   class MissingUnicodeSupport < JSONError; end
 
   module_function
@@ -131,16 +131,16 @@ module JSON
   # _opts_ can have the following
   # keys:
   # * *max_nesting*: The maximum depth of nesting allowed in the parsed data
-  #   structures. Disable depth checking with :max_nesting => false, it defaults
+  #   structures. Disable depth checking with :max_nesting => false. It defaults
   #   to 19.
   # * *allow_nan*: If set to true, allow NaN, Infinity and -Infinity in
   #   defiance of RFC 4627 to be parsed by the Parser. This option defaults
   #   to false.
   # * *symbolize_names*: If set to true, returns symbols for the names
-  #   (keys) in a JSON object. Otherwise strings are returned, which is also
+  #   (keys) in a JSON object. Otherwise strings are returned. Strings are
   #   the default.
   # * *create_additions*: If set to false, the Parser doesn't create
-  #   additions even if a matchin class and create_id was found. This option
+  #   additions even if a matching class and create_id was found. This option
   #   defaults to true.
   # * *object_class*: Defaults to Hash
   # * *array_class*: Defaults to Array
@@ -149,19 +149,19 @@ module JSON
   end
 
   # Parse the JSON document _source_ into a Ruby data structure and return it.
-  # The bang version of the parse method, defaults to the more dangerous values
+  # The bang version of the parse method defaults to the more dangerous values
   # for the _opts_ hash, so be sure only to parse trusted _source_ documents.
   #
   # _opts_ can have the following keys:
   # * *max_nesting*: The maximum depth of nesting allowed in the parsed data
   #   structures. Enable depth checking with :max_nesting => anInteger. The parse!
-  #   methods defaults to not doing max depth checking: This can be dangerous,
+  #   methods defaults to not doing max depth checking: This can be dangerous
   #   if someone wants to fill up your stack.
   # * *allow_nan*: If set to true, allow NaN, Infinity, and -Infinity in
   #   defiance of RFC 4627 to be parsed by the Parser. This option defaults
   #   to true.
   # * *create_additions*: If set to false, the Parser doesn't create
-  #   additions even if a matchin class and create_id was found. This option
+  #   additions even if a matching class and create_id was found. This option
   #   defaults to true.
   def parse!(source, opts = {})
     opts = {
@@ -188,7 +188,7 @@ module JSON
   # * *object_nl*: a string that is put at the end of a JSON object (default: ''),
   # * *array_nl*: a string that is put at the end of a JSON array (default: ''),
   # * *allow_nan*: true if NaN, Infinity, and -Infinity should be
-  #   generated, otherwise an exception is thrown, if these values are
+  #   generated, otherwise an exception is thrown if these values are
   #   encountered. This options defaults to false.
   # * *max_nesting*: The maximum depth of nesting allowed in the data
   #   structures from which JSON is to be generated. Disable depth checking
@@ -196,7 +196,7 @@ module JSON
   #
   # See also the fast_generate for the fastest creation method with the least
   # amount of sanity checks, and the pretty_generate method for some
-  # defaults for a pretty output.
+  # defaults for pretty output.
   def generate(obj, opts = nil)
     state = SAFE_STATE_PROTOTYPE.dup
     if opts
@@ -223,7 +223,7 @@ module JSON
   # This method disables the checks for circles in Ruby objects.
   #
   # *WARNING*: Be careful not to pass any Ruby data structures with circles as
-  # _obj_ argument, because this will cause JSON to go into an infinite loop.
+  # _obj_ argument because this will cause JSON to go into an infinite loop.
   def fast_generate(obj, opts = nil)
     state = FAST_STATE_PROTOTYPE.dup
     if opts
@@ -249,7 +249,7 @@ module JSON
   # The returned document is a prettier form of the document returned by
   # #unparse.
   #
-  # The _opts_ argument can be used to configure the generator, see the
+  # The _opts_ argument can be used to configure the generator. See the
   # generate method for a more detailed explanation.
   def pretty_generate(obj, opts = nil)
     state = PRETTY_STATE_PROTOTYPE.dup
@@ -273,7 +273,7 @@ module JSON
   # :startdoc:
 
   # Load a ruby data structure from a JSON _source_ and return it. A source can
-  # either be a string-like object, an IO like object, or an object responding
+  # either be a string-like object, an IO-like object, or an object responding
   # to the read method. If _proc_ was given, it will be called with any nested
   # Ruby object as an argument recursively in depth first order.
   #
@@ -312,10 +312,10 @@ module JSON
   # Dumps _obj_ as a JSON string, i.e. calls generate on the object and returns
   # the result.
   #
-  # If anIO (an IO like object or an object that responds to the write method)
+  # If anIO (an IO-like object or an object that responds to the write method)
   # was given, the resulting JSON is written to it.
   #
-  # If the number of nested arrays or objects exceeds _limit_ an ArgumentError
+  # If the number of nested arrays or objects exceeds _limit_, an ArgumentError
   # exception is raised. This argument is similar (but not exactly the
   # same!) to the _limit_ argument in Marshal.dump.
   #
@@ -396,11 +396,11 @@ module ::Kernel
     nil
   end
 
-  # If _object_ is string-like parse the string and return the parsed result as
-  # a Ruby data structure. Otherwise generate a JSON text from the Ruby data
+  # If _object_ is string-like, parse the string and return the parsed result as
+  # a Ruby data structure. Otherwise, generate a JSON text from the Ruby data
   # structure object and return it.
   #
-  # The _opts_ argument is passed through to generate/parse respectively, see
+  # The _opts_ argument is passed through to generate/parse respectively. See
   # generate and parse for their documentation.
   def JSON(object, *args)
     if object.respond_to? :to_str
@@ -413,10 +413,10 @@ end
 
 # Extends any Class to include _json_creatable?_ method.
 class ::Class
-  # Returns true, if this class can be used to create an instance
+  # Returns true if this class can be used to create an instance
   # from a serialised JSON string. The class has to implement a class
-  # method _json_create_ that expects a hash as first parameter, which includes
-  # the required data.
+  # method _json_create_ that expects a hash as first parameter. The hash
+  # should include the required data.
   def json_creatable?
     respond_to?(:json_create)
   end
diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb
index 224c869..1d2b37c 100644
--- a/ext/pathname/lib/pathname.rb
+++ b/ext/pathname/lib/pathname.rb
@@ -386,7 +386,7 @@ class Pathname
   #   pn.children(false)
   #       # -> [ Pathname:English.rb, Pathname:Env.rb, Pathname:abbrev.rb, ... ]
   #
-  # Note that the result never contain the entries <tt>.</tt> and <tt>..</tt> in
+  # Note that the results never contain the entries <tt>.</tt> and <tt>..</tt> in
   # the directory because they are not children.
   #
   # This method has existed since 1.8.1.
@@ -490,7 +490,7 @@ class Pathname    # * Find *
   # manner.  It yields a Pathname for each file under "this" directory.
   #
   # Since it is implemented by <tt>find.rb</tt>, <tt>Find.prune</tt> can be used
-  # to control the traverse.
+  # to control the traversal.
   #
   # If +self+ is <tt>.</tt>, yielded pathnames begin with a filename in the
   # current directory, not <tt>./</tt>.
diff --git a/ext/pty/lib/expect.rb b/ext/pty/lib/expect.rb
index 0b238af..b992ed1 100644
--- a/ext/pty/lib/expect.rb
+++ b/ext/pty/lib/expect.rb
@@ -4,7 +4,7 @@ class IO
   # Reads ios until pattern matches or the timeout is over. It returns
   # an array with the read buffer, followed by the matches. If a block is given,
   # the result is yielded to the block and returns nil. The optional timeout parameter defines,
-  # in seconds, the total time to wait for pattern. If it is over of eof is found, it
+  # in seconds, the total time to wait for pattern. If it is over or eof is found, it
   # returns/yields nil. However, the buffer in a timeout session is kept for the next expect call.
   # The default timeout is 9999999 seconds.
   def expect(pat,timeout=9999999)
diff --git a/lib/mathn.rb b/lib/mathn.rb
index b1a959d..aae4620 100644
--- a/lib/mathn.rb
+++ b/lib/mathn.rb
@@ -28,7 +28,7 @@
 #   20 / 9 * 3 * 14 / 7 * 3 / 2 # => 20
 #
 #
-# When you require 'mathn' the libraries for Prime, CMath, Matrix and Vector
+# When you require 'mathn', the libraries for Prime, CMath, Matrix and Vector
 # are also loaded.
 #
 # == Copyright
@@ -53,8 +53,8 @@ unless defined?(Math.exp!)
 end
 
 ##
-# When mathn is required Fixnum's division and exponentiation are enhanced to
-# return more precise values in mathematical formulas.
+# When mathn is required, Fixnum's division and exponentiation are enhanced to
+# return more precise values from mathematical expressions.
 #
 #   2/3*3  # => 0
 #   require 'mathn'
@@ -87,7 +87,7 @@ end
 
 ##
 # When mathn is required Bignum's division and exponentiation are enhanced to
-# return more precise values in mathematical formulas.
+# return more precise values from mathematical expressions.
 
 class Bignum
   remove_method :/
@@ -115,7 +115,7 @@ class Bignum
 end
 
 ##
-# When mathn is required Rational changes to simplfy the usage of Rational
+# When mathn is required Rational is changed to simplify the use of Rational
 # operations.
 #
 # Normal behaviour:
@@ -198,14 +198,14 @@ class Rational
 end
 
 ##
-# When mathn is requried the Math module changes as follows:
+# When mathn is required, the Math module changes as follows:
 #
 # Standard Math module behaviour:
 #   Math.sqrt(4/9)     # => 0.0
 #   Math.sqrt(4.0/9.0) # => 0.666666666666667
 #   Math.sqrt(- 4/9)   # => Errno::EDOM: Numerical argument out of domain - sqrt
 #
-# After require 'mathn' this is changed to:
+# After require 'mathn', this is changed to:
 #
 #   require 'mathn'
 #   Math.sqrt(4/9)      # => 2/3
@@ -305,7 +305,7 @@ module Math
 end
 
 ##
-# When mathn is required Float is changed to handle Complex numbers.
+# When mathn is required, Float is changed to handle Complex numbers.
 
 class Float
   alias power! **
diff --git a/lib/net/http.rb b/lib/net/http.rb
index cd2c110..2172bfc 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -308,7 +308,7 @@ module Net   #:nodoc:
   # Here is HTTP response class hierarchy.  All classes are defined in Net
   # module and are subclasses of Net::HTTPResponse.
   #
-  # HTTPUnknownResponse:: For unhandled HTTP extenensions
+  # HTTPUnknownResponse:: For unhandled HTTP extensions
   # HTTPInformation::                    1xx
   #   HTTPContinue::                        100
   #   HTTPSwitchProtocol::                  101
@@ -514,7 +514,7 @@ module Net   #:nodoc:
     # Creates a new Net::HTTP object, then additionally opens the TCP
     # connection and HTTP session.
     #
-    # Argments are following:
+    # Arguments are the following:
     # _address_ :: hostname or IP address of the server
     # _port_    :: port of the server
     # _p_addr_  :: address of proxy
diff --git a/lib/open-uri.rb b/lib/open-uri.rb
index 4de5c43..70c1fb9 100644
--- a/lib/open-uri.rb
+++ b/lib/open-uri.rb
@@ -9,21 +9,21 @@ module Kernel
     alias open_uri_original_open open # :nodoc:
   end
 
-  # makes possible to open various resources including URIs.
-  # If the first argument respond to `open' method,
-  # the method is called with the rest arguments.
+  # Allows the opening of various resources including URIs.
+  # If the first argument responds to the `open' method,
+  # the first argument calls 'open', passing it the rest of the arguments.
   #
-  # 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.
+  # If the first argument is a string that begins with xxx://,
+  # it is parsed by URI.parse.  If the parsed object respond to the `open' method,
+  # the first argument calls 'open', passing it the rest of the arguments.
   #
-  # Otherwise original open is called.
+  # Otherwise, original 'open' is called.
   #
   # Since open-uri.rb provides URI::HTTP#open, URI::HTTPS#open and
   # URI::FTP#open,
-  # Kernel[#.]open can accepts such URIs and strings which begins with
+  # Kernel[#.]open can accept URIs and strings that begin with
   # http://, https:// and ftp://.
-  # In these case, the opened file object is extended by OpenURI::Meta.
+  # In these cases, the opened file object is extended by OpenURI::Meta.
   def open(name, *rest, &block) # :doc:
     if name.respond_to?(:open)
       name.open(*rest, &block)
@@ -42,14 +42,14 @@ end
 #
 #== Example
 #
-# It is possible to open http/https/ftp URL as usual like opening a file:
+# It is possible to open an http/https/ftp URL as though it were a file:
 #
 #   open("http://www.ruby-lang.org/") {|f|
 #     f.each_line {|line| p line}
 #   }
 #
-# The opened file has several methods for meta information as follows since
-# it is extended by OpenURI::Meta.
+# The opened file has several getter methods for its meta-information, as follows,
+# since it is extended by OpenURI::Meta.
 #
 #   open("http://www.ruby-lang.org/en") {|f|
 #     f.each_line {|line| p line}
@@ -407,14 +407,14 @@ module OpenURI
       end
     end
 
-    # returns an Array which consists status code and message.
+    # returns an Array that consists of status code and message.
     attr_accessor :status
 
-    # returns a URI which is base of relative URIs in the data.
-    # It may differ from the URI supplied by a user because redirection.
+    # returns a URI that is the base of relative URIs in the data.
+    # It may differ from the URI supplied by a user due to redirection.
     attr_accessor :base_uri
 
-    # returns a Hash which represents header fields.
+    # returns a Hash that represents header fields.
     # The Hash keys are downcased for canonicalization.
     attr_reader :meta
 
@@ -443,7 +443,7 @@ module OpenURI
       meta_setup_encoding if name == 'content-type'
     end
 
-    # returns a Time which represents Last-Modified field.
+    # returns a Time that represents Last-Modified field.
     def last_modified
       if v = @meta['last-modified']
         Time.httpdate(v)
@@ -537,11 +537,11 @@ module OpenURI
     #
     # `options' must be a hash.
     #
-    # Each pairs which key is a string in the hash specify a extra header
+    # Each pair whose key is a string in the hash specifies an extra header
     # field for HTTP.
     # I.e. it is ignored for FTP without HTTP proxy.
     #
-    # The hash may include other options which key is a symbol:
+    # The hash may include other options, where keys are symbols:
     #
     # [:proxy]
     #  Synopsis:
@@ -590,14 +590,14 @@ module OpenURI
     #
     #  If :content_length_proc option is specified, the option value procedure
     #  is called before actual transfer is started.
-    #  It takes one argument which is expected content length in bytes.
+    #  It takes one argument, which is expected content length in bytes.
     #
     #  If two or more transfer is done by HTTP redirection, the procedure
     #  is called only one for a last transfer.
     #
     #  When expected content length is unknown, the procedure is called with
     #  nil.
-    #  It is happen when HTTP response has no Content-Length header.
+    #  This happens when the HTTP response has no Content-Length header.
     #
     # [:progress_proc]
     #  Synopsis:
@@ -646,7 +646,7 @@ module OpenURI
     #
     #  :ssl_verify_mode is used to specify openssl verify mode.
     #
-    # OpenURI::OpenRead#open returns an IO like object if block is not given.
+    # OpenURI::OpenRead#open returns an IO-like object if block is not given.
     # Otherwise it yields the IO object and return the value of the block.
     # The IO object is extended with OpenURI::Meta.
     #
@@ -662,10 +662,10 @@ module OpenURI
     #  Synopsis:
     #    :redirect=>bool
     #
-    # :redirect=>false is used to disable HTTP redirects at all.
+    # :redirect=>false is used to disable all HTTP redirects.
     # OpenURI::HTTPRedirect exception raised on redirection.
     # It is true by default.
-    # The true means redirections between http and ftp is permitted.
+    # The true means redirections between http and ftp are permitted.
     #
     def open(*rest, &block)
       OpenURI.open_uri(self, *rest, &block)
diff --git a/lib/ostruct.rb b/lib/ostruct.rb
index f3b4608..3779b2d 100644
--- a/lib/ostruct.rb
+++ b/lib/ostruct.rb
@@ -11,7 +11,7 @@
 #
 # An OpenStruct is a data structure, similar to a Hash, that allows the
 # definition of arbitrary attributes with their accompanying values. This is
-# accomplished by using Ruby's metaporgramming to define methods on the class
+# accomplished by using Ruby's metaprogramming to define methods on the class
 # itself.
 #
 # == Examples:
@@ -72,8 +72,8 @@
 # method_missing and define_method.
 #
 # This should be a consideration if there is a concern about the performance of
-# the objects that are created. As there is much more overhead in the setting
-# of these properties compard to utilizing a Hash or a Struct.
+# the objects that are created, as there is much more overhead in the setting
+# of these properties compared to using a Hash or a Struct.
 #
 class OpenStruct
   #
diff --git a/lib/rdoc/markup.rb b/lib/rdoc/markup.rb
index 3dd2459..a23f003 100644
--- a/lib/rdoc/markup.rb
+++ b/lib/rdoc/markup.rb
@@ -36,7 +36,7 @@ require 'rdoc'
 # sequences, and to add special processing for text that matches a
 # regular expression.  Here we make WikiWords significant to the parser,
 # and also make the sequences {word} and \<no>text...</no> signify
-# strike-through text.  When then subclass the HTML output class to deal
+# strike-through text.  We then subclass the HTML output class to deal
 # with these:
 #
 #   require 'rdoc/markup'
@@ -61,7 +61,7 @@ require 'rdoc'
 #
 # == Encoding
 #
-# Where Encoding support is available RDoc will automatically convert all
+# Where Encoding support is available, RDoc will automatically convert all
 # documents to the same output encoding.  The output encoding can be set via
 # RDoc::Options#encoding and defaults to Encoding.default_external.
 #
@@ -127,7 +127,7 @@ require 'rdoc'
 # === Simple Lists
 #
 # If a paragraph starts with a "*", "-", "<digit>." or "<letter>.",
-# then it is taken to be the start of a list.  The margin in increased to be
+# then it is taken to be the start of a list.  The margin is increased to be
 # the first non-space following the list start flag.  Subsequent lines
 # should be indented to this new margin until the list ends.  For example:
 #
@@ -432,10 +432,10 @@ require 'rdoc'
 #
 # [+:nodoc:+ / <tt>:nodoc: all</tt>]
 #   This directive prevents documentation for the element from
-#   being generated.  For classes and modules, the methods, aliases,
+#   being generated.  For classes and modules, methods, aliases,
 #   constants, and attributes directly within the affected class or
 #   module also will be omitted.  By default, though, modules and
-#   classes within that class of module _will_ be documented.  This is
+#   classes within that class or module _will_ be documented.  This is
 #   turned off by adding the +all+ modifier.
 #
 #     module MyModule # :nodoc:
@@ -579,7 +579,7 @@ class RDoc::Markup
   attr_reader :attribute_manager
 
   ##
-  # Take a block of text and use various heuristics to determine it's
+  # Take a block of text and use various heuristics to determine its
   # structure (paragraphs, lists, and so on).  Invoke an event handler as we
   # identify significant chunks.
 
diff --git a/lib/rdoc/parser.rb b/lib/rdoc/parser.rb
index ba7b858..55d223c 100644
--- a/lib/rdoc/parser.rb
+++ b/lib/rdoc/parser.rb
@@ -4,7 +4,7 @@ require 'rdoc/markup/pre_process'
 require 'rdoc/stats'
 
 ##
-# A parser is simple a class that implements
+# A parser is simply a class that implements
 #
 #   #initialize(file_name, body, options)
 #
@@ -18,8 +18,8 @@ require 'rdoc/stats'
 #
 # The ParseFactory is used to redirect to the correct parser given a
 # filename extension. This magic works because individual parsers have to
-# register themselves with us as they are loaded in. The do this using the
-# following incantation
+# register themselves with us as they are loaded in. They do this by using the
+# following:
 #
 #   require "rdoc/parser"
 #
@@ -45,8 +45,8 @@ class RDoc::Parser
   class << self
 
     ##
-    # A Hash that maps file extensions regular expressions to parsers that
-    # will consume them.
+    # An Array of arrays that maps file extension patterns to parsers that
+    # will parse them.
     #
     # Use parse_files_matching to register a parser's file extensions.
 
diff --git a/lib/tempfile.rb b/lib/tempfile.rb
index 46a5605..22401b0 100644
--- a/lib/tempfile.rb
+++ b/lib/tempfile.rb
@@ -39,7 +39,7 @@ require 'thread'
 # that's it's unnecessary to explicitly delete a Tempfile after use, though
 # it's good practice to do so: not explicitly deleting unused Tempfiles can
 # potentially leave behind large amounts of tempfiles on the filesystem
-# until they're garbage collected. The existance of these temp files can make
+# until they're garbage collected. The existence of these temp files can make
 # it harder to determine a new Tempfile filename.
 #
 # Therefore, one should always call #unlink or close in an ensure block, like
diff --git a/lib/thread.rb b/lib/thread.rb
index 22dba2d..58c4f6b 100644
--- a/lib/thread.rb
+++ b/lib/thread.rb
@@ -94,7 +94,7 @@ class ConditionVariable
   # Wakes up all threads waiting for this lock.
   #
   def broadcast
-    # TODO: imcomplete
+    # TODO: incomplete
     waiters0 = nil
     @waiters_mutex.synchronize do
       waiters0 = @waiters.dup
@@ -144,7 +144,7 @@ class Queue
   def initialize
     @que = []
     @waiting = []
-    @que.taint          # enable tainted comunication
+    @que.taint          # enable tainted communication
     @waiting.taint
     self.taint
     @mutex = Mutex.new
diff --git a/lib/weakref.rb b/lib/weakref.rb
index efb8530..ee5444a 100644
--- a/lib/weakref.rb
+++ b/lib/weakref.rb
@@ -1,7 +1,7 @@
 require "delegate"
 require 'thread'
 
-# Weak Reference class that does allows a referenced object to be
+# Weak Reference class that allows a referenced object to be
 # garbage-collected.  A WeakRef may be used exactly like the object it
 # references.
 #
diff --git a/sample/webrick/httpproxy.rb b/sample/webrick/httpproxy.rb
index bca0cc4..ce8aa54 100644
--- a/sample/webrick/httpproxy.rb
+++ b/sample/webrick/httpproxy.rb
@@ -2,8 +2,8 @@ require "webrick"
 require "webrick/httpproxy"
 
 # :ProxyContentHandler will be invoked before sending
-# response to User-Agenge. You can inspect the pair of
-# request and response messages (or can edit the response
+# response to User-Agent. You can inspect the pair of
+# request and response messages (or edit the response
 # message if necessary).
 
 pch = Proc.new{|req, res|
-- 
1.7.5.1

