From b9522c168763806cf119c57acdd6293efe60fe0e Mon Sep 17 00:00:00 2001 From: knu Date: Wed, 13 Mar 2002 10:11:09 +0000 Subject: * dir.c: FNM_PERIOD is obsoleted and FNM_DOTMATCH is introduced instead, which has the opposite meaning of FNM_PERIOD. * dir.c: Dir::glob now accepts optional FNM_* flags via the second argument, whereas Dir::[] doesn't. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- doc/NEWS | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'doc') diff --git a/doc/NEWS b/doc/NEWS index bd3e7feb25..3c1fbb7c99 100644 --- a/doc/NEWS +++ b/doc/NEWS @@ -1,13 +1,9 @@ -: getopts.rb +: Dir::glob - Rewrote to fix some bugs and complete features. - - Accept options with the colon in the first argument; - getopts("a:bcd:") is equivalent to getopts("bc", "a:", "d:"). - - Do not discard the argument that caused an error. - - Do not discard '-', which commonly stands for stdin or stdout. - - Allow specifying a long option with a value using '='. - (command --long-option=value) - - Stop reading options when it meets a non-option argument. + Now accepts optional FNM_* flags via the second argument, whereas + Dir::[] doesn't. + + Dir.glob("makefile", File::FNM_CASEFOLD) #=> ['Makefile', 'makefile'] : tsort module @@ -210,10 +206,13 @@ Added. Refer to the fnmatch(3) manpage for details. + Localism is FNM_DOTMATCH which has the opposite meaning of the + commonly known FNM_PERIOD, which does not exist in Ruby. + e.g. - # exclude files matching "*.bak". - files.reject! {|fn| File.fnmatch?("*.bak", fn) } + # exclude files matching "*.bak" case-insensitively. + files.reject! {|fn| File.fnmatch?("*.bak", fn, File::FNM_CASEFOLD) } : File.lchmod : File.lchown -- cgit v1.2.3