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

ruby-changes:37262

From: nobu <ko1@a...>
Date: Tue, 20 Jan 2015 12:10:12 +0900 (JST)
Subject: [ruby-changes:37262] nobu:r49343 (trunk): redmine-backporter.rb: improve mygets

nobu	2015-01-20 12:09:56 +0900 (Tue, 20 Jan 2015)

  New Revision: 49343

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49343

  Log:
    redmine-backporter.rb: improve mygets
    
    * tool/redmine-backporter.rb (mygets): newline to finish, fix DEL
      code, erase the last character at DEL/BS, and use \C escapes.

  Modified files:
    trunk/tool/redmine-backporter.rb
Index: tool/redmine-backporter.rb
===================================================================
--- tool/redmine-backporter.rb	(revision 49342)
+++ tool/redmine-backporter.rb	(revision 49343)
@@ -202,17 +202,16 @@ def mygets https://github.com/ruby/ruby/blob/trunk/tool/redmine-backporter.rb#L202
   line = ''
   while 1
     case c = console.getch
-    when "\r"
+    when "\r", "\n"
       puts
       line << c
       return line
-    when "\x07", "\b" # DEL/BS
-      print "\b"
-      line.chop!
-    when "\x15" # C-u
+    when "\C-?", "\b" # DEL/BS
+      print "\b \b" if line.chop!
+    when "\C-u"
       print cls
       line.clear
-    when "\x04" # C-d
+    when "\C-d"
       return nil if line.empty?
       line << c
     else

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

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