diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mathn.rb | 16 | ||||
-rw-r--r-- | lib/net/http.rb | 4 | ||||
-rw-r--r-- | lib/open-uri.rb | 56 | ||||
-rw-r--r-- | lib/ostruct.rb | 6 | ||||
-rw-r--r-- | lib/tempfile.rb | 2 | ||||
-rw-r--r-- | lib/thread.rb | 4 | ||||
-rw-r--r-- | lib/weakref.rb | 2 |
7 files changed, 44 insertions, 46 deletions
diff --git a/lib/mathn.rb b/lib/mathn.rb index b1a959d8f8..aae4620c3f 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 cd2c110f93..2172bfccc0 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 4de5c43462..d757bee17f 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 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 responds to the 'open' method, 'open' is called on + # it with the rest of the arguments. # - # Otherwise original open is called. + # If the first argument is a string that begins with xxx://, it is parsed by + # URI.parse. If the parsed object responds to the 'open' method, + # 'open' is called on it with the rest of the arguments. + # + # Otherwise, the original Kernel#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 - # http://, https:// and ftp://. - # In these case, the opened file object is extended by OpenURI::Meta. + # URI::FTP#open, Kernel[#.]open can accept URIs and strings that begin with + # http://, https:// and ftp://. 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 or 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 the Last-Modified field. def last_modified if v = @meta['last-modified'] Time.httpdate(v) @@ -537,11 +537,10 @@ module OpenURI # # `options' must be a hash. # - # Each pairs which key is a string in the hash specify a extra header - # field for HTTP. - # I.e. it is ignored for FTP without HTTP proxy. + # Each option pair with a string key 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 +589,13 @@ 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. + # nil. This happens when the HTTP response has no Content-Length header. # # [:progress_proc] # Synopsis: @@ -646,7 +644,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 +660,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 f3b4608ee8..3779b2dc00 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/tempfile.rb b/lib/tempfile.rb index 46a5605e52..22401b030c 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 22dba2dd79..58c4f6b9e6 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 efb853050d..ee5444a584 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. # |