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

ruby-changes:28171

From: zzak <ko1@a...>
Date: Thu, 11 Apr 2013 09:27:48 +0900 (JST)
Subject: [ruby-changes:28171] zzak:r40223 (trunk): * dir.c (file_s_fnmatch): Document File::FNM_EXTGLOB flag.

zzak	2013-04-11 09:27:39 +0900 (Thu, 11 Apr 2013)

  New Revision: 40223

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

  Log:
    * dir.c (file_s_fnmatch): Document File::FNM_EXTGLOB flag.

  Modified files:
    trunk/ChangeLog
    trunk/dir.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 40222)
+++ ChangeLog	(revision 40223)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Apr 11 09:27:04 2013  Konstantin Haase  <me@r...>
+
+	* dir.c (file_s_fnmatch): Document File::FNM_EXTGLOB flag.
+
 Thu Apr 11 09:17:00 2013  Zachary Scott  <zachary@z...>
 
 	* README: Fix typo by Benjamin Winkler [Fixes GH-281]
Index: dir.c
===================================================================
--- dir.c	(revision 40222)
+++ dir.c	(revision 40223)
@@ -2030,6 +2030,9 @@ fnmatch_brace(const char *pattern, VALUE https://github.com/ruby/ruby/blob/trunk/dir.c#L2030
  *                          Regexp, including set negation
  *                          (<code>[^a-z]</code>).
  *  <code> \ </code>::      Escapes the next metacharacter.
+ *  <code>{a,b}</code>::    Matches pattern a and pattern b if
+ *                          <code>File::FNM_PATHNAME</code> flag is enabled.
+ *                          Behaves like a Regexp union (<code>(?:a|b)</code>).
  *
  *  <i>flags</i> is a bitwise OR of the <code>FNM_xxx</code>
  *  parameters. The same glob pattern and flags are used by
@@ -2037,7 +2040,9 @@ fnmatch_brace(const char *pattern, VALUE https://github.com/ruby/ruby/blob/trunk/dir.c#L2040
  *
  *     File.fnmatch('cat',       'cat')        #=> true  # match entire string
  *     File.fnmatch('cat',       'category')   #=> false # only match partial string
- *     File.fnmatch('c{at,ub}s', 'cats')       #=> false # { } isn't supported
+ *
+ *     File.fnmatch('c{at,ub}s', 'cats')                    #=> false # { } isn't supported by default
+ *     File.fnmatch('c{at,ub}s', 'cats', File::FNM_EXTGLOB) #=> false # { } is supported on FNM_EXTGLOB
  *
  *     File.fnmatch('c?t',     'cat')          #=> true  # '?' match only 1 character
  *     File.fnmatch('c??t',    'cat')          #=> false # ditto

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

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