summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkeiju <keiju@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-09-01 18:30:46 +0000
committerkeiju <keiju@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-09-01 18:30:46 +0000
commitb6a9db500539dba460d91540f22c8e9ea602c280 (patch)
treea71f9f23f71dda7b266c12acf50ef95972f6970e
parent848bea87942c7e1449c10c656c26da51dfa0318b (diff)
* lib/irb/init.rb: make IRB -I option that is same befavior for ruby.
[ruby-dev:26872], [ruby-dev: 26920] * 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/branches/ruby_1_8@9068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--lib/irb/init.rb11
-rw-r--r--lib/irb/locale.rb2
3 files changed, 19 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index c040d0627b..72da817fa5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Fri Sep 2 03:29:00 2005 Keiju Ishitsuka <keiju@ruby-lang.org>
+ * lib/irb/init.rb: make IRB -I option that is same befavior for ruby.
+ [ruby-dev:26872], [ruby-dev: 26920]
+
+ * lib/irb/locale.rb: support to print help message when OS locale is
+ ja_JP.utf-8. [ruby-dev:26872]
+
Thu Sep 1 17:11:25 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_call0): wrong condition for $SAFE restoration.
diff --git a/lib/irb/init.rb b/lib/irb/init.rb
index bc8f9b599b..842eb1221e 100644
--- a/lib/irb/init.rb
+++ b/lib/irb/init.rb
@@ -121,8 +121,11 @@ module IRB
@CONF[:LC_MESSAGES].load("irb/error.rb")
end
+ FEATURE_IOPT_CHANGE_VERSION = "1.9.0"
+
# option analyzing
def IRB.parse_opts
+ load_path = []
while opt = ARGV.shift
case opt
when "-f"
@@ -136,7 +139,7 @@ module IRB
@CONF[:LOAD_MODULES].push opt if opt
when /^-I(.+)?/
opt = $1 || ARGV.shift
- $LOAD_PATH.push opt if opt
+ load_path.concat(opt.split(File::PATH_SEPARATOR)) if opt
when /^-K(.)/
$KCODE = $1
when "--inspect"
@@ -189,6 +192,12 @@ module IRB
break
end
end
+ if RUBY_VERSION >= FEATURE_IOPT_CHANGE_VERSION
+ load_path.collect! do |path|
+ /\A\.\// =~ path ? path : File.expand_path(path)
+ end
+ end
+ $LOAD_PATH.unshift(*load_path)
end
# running config
diff --git a/lib/irb/locale.rb b/lib/irb/locale.rb
index ddd2187680..4b6aba2bb9 100644
--- a/lib/irb/locale.rb
+++ b/lib/irb/locale.rb
@@ -31,6 +31,8 @@ module IRB
Kconv::EUC
when "ja_JP.sjis", "ja_JP.SJIS"
Kconv::SJIS
+ when /ja_JP.utf-?8/i
+ Kconv::UTF8
end
end
private :lc2kconv