diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-08-09 01:36:49 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-08-09 01:36:49 +0000 |
commit | 8e5af8b628b2a52d203e43ad5a8b18375f801cde (patch) | |
tree | 457d72a0f7ac4ea97949ec5b317b359a7d776089 /lib/irb/input-method.rb | |
parent | 45592f4b4c7e835881538e52172932c3e20d0c4d (diff) | |
download | ruby-8e5af8b628b2a52d203e43ad5a8b18375f801cde.tar.gz |
* lib/cmath.rb: fixed indent.
* lib/drb/ssl.rb: ditto.
* lib/irb/**/*.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/irb/input-method.rb')
-rw-r--r-- | lib/irb/input-method.rb | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/lib/irb/input-method.rb b/lib/irb/input-method.rb index 55363fe0c4..0b765d377b 100644 --- a/lib/irb/input-method.rb +++ b/lib/irb/input-method.rb @@ -133,14 +133,14 @@ module IRB include Readline # Creates a new input method object using Readline def initialize - super + super - @line_no = 0 - @line = [] - @eof = false + @line_no = 0 + @line = [] + @eof = false - @stdin = IO.open(STDIN.to_i, :external_encoding => IRB.conf[:LC_MESSAGES].encoding, :internal_encoding => "-") - @stdout = IO.open(STDOUT.to_i, 'w', :external_encoding => IRB.conf[:LC_MESSAGES].encoding, :internal_encoding => "-") + @stdin = IO.open(STDIN.to_i, :external_encoding => IRB.conf[:LC_MESSAGES].encoding, :internal_encoding => "-") + @stdout = IO.open(STDOUT.to_i, 'w', :external_encoding => IRB.conf[:LC_MESSAGES].encoding, :internal_encoding => "-") end # Reads the next line from this input method. @@ -149,13 +149,13 @@ module IRB def gets Readline.input = @stdin Readline.output = @stdout - if l = readline(@prompt, false) - HISTORY.push(l) if !l.empty? - @line[@line_no += 1] = l + "\n" - else - @eof = true - l - end + if l = readline(@prompt, false) + HISTORY.push(l) if !l.empty? + @line[@line_no += 1] = l + "\n" + else + @eof = true + l + end end # Whether the end of this input method has been reached, returns +true+ @@ -163,7 +163,7 @@ module IRB # # See IO#eof? for more information. def eof? - @eof + @eof end # Whether this input method is still readable when there is no more data to @@ -171,7 +171,7 @@ module IRB # # See IO#eof for more information. def readable_after_eof? - true + true end # Returns the current line number for #io. @@ -180,12 +180,12 @@ module IRB # # See IO#lineno for more information. def line(line_no) - @line[line_no] + @line[line_no] end # The external encoding for standard input. def encoding - @stdin.external_encoding + @stdin.external_encoding end end rescue LoadError |