diff options
| author | keiju <keiju@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-07-31 15:10:26 +0000 |
|---|---|---|
| committer | keiju <keiju@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-07-31 15:10:26 +0000 |
| commit | 36d2bcbe5c18ee29c60426bb54a46da325ecf752 (patch) | |
| tree | 446b8341117fc7dd5dbb4339759a4c42f2570492 /lib | |
| parent | 20ae118c51a6bdcbecd9381745e62a42da5dd483 (diff) | |
| download | ruby-36d2bcbe5c18ee29c60426bb54a46da325ecf752.tar.gz ruby-36d2bcbe5c18ee29c60426bb54a46da325ecf752.tar.xz ruby-36d2bcbe5c18ee29c60426bb54a46da325ecf752.zip | |
* lib/irb/context.rb: fix `irb --readline` option. [ruby-list:40955]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
| -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 043c12ade..d01bd4aef 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) |
