diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-05-07 08:48:30 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-05-07 08:48:30 +0000 |
commit | 2b5a14bf7c96fcda9ff6cd9bbdd83d9294a0d354 (patch) | |
tree | 1c5e740fcd47bdb4adeefd007c7e393054eff8f2 /lib | |
parent | 4d372569d874b10db980fe4bd10bf8cfee585a55 (diff) |
* eval.c (rb_eval): too many line trace call. (ruby-bugs PR#1320)
* numeric.c (flo_to_s): tweak output string based to preserve
decimal point and to remove trailing zeros. [ruby-talk:97891]
* string.c (rb_str_index_m): use unsigned comparison for T_FIXNUM
search. [ruby-talk:97342]
* hash.c (rb_hash_equal): returns true if two hashes have same set
of key-value set. [ruby-talk:97559]
* hash.c (rb_hash_eql): returns true if two hashes are equal and
have same default values.
* string.c (rb_str_equal): always returns true or false, never
returns nil. [ruby-dev:23404]
* io.c (rb_io_reopen): should use rb_io_check_io().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cgi.rb | 2 | ||||
-rw-r--r-- | lib/csv.rb | 8 | ||||
-rw-r--r-- | lib/generator.rb | 4 | ||||
-rw-r--r-- | lib/logger.rb | 1 | ||||
-rw-r--r-- | lib/ostruct.rb | 2 | ||||
-rw-r--r-- | lib/rational.rb | 4 | ||||
-rw-r--r-- | lib/singleton.rb | 20 | ||||
-rw-r--r-- | lib/tempfile.rb | 2 | ||||
-rw-r--r-- | lib/test/unit/testcase.rb | 4 |
9 files changed, 25 insertions, 22 deletions
diff --git a/lib/cgi.rb b/lib/cgi.rb index 73e4915308..460a8b8868 100644 --- a/lib/cgi.rb +++ b/lib/cgi.rb @@ -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' diff --git a/lib/csv.rb b/lib/csv.rb index 5500fb55bb..3eb13192fe 100644 --- a/lib/csv.rb +++ b/lib/csv.rb @@ -557,7 +557,7 @@ class CSV 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 @@ class CSV 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 @@ class CSV # 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 @@ class CSV 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 = [] diff --git a/lib/generator.rb b/lib/generator.rb index 805e7a2630..a010559b60 100644 --- a/lib/generator.rb +++ b/lib/generator.rb @@ -125,7 +125,7 @@ class Generator # 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 @@ class Generator # 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 diff --git a/lib/logger.rb b/lib/logger.rb index d3ce495f17..6c1e492f4e 100644 --- a/lib/logger.rb +++ b/lib/logger.rb @@ -539,6 +539,7 @@ private def create_logfile(filename) logdev = open(filename, (File::WRONLY | File::APPEND | File::CREAT)) + logdev.sync = true add_log_header(logdev) logdev end diff --git a/lib/ostruct.rb b/lib/ostruct.rb index 786bd4de20..d603c04759 100644 --- a/lib/ostruct.rb +++ b/lib/ostruct.rb @@ -57,7 +57,7 @@ class OpenStruct 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) diff --git a/lib/rational.rb b/lib/rational.rb index 38af7b8a81..2019363ac6 100644 --- a/lib/rational.rb +++ b/lib/rational.rb @@ -48,7 +48,7 @@ class Rational < Numeric @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 @@ class Rational < Numeric 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 diff --git a/lib/singleton.rb b/lib/singleton.rb index 2954bfa153..18fda0bc58 100644 --- a/lib/singleton.rb +++ b/lib/singleton.rb @@ -13,7 +13,7 @@ # a == b # => true # a.new # NoMethodError - new is private ... # -# * ``The instance'' is created at instanciation time, in other +# * ``The instance'' is created at instantiation time, in other # words the first call of Klass.instance(), thus # # class OtherKlass @@ -44,11 +44,11 @@ # # * Klass._load(str) - calling Klass.instance() # -# * Klass._instanciate?() - returning ``the instance'' or +# * Klass._instantiate?() - returning ``the instance'' or # nil. This hook method puts a second (or nth) thread calling # Klass.instance() on a waiting loop. The return value # signifies the successful completion or premature termination -# of the first, or more generally, current "instanciation thread". +# of the first, or more generally, current "instantiation thread". # # # The instance method of Singleton are @@ -103,7 +103,7 @@ class << Singleton @__instance__ = nil # failed instance creation end end - elsif _instanciate?() + elsif _instantiate?() Thread.critical = false else @__instance__ = false @@ -144,7 +144,7 @@ class << Singleton end # waiting-loop hook - def _instanciate?() + def _instantiate?() while false.equal?(@__instance__) Thread.critical = false sleep(0.08) # timeout @@ -209,7 +209,7 @@ end -puts "\nThreaded example with exception and customized #_instanciate?() hook"; p +puts "\nThreaded example with exception and customized #_instantiate?() hook"; p Thread.abort_on_exception = false class Ups < SomeSingletonClass @@ -220,7 +220,7 @@ class Ups < SomeSingletonClass end class << Ups - def _instanciate? + def _instantiate? @enter.push Thread.current[:i] while false.equal?(@__instance__) Thread.critical = false @@ -247,7 +247,7 @@ class << Ups end end - def instanciate_all + def instantiate_all @enter = [] @leave = [] 1.upto(9) {|i| @@ -270,7 +270,7 @@ class << Ups end -Ups.instanciate_all +Ups.instantiate_all # results in message like # Before there were 0 Ups instance(s) # boom - thread #6 failed to create instance @@ -293,7 +293,7 @@ def Yup.new end end end -Yup.instanciate_all +Yup.instantiate_all puts "\n\n","Customized marshalling" diff --git a/lib/tempfile.rb b/lib/tempfile.rb index f5dc801b21..8105b30f50 100644 --- a/lib/tempfile.rb +++ b/lib/tempfile.rb @@ -9,7 +9,7 @@ require 'tmpdir' # A class for managing temporary files. This library is written to be # thread safe. -class Tempfile < SimpleDelegator +class Tempfile < DelegateClass(File) MAX_TRY = 10 @@cleanlist = [] diff --git a/lib/test/unit/testcase.rb b/lib/test/unit/testcase.rb index e765b91161..9c1c41d749 100644 --- a/lib/test/unit/testcase.rb +++ b/lib/test/unit/testcase.rb @@ -31,7 +31,9 @@ module Test # Creates a new instance of the fixture for running the # test represented by test_method_name. def initialize(test_method_name) - unless(respond_to?(test_method_name) && method(test_method_name).arity == 0) + unless(respond_to?(test_method_name) and + (method(test_method_name).arity == 0 || + method(test_method_name).arity == -1)) throw :invalid_test end @method_name = test_method_name |