* 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
This commit is contained in:
keiju 2005-07-31 15:10:26 +00:00
parent 2800b452bb
commit 846a9c902f
2 changed files with 19 additions and 4 deletions

View file

@ -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)