diff options
author | keiju <keiju@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-07-29 07:18:34 +0000 |
---|---|---|
committer | keiju <keiju@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-07-29 07:18:34 +0000 |
commit | 0bace243b0635dd4eef5be1a855400708f09ac4e (patch) | |
tree | 6d3ecfdca36a6139571ed3cd4779e8a5e0e30f19 /lib/irb | |
parent | 97335c53e60750da66f72183e82b201202a5a820 (diff) | |
download | ruby-0bace243b0635dd4eef5be1a855400708f09ac4e.tar.gz |
* lib/irb/context.rb: fix `irb --readline` option. [ruby-dev:40955]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/irb')
-rw-r--r-- | lib/irb/context.rb | 20 |
1 files changed, 16 insertions, 4 deletions
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) |