diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-06-10 05:36:35 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-06-10 05:36:35 +0000 |
commit | aec748ff1363557f0afb47eac9ad756bd4ed4e97 (patch) | |
tree | ea11581058e12fcfc1c67be55603efa1b406b58a /lib/irb/ruby-lex.rb | |
parent | 373a59b95b71b54b99a0ba229cd5860fac308115 (diff) | |
download | ruby-aec748ff1363557f0afb47eac9ad756bd4ed4e97.tar.gz |
* lib/irb/slex.rb: small cleanups. (ruby-bugs-ja PR#492)
* lib/irb/ruby-lex.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/irb/ruby-lex.rb')
-rw-r--r-- | lib/irb/ruby-lex.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb index 8d5cb47580..d8f8a10241 100644 --- a/lib/irb/ruby-lex.rb +++ b/lib/irb/ruby-lex.rb @@ -67,12 +67,12 @@ class RubyLex attr_reader :indent # io functions - def set_input(io, p = nil) + def set_input(io, p = nil, &block) @io = io if p.respond_to?(:call) @input = p - elsif iterator? - @input = Block.new + elsif block_given? + @input = block else @input = Block.new{@io.gets} end @@ -183,7 +183,8 @@ class RubyLex end private :buf_input - def set_prompt(p = Block.new) + def set_prompt(p, &block) + p = block if block_given? if p.respond_to?(:call) @prompt = p else |