diff --git a/ChangeLog b/ChangeLog index 012f877fb0..7b367f9ff6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +Fri Jul 29 16:12:02 005 Keiju Ishitsuka + * lib/irb/context.rb: fix `irb --readline` option. [ruby-dev:40955] + Fri Jul 29 09:59:38 2005 Nobuyoshi Nakada * eval.c (rb_call0): fix calling zsuper from a method with anonymous 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)