# File irb/locale.rb, line 40
def String(mes)
mes = super(mes)
case @lang
when /^ja/
mes = Kconv::kconv(mes, lc2kconv(@lang))
else
mes
end
mes
end
# File irb/locale.rb, line 139
def find(file , paths = $:)
dir = File.dirname(file)
dir = "" if dir == "."
base = File.basename(file)
if dir[0] == / #/
return lc_path = search_file(dir, base)
else
for path in $:
if lc_path = search_file(path + "/" + dir, base)
return lc_path
end
end
end
nil
end
# File irb/locale.rb, line 51
def format(*opts)
String(super(*opts))
end
# File irb/locale.rb, line 105
def load(file, priv=nil)
dir = File.dirname(file)
dir = "" if dir == "."
base = File.basename(file)
if /^ja(_JP)?$/ =~ @lang
back, @lang = @lang, "C"
end
begin
if dir[0] == / #/
lc_path = search_file(dir, base)
return real_load(lc_path, priv) if lc_path
end
for path in $:
lc_path = search_file(path + "/" + dir, base)
return real_load(lc_path, priv) if lc_path
end
ensure
@lang = back if back
end
raise LoadError, "No such file to load -- #{file}"
end
# File irb/locale.rb, line 63
def print(*opts)
ary = opts.collect{|opt| String(opt)}
super(*ary)
end
# File irb/locale.rb, line 68
def printf(*opts)
s = format(*opts)
print s
end
# File irb/locale.rb, line 73
def puts(*opts)
ary = opts.collect{|opt| String(opt)}
super(*ary)
end
# File irb/locale.rb, line 59
def readline(*rs)
String(super(*rs))
end
# File irb/locale.rb, line 78
def require(file, priv = nil)
rex = Regexp.new("lc/#{Regexp.quote(file)}\.(so|o|sl|rb)?")
return false if $".find{|f| f =~ rex}
case file
when /\.rb$/
begin
load(file, priv)
$".push file
return true
rescue LoadError
end
when /\.(so|o|sl)$/
return super
end
begin
load(f = file + ".rb")
$".push f #"
return true
rescue LoadError
return ruby_require(file)
end
end
Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.
If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.
If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.
If you want to help improve the Ruby documentation, please see Improve the docs, or visit Documenting-ruby.org.