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

ruby-changes:29010

From: eregon <ko1@a...>
Date: Tue, 4 Jun 2013 23:17:37 +0900 (JST)
Subject: [ruby-changes:29010] eregon:r41062 (trunk): * lib/irb/completion.rb: Use %w literal construction for long lists.

eregon	2013-06-04 23:17:17 +0900 (Tue, 04 Jun 2013)

  New Revision: 41062

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

  Log:
    * lib/irb/completion.rb: Use %w literal construction for long lists.
      Patch by Dave Goodchild. [Fixes GH-299]

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

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41061)
+++ ChangeLog	(revision 41062)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Jun  4 23:16:49 2013  Benoit Daloze  <eregontp@g...>
+
+	* lib/irb/completion.rb: Use %w literal construction for long lists.
+	  Patch by Dave Goodchild. [Fixes GH-299]
+
 Tue Jun  4 23:08:42 2013  Benoit Daloze  <eregontp@g...>
 
 	* ext/objspace/objspace.c: improve wording and remove duplicated comment.
Index: lib/irb/completion.rb
===================================================================
--- lib/irb/completion.rb	(revision 41061)
+++ lib/irb/completion.rb	(revision 41062)
@@ -15,24 +15,24 @@ module IRB https://github.com/ruby/ruby/blob/trunk/lib/irb/completion.rb#L15
 
     # Set of reserved words used by Ruby, you should not use these for
     # constants or variables
-    ReservedWords = [
-      "BEGIN", "END",
-      "alias", "and",
-      "begin", "break",
-      "case", "class",
-      "def", "defined", "do",
-      "else", "elsif", "end", "ensure",
-      "false", "for",
-      "if", "in",
-      "module",
-      "next", "nil", "not",
-      "or",
-      "redo", "rescue", "retry", "return",
-      "self", "super",
-      "then", "true",
-      "undef", "unless", "until",
-      "when", "while",
-      "yield",
+    ReservedWords = %w[
+      BEGIN END
+      alias and
+      begin break
+      case class
+      def defined do
+      else elsif end ensure
+      false for
+      if in
+      module
+      next nil not
+      or
+      redo rescue retry return
+      self super
+      then true
+      undef unless until
+      when while
+      yield
     ]
 
     CompletionProc = proc { |input|
@@ -211,9 +211,7 @@ module IRB https://github.com/ruby/ruby/blob/trunk/lib/irb/completion.rb#L211
     }
 
     # Set of available operators in Ruby
-    Operators = ["%", "&", "*", "**", "+",  "-",  "/",
-      "<", "<<", "<=", "<=>", "==", "===", "=~", ">", ">=", ">>",
-      "[]", "[]=", "^", "!", "!=", "!~"]
+    Operators = %w[% & * ** + - / < << <= <=> == === =~ > >= >> [] []= ^ ! != !~]
 
     def self.select_message(receiver, message, candidates, sep = ".")
       candidates.grep(/^#{message}/).collect do |e|

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

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