1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

use Object#class instead of deprecated Object#type.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2002-10-02 16:45:35 +00:00
parent 8815306dc5
commit 29cef5f795
22 changed files with 91 additions and 93 deletions

View file

@ -264,20 +264,20 @@ class Date
def initialize(ajd=0, of=0, sg=ITALY) @ajd, @of, @sg = ajd, of, sg end def initialize(ajd=0, of=0, sg=ITALY) @ajd, @of, @sg = ajd, of, sg end
def ajd() @ajd end def ajd() @ajd end
def amjd() type.ajd_to_amjd(@ajd) end def amjd() self.class.ajd_to_amjd(@ajd) end
once :amjd once :amjd
def jd() type.ajd_to_jd(@ajd, @of)[0] end def jd() self.class.ajd_to_jd(@ajd, @of)[0] end
def day_fraction() type.ajd_to_jd(@ajd, @of)[1] end def day_fraction() self.class.ajd_to_jd(@ajd, @of)[1] end
def mjd() type.jd_to_mjd(jd) end def mjd() self.class.jd_to_mjd(jd) end
def ld() type.jd_to_ld(jd) end def ld() self.class.jd_to_ld(jd) end
once :jd, :day_fraction, :mjd, :ld once :jd, :day_fraction, :mjd, :ld
def civil() type.jd_to_civil(jd, @sg) end def civil() self.class.jd_to_civil(jd, @sg) end
def ordinal() type.jd_to_ordinal(jd, @sg) end def ordinal() self.class.jd_to_ordinal(jd, @sg) end
def commercial() type.jd_to_commercial(jd, @sg) end def commercial() self.class.jd_to_commercial(jd, @sg) end
once :civil, :ordinal, :commercial once :civil, :ordinal, :commercial
private :civil, :ordinal, :commercial private :civil, :ordinal, :commercial
@ -290,7 +290,7 @@ class Date
alias_method :month, :mon alias_method :month, :mon
alias_method :day, :mday alias_method :day, :mday
def time() type.day_fraction_to_time(day_fraction) end def time() self.class.day_fraction_to_time(day_fraction) end
once :time once :time
private :time private :time
@ -316,45 +316,45 @@ class Date
def cweek() commercial[1] end def cweek() commercial[1] end
def cwday() commercial[2] end def cwday() commercial[2] end
def wday() type.jd_to_wday(jd) end def wday() self.class.jd_to_wday(jd) end
once :wday once :wday
def os? () type.os?(jd, @sg) end def os? () self.class.os?(jd, @sg) end
def ns? () type.ns?(jd, @sg) end def ns? () self.class.ns?(jd, @sg) end
once :os?, :ns? once :os?, :ns?
def leap? def leap?
type.jd_to_civil(type.civil_to_jd(year, 3, 1, ns?) - 1, self.class.jd_to_civil(self.class.civil_to_jd(year, 3, 1, ns?) - 1,
ns?)[-1] == 29 ns?)[-1] == 29
end end
once :leap? once :leap?
def start() @sg end def start() @sg end
def new_start(sg=type::ITALY) type.new0(@ajd, @of, sg) end def new_start(sg=self.class::ITALY) self.class.new0(@ajd, @of, sg) end
def italy() new_start(type::ITALY) end def italy() new_start(self.class::ITALY) end
def england() new_start(type::ENGLAND) end def england() new_start(self.class::ENGLAND) end
def julian() new_start(type::JULIAN) end def julian() new_start(self.class::JULIAN) end
def gregorian() new_start(type::GREGORIAN) end def gregorian() new_start(self.class::GREGORIAN) end
def offset() @of end def offset() @of end
def new_offset(of=0) type.new0(@ajd, of, @sg) end def new_offset(of=0) self.class.new0(@ajd, of, @sg) end
private :offset, :new_offset private :offset, :new_offset
def + (n) def + (n)
case n case n
when Numeric; return type.new0(@ajd + n, @of, @sg) when Numeric; return self.class.new0(@ajd + n, @of, @sg)
end end
raise TypeError, 'expected numeric' raise TypeError, 'expected numeric'
end end
def - (x) def - (x)
case x case x
when Numeric; return type.new0(@ajd - x, @of, @sg) when Numeric; return self.class.new0(@ajd - x, @of, @sg)
when Date; return @ajd - x.ajd when Date; return @ajd - x.ajd
end end
raise TypeError, 'expected numeric or date' raise TypeError, 'expected numeric or date'
@ -380,7 +380,7 @@ class Date
y, m = clfloor(year * 12 + (mon - 1) + n, 12) y, m = clfloor(year * 12 + (mon - 1) + n, 12)
m, = clfloor(m + 1, 1) m, = clfloor(m + 1, 1)
d = mday d = mday
d -= 1 until jd2 = type.valid_civil?(y, m, d, ns?) d -= 1 until jd2 = self.class.valid_civil?(y, m, d, ns?)
self + (jd2 - jd) self + (jd2 - jd)
end end
@ -406,7 +406,7 @@ class Date
def eql? (other) Date === other and self == other end def eql? (other) Date === other and self == other end
def hash() @ajd.hash end def hash() @ajd.hash end
def inspect() format('#<%s: %s,%s,%s>', type, @ajd, @of, @sg) end def inspect() format('#<%s: %s,%s,%s>', self.class, @ajd, @of, @sg) end
def to_s() strftime end def to_s() strftime end
def _dump(limit) Marshal.dump([@ajd, @of, @sg], -1) end def _dump(limit) Marshal.dump([@ajd, @of, @sg], -1) end
@ -550,8 +550,8 @@ class Date
def #{old}(*args, &block) def #{old}(*args, &block)
if $VERBOSE if $VERBOSE
$stderr.puts("\#{caller.shift.sub(/:in .*/, '')}: " \ $stderr.puts("\#{caller.shift.sub(/:in .*/, '')}: " \
"warning: \#{type}\##{old} is deprecated; " \ "warning: \#{self.class}\##{old} is deprecated; " \
"use \#{type}\##{new}") "use \#{self.class}\##{new}")
end end
#{new}(*args, &block) #{new}(*args, &block)
end end

View file

@ -483,13 +483,13 @@ class Date
when '%r'; o << strftime('%I:%M:%S %p') # P2,ID when '%r'; o << strftime('%I:%M:%S %p') # P2,ID
when '%S'; o << '%02d' % sec when '%S'; o << '%02d' % sec
when '%s' # TZ,GL when '%s' # TZ,GL
d = ajd - type.jd_to_ajd(type.civil_to_jd(1970,1,1), 0) d = ajd - self.class.jd_to_ajd(type.civil_to_jd(1970,1,1), 0)
s = (d * 86400).to_i s = (d * 86400).to_i
o << '%d' % s o << '%d' % s
when '%T'; o << strftime('%H:%M:%S') # P2,ID when '%T'; o << strftime('%H:%M:%S') # P2,ID
when '%t'; o << "\t" # P2,ID when '%t'; o << "\t" # P2,ID
when '%U', '%W' when '%U', '%W'
a = type.civil_to_jd(year, 1, 1, ns?) + 6 a = self.class.civil_to_jd(year, 1, 1, ns?) + 6
k = if c == '%U' then 0 else 1 end k = if c == '%U' then 0 else 1 end
w = (jd - (a - ((a - k) + 1) % 7) + 7) / 7 w = (jd - (a - ((a - k) + 1) % 7) + 7) / 7
o << '%02d' % w o << '%02d' % w

View file

@ -666,13 +666,13 @@ EOHELP
end end
def excn_handle(file, line, id, binding) def excn_handle(file, line, id, binding)
if $!.type <= SystemExit if $!.class <= SystemExit
set_trace_func nil set_trace_func nil
exit exit
end end
if @catch and ($!.type.ancestors.find { |e| e.to_s == @catch }) if @catch and ($!.class.ancestors.find { |e| e.to_s == @catch })
stdout.printf "%s:%d: `%s' (%s)\n", file, line, $!, $!.type stdout.printf "%s:%d: `%s' (%s)\n", file, line, $!, $!.class
fs = @frames.size fs = @frames.size
tb = caller(0)[-fs..-1] tb = caller(0)[-fs..-1]
if tb if tb

View file

@ -69,7 +69,7 @@ module Exception2MessageMapper
def bind(cl) def bind(cl)
self.module_eval %[ self.module_eval %[
def Raise(err = nil, *rest) def Raise(err = nil, *rest)
Exception2MessageMapper.Raise(self.type, err, *rest) Exception2MessageMapper.Raise(self.class, err, *rest)
end end
alias Fail Raise alias Fail Raise

View file

@ -149,8 +149,8 @@ module IRB
output_value if @context.echo? output_value if @context.echo?
rescue StandardError, ScriptError, Abort rescue StandardError, ScriptError, Abort
$! = RuntimeError.new("unknown exception raised") unless $! $! = RuntimeError.new("unknown exception raised") unless $!
print $!.type, ": ", $!, "\n" print $!.class, ": ", $!, "\n"
if $@[0] =~ /irb(2)?(\/.*|-.*|\.rb)?:/ && $!.type.to_s !~ /^IRB/ if $@[0] =~ /irb(2)?(\/.*|-.*|\.rb)?:/ && $!.class.to_s !~ /^IRB/
irb_bug = true irb_bug = true
else else
irb_bug = false irb_bug = false
@ -307,7 +307,7 @@ module IRB
ary.push format("%s=%s", iv, eval(iv)) ary.push format("%s=%s", iv, eval(iv))
end end
end end
format("#<%s: %s>", type, ary.join(", ")) format("#<%s: %s>", self.class, ary.join(", "))
end end
end end

View file

@ -157,7 +157,7 @@ module IRB
select_message(receiver, message, candidates) select_message(receiver, message, candidates)
else else
candidates = eval("methods | private_methods | local_variables | type.constants", bind) candidates = eval("methods | private_methods | local_variables | self.class.constants", bind)
(candidates|ReservedWords).grep(/^#{Regexp.quote(input)}/) (candidates|ReservedWords).grep(/^#{Regexp.quote(input)}/)
end end

View file

@ -164,7 +164,7 @@ module IRB
end end
def file_input? def file_input?
@io.type == FileInputMethod @io.class == FileInputMethod
end end
def inspect_mode=(opt) def inspect_mode=(opt)

View file

@ -191,7 +191,7 @@ module IRB
rescue LoadError, Errno::ENOENT rescue LoadError, Errno::ENOENT
rescue rescue
print "load error: #{rc}\n" print "load error: #{rc}\n"
print $!.type, ": ", $!, "\n" print $!.class, ": ", $!, "\n"
for err in $@[0, $@.size - 2] for err in $@[0, $@.size - 2]
print "\t", err, "\n" print "\t", err, "\n"
end end
@ -208,7 +208,7 @@ module IRB
begin begin
require m require m
rescue rescue
print $@[0], ":", $!.type, ": ", $!, "\n" print $@[0], ":", $!.class, ": ", $!, "\n"
end end
end end
end end

View file

@ -688,7 +688,7 @@ class Matrix
when Numeric when Numeric
return Scalar.new(other), self return Scalar.new(other), self
else else
raise TypeError, "#{type} can't be coerced into #{other.type}" raise TypeError, "#{self.class} can't be coerced into #{other.class}"
end end
end end
@ -751,7 +751,7 @@ class Matrix
when Numeric when Numeric
Scalar.new(@value + other) Scalar.new(@value + other)
when Vector, Matrix when Vector, Matrix
Scalar.Raise WrongArgType, other.type, "Numeric or Scalar" Scalar.Raise WrongArgType, other.class, "Numeric or Scalar"
when Scalar when Scalar
Scalar.new(@value + other.value) Scalar.new(@value + other.value)
else else
@ -765,7 +765,7 @@ class Matrix
when Numeric when Numeric
Scalar.new(@value - other) Scalar.new(@value - other)
when Vector, Matrix when Vector, Matrix
Scalar.Raise WrongArgType, other.type, "Numeric or Scalar" Scalar.Raise WrongArgType, other.class, "Numeric or Scalar"
when Scalar when Scalar
Scalar.new(@value - other.value) Scalar.new(@value - other.value)
else else
@ -791,7 +791,7 @@ class Matrix
when Numeric when Numeric
Scalar.new(@value / other) Scalar.new(@value / other)
when Vector when Vector
Scalar.Raise WrongArgType, other.type, "Numeric or Scalar or Matrix" Scalar.Raise WrongArgType, other.class, "Numeric or Scalar or Matrix"
when Matrix when Matrix
self * _M.inverse self * _M.inverse
else else
@ -805,7 +805,7 @@ class Matrix
when Numeric when Numeric
Scalar.new(@value ** other) Scalar.new(@value ** other)
when Vector when Vector
Scalar.Raise WrongArgType, other.type, "Numeric or Scalar or Matrix" Scalar.Raise WrongArgType, other.class, "Numeric or Scalar or Matrix"
when Matrix when Matrix
other.powered_by(self) other.powered_by(self)
else else
@ -1007,7 +1007,7 @@ class Vector
when Numeric when Numeric
return Scalar.new(other), self return Scalar.new(other), self
else else
raise TypeError, "#{type} can't be coerced into #{other.type}" raise TypeError, "#{self.class} can't be coerced into #{other.class}"
end end
end end

View file

@ -387,7 +387,7 @@ module Net
def do_start( account, password ) def do_start( account, password )
conn_socket conn_socket
@command = (@apop ? type.apop_command_type : type.command_type).new(socket()) @command = (@apop ? self.class.apop_command_type : self.class.command_type).new(socket())
@command.auth account, password @command.auth account, password
end end
@ -408,7 +408,7 @@ module Net
return @mails if @mails return @mails if @mails
mails = [] mails = []
mtype = type.mail_type mtype = self.class.mail_type
command().list.each_with_index do |size,idx| command().list.each_with_index do |size,idx|
mails.push mtype.new(idx, size, command()) if size mails.push mtype.new(idx, size, command()) if size
end end
@ -475,7 +475,7 @@ module Net
attr :size attr :size
def inspect def inspect
"#<#{type} #{@num}#{@deleted ? ' deleted' : ''}>" "#<#{self.class} #{@num}#{@deleted ? ' deleted' : ''}>"
end end
def pop( dest = '', &block ) def pop( dest = '', &block )

View file

@ -424,7 +424,7 @@ module Net
end end
def inspect def inspect
"#<#{type} #{closed? ? 'closed' : 'opened'}>" "#<#{self.class} #{closed? ? 'closed' : 'opened'}>"
end end
### ###
@ -584,7 +584,7 @@ module Net
public public
def write_message( src ) def write_message( src )
D_off "writing text from #{src.type}" D_off "writing text from #{src.class}"
wsize = using_each_crlf_line { wsize = using_each_crlf_line {
wpend_in src wpend_in src
@ -723,7 +723,7 @@ module Net
end end
def inspect def inspect
"#<#{type} socket=#{@socket.inspect}>" "#<#{self.class} socket=#{@socket.inspect}>"
end end
def write( str ) def write( str )
@ -755,7 +755,7 @@ module Net
end end
def inspect def inspect
"#<#{type}>" "#<#{self.class}>"
end end
def <<( str ) def <<( str )

View file

@ -629,7 +629,7 @@ Default options, which never appear in option summary.
end end
end end
def inc(*args) def inc(*args)
type.inc(*args) self.class.inc(*args)
end end
=begin =begin
@ -663,7 +663,7 @@ Default options, which never appear in option summary.
string pushed back to be first non-option argument string pushed back to be first non-option argument
=end #'#"#`# =end #'#"#`#
def terminate(arg = nil) def terminate(arg = nil)
type.terminate(arg) self.class.terminate(arg)
end end
def self.terminate(arg = nil) def self.terminate(arg = nil)
throw :terminate, arg throw :terminate, arg
@ -1422,11 +1422,11 @@ Base class of exceptions from ((<OptionParser>))
end end
def reason def reason
@reason || self.type::Reason @reason || self.class::Reason
end end
def inspect def inspect
'#<' + type.to_s + ': ' + args.join(' ') + '>' "#<#{self.class.to_s}: #{args.join(' ')}>"
end end
def message def message

View file

@ -35,14 +35,14 @@ class OpenStruct
end end
def delete_field(name) def delete_field(name)
if name.type == Fixnum if name.class == Fixnum
name = name.id2name name = name.id2name
end end
@table.delete name @table.delete name
end end
def inspect def inspect
str = "<#{self.type}" str = "<#{self.class}"
for k,v in @table for k,v in @table
str += " " str += " "
str += k str += k

View file

@ -72,7 +72,7 @@ module Racc
def _racc_setup def _racc_setup
t = self.type t = self.class
unless t::Racc_debug_parser then unless t::Racc_debug_parser then
@yydebug = false @yydebug = false
@ -115,7 +115,7 @@ module Racc
end end
def next_token def next_token
raise NotImplementedError, "#{self.type}\#next_token is not defined" raise NotImplementedError, "#{self.class}\#next_token is not defined"
end end
def _racc_do_parse_rb( arg, in_debug ) def _racc_do_parse_rb( arg, in_debug )
@ -467,12 +467,12 @@ nerr = 0 # tmp
end end
def racc_token2str( tok ) def racc_token2str( tok )
type::Racc_token_to_s_table[tok] or self.class::Racc_token_to_s_table[tok] or
raise RuntimeError, "[Racc Bug] can't convert token #{tok} to string" raise RuntimeError, "[Racc Bug] can't convert token #{tok} to string"
end end
def token_to_str( t ) def token_to_str( t )
type::Racc_token_to_s_table[t] self.class::Racc_token_to_s_table[t]
end end
end end

View file

@ -1239,11 +1239,11 @@ class Resolv
class Query class Query
def encode_rdata(msg) def encode_rdata(msg)
raise EncodeError.new("#{self.type} is query.") raise EncodeError.new("#{self.class} is query.")
end end
def self.decode_rdata(msg) def self.decode_rdata(msg)
raise DecodeError.new("#{self.type} is query.") raise DecodeError.new("#{self.class} is query.")
end end
end end
@ -1259,7 +1259,7 @@ class Resolv
end end
def ==(other) def ==(other)
return self.type == other.type && return self.class == other.class &&
self.instance_variables == other.instance_variables && self.instance_variables == other.instance_variables &&
self.instance_variables.collect {|name| self.instance_eval name} == self.instance_variables.collect {|name| self.instance_eval name} ==
other.instance_variables.collect {|name| other.instance_eval name} other.instance_variables.collect {|name| other.instance_eval name}

View file

@ -226,7 +226,7 @@ class Set
def dup def dup
myhash = @hash myhash = @hash
type.new.instance_eval { self.class.new.instance_eval {
@hash.replace(myhash) @hash.replace(myhash)
self self
} }
@ -247,7 +247,7 @@ class Set
end end
def replace(enum) def replace(enum)
if enum.type == type if enum.class == self.class
@hash.replace(enum.instance_eval { @hash }) @hash.replace(enum.instance_eval { @hash })
else else
enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable" enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
@ -282,7 +282,7 @@ class Set
protected :flatten_merge protected :flatten_merge
def flatten def flatten
type.new.flatten_merge(self) self.class.new.flatten_merge(self)
end end
def flatten! def flatten!
@ -340,7 +340,7 @@ class Set
end end
def collect! def collect!
set = type.new set = self.class.new
each { |o| set << yield(o) } each { |o| set << yield(o) }
replace(set) replace(set)
end end
@ -353,7 +353,7 @@ class Set
end end
def merge(enum) def merge(enum)
if enum.type == type if enum.class == self.class
@hash.update(enum.instance_eval { @hash }) @hash.update(enum.instance_eval { @hash })
else else
enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable" enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
@ -382,7 +382,7 @@ class Set
def &(enum) def &(enum)
enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable" enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
n = type.new n = self.class.new
enum.each { |o| include?(o) and n.add(o) } enum.each { |o| include?(o) and n.add(o) }
n n
end end
@ -415,7 +415,7 @@ class Set
each { |i| each { |i|
x = yield(i) x = yield(i)
(h[x] ||= type.new).add(i) (h[x] ||= self.class.new).add(i)
} }
h h
@ -441,7 +441,7 @@ class Set
set = Set.new() set = Set.new()
dig.each_strongly_connected_component { |css| dig.each_strongly_connected_component { |css|
set.add(type.new(css)) set.add(self.class.new(css))
} }
set set
else else
@ -455,19 +455,19 @@ class Set
ids = (Thread.current[InspectKey] ||= []) ids = (Thread.current[InspectKey] ||= [])
if ids.include?(id) if ids.include?(id)
return sprintf('#<%s: {...}>', type.name) return sprintf('#<%s: {...}>', self.class.name)
end end
begin begin
ids << id ids << id
return sprintf('#<%s: {%s}>', type, to_a.inspect[1..-2]) return sprintf('#<%s: {%s}>', self.class, to_a.inspect[1..-2])
ensure ensure
ids.pop ids.pop
end end
end end
def pretty_print(pp) def pretty_print(pp)
pp.text sprintf('#<%s: {', type.name) pp.text sprintf('#<%s: {', self.class.name)
pp.nest(1) { pp.nest(1) {
first = true first = true
each { |o| each { |o|
@ -484,7 +484,7 @@ class Set
end end
def pretty_print_cycle(pp) def pretty_print_cycle(pp)
pp.text sprintf('#<%s: {%s}>', type.name, empty? ? '' : '...') pp.text sprintf('#<%s: {%s}>', self.class.name, empty? ? '' : '...')
end end
end end

View file

@ -49,7 +49,7 @@ class Shell
rescue LoadError, Errno::ENOENT rescue LoadError, Errno::ENOENT
rescue rescue
print "load error: #{rc}\n" print "load error: #{rc}\n"
print $!.type, ": ", $!, "\n" print $!.class, ": ", $!, "\n"
for err in $@[0, $@.size - 2] for err in $@[0, $@.size - 2]
print "\t", err, "\n" print "\t", err, "\n"
end end
@ -277,7 +277,7 @@ class Shell
when IO when IO
AppendIO.new(@shell, to, filter) AppendIO.new(@shell, to, filter)
else else
Shell.Fail CanNotMethodApply, "append", to.type Shell.Fail CanNotMethodApply, "append", to.class
end end
end end

View file

@ -47,7 +47,7 @@ class Shell
self.input = src self.input = src
self self
else else
Filter.Fail CanNotMethodApply, "<", to.type Filter.Fail CanNotMethodApply, "<", to.class
end end
end end
@ -63,7 +63,7 @@ class Shell
when IO when IO
each(){|l| to << l} each(){|l| to << l}
else else
Filter.Fail CanNotMethodApply, ">", to.type Filter.Fail CanNotMethodApply, ">", to.class
end end
self self
end end
@ -72,7 +72,7 @@ class Shell
begin begin
Shell.cd(@shell.pwd).append(to, self) Shell.cd(@shell.pwd).append(to, self)
rescue CanNotMethodApply rescue CanNotMethodApply
Shell.Fail CanNotMethodApply, ">>", to.type Shell.Fail CanNotMethodApply, ">>", to.class
end end
end end

View file

@ -15,8 +15,8 @@ require "shell/filter"
class Shell class Shell
class SystemCommand < Filter class SystemCommand < Filter
def initialize(sh, command, *opts) def initialize(sh, command, *opts)
if t = opts.find{|opt| !opt.kind_of?(String) && opt.type} if t = opts.find{|opt| !opt.kind_of?(String) && opt.class}
Shell.Fail TypeError, t.type, "String" Shell.Fail TypeError, t.class, "String"
end end
super(sh) super(sh)
@command = command @command = command

View file

@ -76,7 +76,7 @@ module Singleton
def included(klass) def included(klass)
# remove build in copying methods # remove build in copying methods
klass.class_eval do klass.class_eval do
define_method(:clone) {raise TypeError, "can't clone singleton #{self.type}"} define_method(:clone) {raise TypeError, "can't clone singleton #{self.class}"}
end end
# initialize the ``klass instance variable'' @__instance__ to nil # initialize the ``klass instance variable'' @__instance__ to nil
@ -200,7 +200,7 @@ Thread.abort_on_exception = false
class Ups < SomeSingletonClass class Ups < SomeSingletonClass
def initialize def initialize
type.__sleep self.class.__sleep
puts "initialize called by thread ##{Thread.current[:i]}" puts "initialize called by thread ##{Thread.current[:i]}"
end end
class << self class << self

View file

@ -62,9 +62,7 @@ class Tracer
off off
end end
else else
set_trace_func proc{|event, file, line, id, binding, klass, *rest| set_trace_func method(:trace_func).to_proc
trace_func event, file, line, id, binding, klass
}
stdout.print "Trace on\n" if Tracer.verbose? stdout.print "Trace on\n" if Tracer.verbose?
end end
end end
@ -114,7 +112,7 @@ class Tracer
end end
end end
def trace_func(event, file, line, id, binding, klass) def trace_func(event, file, line, id, binding, klass, *)
return if file == MY_FILE_NAME return if file == MY_FILE_NAME
for p in @filters for p in @filters

View file

@ -36,7 +36,7 @@ Object
end end
def default_port def default_port
self.type.default_port self.class.default_port
end end
=begin =begin
@ -121,7 +121,7 @@ Object
end end
else else
raise ArgumentError, raise ArgumentError,
"expected Array of or Hash of components of #{self.type} (#{self.type.component.join(', ')})" "expected Array of or Hash of components of #{self.class} (#{self.class.component.join(', ')})"
end end
tmp << true tmp << true
@ -195,7 +195,7 @@ Object
=end =end
def component def component
self.type.component self.class.component
end end
# set_XXX method sets value to @XXX instance variable with no check, # set_XXX method sets value to @XXX instance variable with no check,
@ -1087,7 +1087,7 @@ Object
=begin =begin
=end =end
def inspect def inspect
sprintf("#<%s:0x%x URL:%s>", self.type.to_s, self.id, self.to_s) sprintf("#<%s:0x%x URL:%s>", self.class.to_s, self.id, self.to_s)
end end
=begin =begin