summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkeiju <keiju@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-07-31 15:10:26 +0000
committerkeiju <keiju@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-07-31 15:10:26 +0000
commit846a9c902f89c7f858d27a8e842c9ca52a99468c (patch)
tree446b8341117fc7dd5dbb4339759a4c42f2570492
parent2800b452bb4603c5f84b4711e893de582ea18b1c (diff)
* lib/irb/context.rb: fix `irb --readline` option. [ruby-list:40955]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog3
-rw-r--r--lib/irb/context.rb20
2 files changed, 19 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index a89f82f800..79797b47a8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+Mon Aug 1 00:07:32 2005 Keiju Ishitsuka <keiju@ruby-lang.org>
+ * lib/irb/context.rb: fix `irb --readline` option. [ruby-list:40955]
+
Fri Jul 29 09:59:38 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (rb_yield_0): push yielded node instead of yielding.
diff --git a/lib/irb/context.rb b/lib/irb/context.rb
index 043c12ade5..d01bd4aefa 100644
--- a/lib/irb/context.rb
+++ b/lib/irb/context.rb
@@ -58,12 +58,24 @@ module IRB
case input_method
when nil
- if (defined?(ReadlineInputMethod) &&
- (use_readline? || IRB.conf[:PROMPT_MODE] != :INF_RUBY && STDIN.tty?))
- @io = ReadlineInputMethod.new
- else
+ case use_readline?
+ when nil
+ if (defined?(ReadlineInputMethod) && STDIN.tty? &&
+ IRB.conf[:PROMPT_MODE] != :INF_RUBY)
+ @io = ReadlineInputMethod.new
+ else
+ @io = StdioInputMethod.new
+ end
+ when false
@io = StdioInputMethod.new
+ when true
+ if defined?(ReadlineInputMethod)
+ @io = ReadlineInputMethod.new
+ else
+ @io = StdioInputMethod.new
+ end
end
+
when String
@io = FileInputMethod.new(input_method)
@irb_name = File.basename(input_method)