[前][次][番号順一覧][スレッド一覧]

ruby-changes:70534

From: aycabta <ko1@a...>
Date: Fri, 24 Dec 2021 18:23:06 +0900 (JST)
Subject: [ruby-changes:70534] fc5bc378e5 (master): [ruby/reline] Change aliased methods to be parivete

https://git.ruby-lang.org/ruby.git/commit/?id=fc5bc378e5

From fc5bc378e54bebc4ef254fa36c3736fbe2e17c43 Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Sun, 3 Oct 2021 15:25:25 +0900
Subject: [ruby/reline] Change aliased methods to be parivete

https://github.com/ruby/reline/commit/0f075f562b
---
 lib/reline/line_editor.rb | 70 +++++++++++++++++++++++------------------------
 1 file changed, 35 insertions(+), 35 deletions(-)

diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index 74198491daa..0021872e2f0 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -2043,8 +2043,8 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L2043
     @cursor += width
     @cursor_max += width
   end
-  alias_method :ed_digit, :ed_insert
-  alias_method :self_insert, :ed_insert
+  private alias_method :ed_digit, :ed_insert
+  private alias_method :self_insert, :ed_insert
 
   private def ed_quoted_insert(str, arg: 1)
     @waiting_proc = proc { |key|
@@ -2060,7 +2060,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L2060
       @waiting_proc = nil
     }
   end
-  alias_method :quoted_insert, :ed_quoted_insert
+  private alias_method :quoted_insert, :ed_quoted_insert
 
   private def ed_next_char(key, arg: 1)
     byte_size = Reline::Unicode.get_next_mbchar_size(@line, @byte_pointer)
@@ -2080,7 +2080,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L2080
     arg -= 1
     ed_next_char(key, arg: arg) if arg > 0
   end
-  alias_method :forward_char, :ed_next_char
+  private alias_method :forward_char, :ed_next_char
 
   private def ed_prev_char(key, arg: 1)
     if @cursor > 0
@@ -2100,7 +2100,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L2100
     arg -= 1
     ed_prev_char(key, arg: arg) if arg > 0
   end
-  alias_method :backward_char, :ed_prev_char
+  private alias_method :backward_char, :ed_prev_char
 
   private def vi_first_print(key)
     @byte_pointer, @cursor = Reline::Unicode.vi_first_print(@line)
@@ -2109,7 +2109,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L2109
   private def ed_move_to_beg(key)
     @byte_pointer = @cursor = 0
   end
-  alias_method :beginning_of_line, :ed_move_to_beg
+  private alias_method :beginning_of_line, :ed_move_to_beg
 
   private def ed_move_to_end(key)
     @byte_pointer = 0
@@ -2124,7 +2124,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L2124
       @byte_pointer += byte_size
     end
   end
-  alias_method :end_of_line, :ed_move_to_end
+  private alias_method :end_of_line, :ed_move_to_end
 
   private def generate_searcher
     Fiber.new do |first_key|
@@ -2332,12 +2332,12 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L2332
   private def vi_search_prev(key)
     incremental_search_history(key)
   end
-  alias_method :reverse_search_history, :vi_search_prev
+  private alias_method :reverse_search_history, :vi_search_prev
 
   private def vi_search_next(key)
     incremental_search_history(key)
   end
-  alias_method :forward_search_history, :vi_search_next
+  private alias_method :forward_search_history, :vi_search_next
 
   private def ed_search_prev_history(key, arg: 1)
     history = nil
@@ -2384,7 +2384,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L2384
     arg -= 1
     ed_search_prev_history(key, arg: arg) if arg > 0
   end
-  alias_method :history_search_backward, :ed_search_prev_history
+  private alias_method :history_search_backward, :ed_search_prev_history
 
   private def ed_search_next_history(key, arg: 1)
     substr = @line.slice(0, @byte_pointer)
@@ -2436,7 +2436,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L2436
     arg -= 1
     ed_search_next_history(key, arg: arg) if arg > 0
   end
-  alias_method :history_search_forward, :ed_search_next_history
+  private alias_method :history_search_forward, :ed_search_next_history
 
   private def ed_prev_history(key, arg: 1)
     if @is_multiline and @line_index > 0
@@ -2487,7 +2487,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L2487
     arg -= 1
     ed_prev_history(key, arg: arg) if arg > 0
   end
-  alias_method :previous_history, :ed_prev_history
+  private alias_method :previous_history, :ed_prev_history
 
   private def ed_next_history(key, arg: 1)
     if @is_multiline and @line_index < (@buffer_of_lines.size - 1)
@@ -2535,7 +2535,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L2535
     arg -= 1
     ed_next_history(key, arg: arg) if arg > 0
   end
-  alias_method :next_history, :ed_next_history
+  private alias_method :next_history, :ed_next_history
 
   private def ed_newline(key)
     process_insert(force: true)
@@ -2591,7 +2591,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L2591
     arg -= 1
     em_delete_prev_char(key, arg: arg) if arg > 0
   end
-  alias_method :backward_delete_char, :em_delete_prev_char
+  private alias_method :backward_delete_char, :em_delete_prev_char
 
   # Editline:: +ed-kill-line+ (vi command: +D+, +Ctrl-K+; emacs: +Ctrl-K+,
   #            +Ctrl-U+) + Kill from the cursor to the end of the line.
@@ -2614,7 +2614,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L2614
       @rest_height += 1
     end
   end
-  alias_method :kill_line, :ed_kill_line
+  private alias_method :kill_line, :ed_kill_line
 
   # Editline:: +vi-kill-line-prev+ (vi: +Ctrl-U+) Delete the string from the
   #            beginning  of the edit buffer to the cursor and save it to the
@@ -2630,7 +2630,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L2630
       @cursor = 0
     end
   end
-  alias_method :unix_line_discard, :vi_kill_line_prev
+  private alias_method :unix_line_discard, :vi_kill_line_prev
 
   # Editline:: +em-kill-line+ (not bound) Delete the entire contents of the
   #            edit buffer and save it to the cut buffer. +vi-kill-line-prev+
@@ -2645,7 +2645,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L2645
       @cursor = 0
     end
   end
-  alias_method :kill_whole_line, :em_kill_line
+  private alias_method :kill_whole_line, :em_kill_line
 
   private def em_delete(key)
     if (not @is_multiline and @line.empty?) or (@is_multiline and @line.empty? and @buffer_of_lines.size == 1)
@@ -2672,7 +2672,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L2672
       @rest_height += 1
     end
   end
-  alias_method :delete_char, :em_delete
+  private alias_method :delete_char, :em_delete
 
   private def em_delete_or_list(key)
     if @line.empty? or @byte_pointer < @line.bytesize
@@ -2684,7 +2684,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L2684
       end
     end
   end
-  alias_method :delete_char_or_list, :em_delete_or_list
+  private alias_method :delete_char_or_list, :em_delete_or_list
 
   private def em_yank(key)
     yanked = @kill_ring.yank
@@ -2696,7 +2696,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L2696
       @byte_pointer += yanked.bytesize
     end
   end
-  alias_method :yank, :em_yank
+  private alias_method :yank, :em_yank
 
   private def em_yank_pop(key)
     yanked, prev_yank = @kill_ring.yank_pop
@@ -2713,12 +2713,12 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L2713
       @byte_pointer += yanked.bytesize
     end
   end
-  alias_method :yank_pop, :em_yank_pop
+  private alias_method :yank_pop, :em_yank_pop
 
   private def ed_clear_screen(key)
     @cleared = true
   end
-  alias_method :clear_screen, :ed_clear_screen
+  private alias_method :clear_screen, :ed_clear_screen
 
   private def em_next_word(key)
     if @line.bytesize > @byte_pointer
@@ -2727,7 +2727,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L2727
       @cursor += width
     end
   end
-  alias_method :forward_word, :em_next_word
+  private alias_method :forward_word, :em_next_word
 
   private def ed_prev_word(key)
     if @byte_pointer > 0
@@ -2736,7 +2736,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L2736
       @cursor -= width
     end
   end
-  alias_method :backward_word, :ed_prev_word
+  private alias_method :backward_word, :ed_prev_word
 
   private def em_delete_next_word(key)
     if @line.bytesize > @byte_pointer
@@ -2776,7 +2776,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L2776
       end
     end
   end
-  alias_method :transpose_chars, :ed_transpose_chars
+  private alias_method :transpose_chars, :ed_transpose_chars
 
   private def ed_transpose_words(key)
     left_word_start, middle_start, right_word_start, after_start = Reline::Unicode.ed_transpose_words(@line, @byte_pointer)
@@ -2791,7 +2791,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L2791
     @byte_pointer = from_head_to_left_word.bytesize
     @cursor = calculate_width(from_head_to_left_word)
   end
-  alias_method :transpose_words, :ed_transpose_words
+  private alias_method :transpose_words, :ed_transpose_words
 
   private def em_capitol_case(key)
     if @line.bytesize > @byte_pointer
@@ -2803,7 +2803,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L2803
       @cursor += calculate_width(new_str)
     end
   end
-  alias_method :capitalize_word, :em_capitol_case
+  private  (... truncated)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]