diff options
author | aycabta <aycabta@gmail.com> | 2019-08-27 05:08:58 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2019-08-27 05:18:51 +0900 |
commit | 68207bb4fc35c2f92ba8b5d5b091d6f93f580850 (patch) | |
tree | 552516204c6cc35a033299f75fc5cccab73fb427 | |
parent | d8bcede9c357c5f0e743e736f698d1ebdada8f14 (diff) | |
download | ruby-68207bb4fc35c2f92ba8b5d5b091d6f93f580850.tar.gz |
Use preposing "private" to define methods
-rw-r--r-- | lib/reline.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/reline.rb b/lib/reline.rb index 11f136409f..a1d3febbf8 100644 --- a/lib/reline.rb +++ b/lib/reline.rb @@ -188,9 +188,7 @@ module Reline line end - private - - def inner_readline(prompt, add_hist, multiline, &confirm_multiline_termination) + private def inner_readline(prompt, add_hist, multiline, &confirm_multiline_termination) if ENV['RELINE_STDERR_TTY'] $stderr.reopen(ENV['RELINE_STDERR_TTY'], 'w') $stderr.sync = true @@ -254,7 +252,7 @@ module Reline # # GNU Readline will wait for the 2nd character with "keyseq-timeout" # milli-seconds but wait forever after 3rd characters. - def read_io(keyseq_timeout, &block) + private def read_io(keyseq_timeout, &block) buffer = [] loop do c = Reline::IOGate.getc @@ -298,7 +296,7 @@ module Reline end end - def read_escaped_key(keyseq_timeout, buffer, block) + private def read_escaped_key(keyseq_timeout, buffer, block) begin escaped_c = nil Timeout.timeout(keyseq_timeout / 1000.0) { @@ -319,7 +317,7 @@ module Reline end end - def may_req_ambiguous_char_width + private def may_req_ambiguous_char_width ambiguous_width = 2 if Reline::IOGate == Reline::GeneralIO or STDOUT.is_a?(File) return if ambiguous_width Reline::IOGate.move_cursor_column(0) |