mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/irb/init.rb: make IRB -I option that is same befavior for ruby.
[ruby-dev:26872] * lib/irb/locale.rb: support to print help message when OS locale is ja_JP.utf-8. [ruby-dev:26872] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a5df717c8e
commit
317948160b
2 changed files with 13 additions and 1 deletions
|
@ -121,8 +121,12 @@ module IRB
|
||||||
@CONF[:LC_MESSAGES].load("irb/error.rb")
|
@CONF[:LC_MESSAGES].load("irb/error.rb")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
FEATUER_IOPT_CHANGE_VERSION = "1.9.0"
|
||||||
|
FEATUER_IOPT_CHANGE_DATE = "2005-04-22"
|
||||||
|
|
||||||
# option analyzing
|
# option analyzing
|
||||||
def IRB.parse_opts
|
def IRB.parse_opts
|
||||||
|
load_path = []
|
||||||
while opt = ARGV.shift
|
while opt = ARGV.shift
|
||||||
case opt
|
case opt
|
||||||
when "-f"
|
when "-f"
|
||||||
|
@ -136,7 +140,7 @@ module IRB
|
||||||
@CONF[:LOAD_MODULES].push opt if opt
|
@CONF[:LOAD_MODULES].push opt if opt
|
||||||
when /^-I(.+)?/
|
when /^-I(.+)?/
|
||||||
opt = $1 || ARGV.shift
|
opt = $1 || ARGV.shift
|
||||||
$LOAD_PATH.push opt if opt
|
load_path.push opt if opt
|
||||||
when /^-K(.)/
|
when /^-K(.)/
|
||||||
$KCODE = $1
|
$KCODE = $1
|
||||||
when "--inspect"
|
when "--inspect"
|
||||||
|
@ -189,6 +193,12 @@ module IRB
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if RUBY_VERSION > FEATUER_IOPT_CHANGE_VERSION ||
|
||||||
|
RUBY_VERSION == FEATUER_IOPT_CHANGE_VERSION &&
|
||||||
|
RUBY_RELEASE_DATE >= FEATUER_IOPT_CHANGE_DATE
|
||||||
|
load_path = load_path.collect{|p| File.expand_path(p)}
|
||||||
|
end
|
||||||
|
$LOAD_PATH.unshift(*load_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
# running config
|
# running config
|
||||||
|
|
|
@ -31,6 +31,8 @@ module IRB
|
||||||
Kconv::EUC
|
Kconv::EUC
|
||||||
when "ja_JP.sjis", "ja_JP.SJIS"
|
when "ja_JP.sjis", "ja_JP.SJIS"
|
||||||
Kconv::SJIS
|
Kconv::SJIS
|
||||||
|
when /ja_JP.utf-?8/i
|
||||||
|
Kconv::UTF8
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
private :lc2kconv
|
private :lc2kconv
|
||||||
|
|
Loading…
Reference in a new issue