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

ruby-changes:26605

From: keiju <ko1@a...>
Date: Sat, 29 Dec 2012 21:59:17 +0900 (JST)
Subject: [ruby-changes:26605] keiju:r38656 (trunk): * lib/irb/completion.rb: treat rightly comletion for symbol on irb

keiju	2012-12-29 21:59:06 +0900 (Sat, 29 Dec 2012)

  New Revision: 38656

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

  Log:
    * lib/irb/completion.rb: treat rightly comletion for symbol on irb
      [Bug #7632].

  Modified files:
    trunk/ChangeLog
    trunk/lib/irb/completion.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 38655)
+++ ChangeLog	(revision 38656)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Dec 29 21:57:11 2012  Keiju Ishitsuka  <keiju@i...>
+
+	* lib/irb/completion.rb: treat rightly comletion for symbol on irb
+	  [Bug #7632].
+
 Sat Dec 29 21:51:30 2012  Shugo Maeda  <shugo@r...>
 
 	* ext/curses/curses.c (window_cury, window_curx, window_maxy,
Index: lib/irb/completion.rb
===================================================================
--- lib/irb/completion.rb	(revision 38655)
+++ lib/irb/completion.rb	(revision 38656)
@@ -44,7 +44,7 @@ module IRB https://github.com/ruby/ruby/blob/trunk/lib/irb/completion.rb#L44
       when /^((["'`]).*\2)\.([^.]*)$/
 	# String
 	receiver = $1
-	message = $3
+	message = Regexp.quote($3)
 
 	candidates = String.instance_methods.collect{|m| m.to_s}
 	select_message(receiver, message, candidates)
@@ -79,7 +79,7 @@ module IRB https://github.com/ruby/ruby/blob/trunk/lib/irb/completion.rb#L79
 	if Symbol.respond_to?(:all_symbols)
 	  sym = $1
 	  candidates = Symbol.all_symbols.collect{|s| ":" + s.id2name}
-	  candidates.grep(/^#{sym}/)
+	  candidates.grep(/^#{Regexp.quote(sym)}/)
 	else
 	  []
 	end

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

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