U:RDoc::AnyMethod[iI" fnmatch:ETI"File::fnmatch;TT: publico:RDoc::Markup::Document: @parts[ o:RDoc::Markup::Paragraph; [I"MReturns true if +path+ matches against +pattern+. The pattern is not a ;TI"Lregular expression; instead it follows rules similar to shell filename ;TI"*;T; [ o; ; [I"FMatches any file. Can be restricted by other values in the glob. ;TI"2Equivalent to / .* /x in regexp.;T@o; ; ;;[ o;;[I"*;T; [o; ; [I"$Matches all files regular files;To;;[I"c*;T; [o; ; [I"4Matches all files beginning with c;To;;[I"*c;T; [o; ; [I"1Matches all files ending with c;To;;[I"\*c*;T; [o; ; [I"8Matches all files that have c in them ;TI")(including at the beginning or end).;T@o; ; [I"ETo match hidden files (that start with a . set the ;TI"File::FNM_DOTMATCH flag.;T@o;;[I"**;T; [o; ; [I":Matches directories recursively or files expansively.;T@o;;[I"?;T; [o; ; [I"LMatches any one character. Equivalent to /.{1}/ in regexp.;T@o;;[I"[set];T; [o; ; [I"NMatches any one character in +set+. Behaves exactly like character sets ;TI"=in Regexp, including set negation ([^a-z]).;T@o;;[I" \ ;T; [o; ; [I"$Escapes the next metacharacter.;T@o;;[I"{a,b};T; [o; ; [I"KMatches pattern a and pattern b if File::FNM_EXTGLOB flag is enabled. ;TI"8Behaves like a Regexp union ((?:a|b)).;T@o; ; [I"M+flags+ is a bitwise OR of the FNM_XXX constants. The same ;TI"2glob pattern and flags are used by Dir::glob.;T@o; ; [I"Examples:;T@o:RDoc::Markup::Verbatim; [5I"MFile.fnmatch('cat', 'cat') #=> true # match entire string ;TI"SFile.fnmatch('cat', 'category') #=> false # only match partial string ;TI" ;TI"eFile.fnmatch('c{at,ub}s', 'cats') #=> false # { } isn't supported by default ;TI"fFile.fnmatch('c{at,ub}s', 'cats', File::FNM_EXTGLOB) #=> true # { } is supported on FNM_EXTGLOB ;TI" ;TI"TFile.fnmatch('c?t', 'cat') #=> true # '?' match only 1 character ;TI"?File.fnmatch('c??t', 'cat') #=> false # ditto ;TI"XFile.fnmatch('c*', 'cats') #=> true # '*' match 0 or more characters ;TI"?File.fnmatch('c*t', 'c/a/b/t') #=> true # ditto ;TI"VFile.fnmatch('ca[a-z]', 'cat') #=> true # inclusive bracket expression ;TI"cFile.fnmatch('ca[^t]', 'cat') #=> false # exclusive bracket expression ('^' or '!') ;TI" ;TI"OFile.fnmatch('cat', 'CAT') #=> false # case sensitive ;TI"QFile.fnmatch('cat', 'CAT', File::FNM_CASEFOLD) #=> true # case insensitive ;TI" ;TI"jFile.fnmatch('?', '/', File::FNM_PATHNAME) #=> false # wildcard doesn't match '/' on FNM_PATHNAME ;TI"EFile.fnmatch('*', '/', File::FNM_PATHNAME) #=> false # ditto ;TI"EFile.fnmatch('[/]', '/', File::FNM_PATHNAME) #=> false # ditto ;TI" ;TI"cFile.fnmatch('\?', '?') #=> true # escaped wildcard becomes ordinary ;TI"cFile.fnmatch('\a', 'a') #=> true # escaped ordinary remains ordinary ;TI"aFile.fnmatch('\a', '\a', File::FNM_NOESCAPE) #=> true # FNM_NOESCAPE makes '\' ordinary ;TI"fFile.fnmatch('[\?]', '?') #=> true # can escape inside bracket expression ;TI" ;TI"eFile.fnmatch('*', '.profile') #=> false # wildcard doesn't match leading ;TI"YFile.fnmatch('*', '.profile', File::FNM_DOTMATCH) #=> true # period by default. ;TI"CFile.fnmatch('.*', '.profile') #=> true ;TI" ;TI"^rbfiles = '**' '/' '*.rb' # you don't have to do like this. just write in single string. ;TI"CFile.fnmatch(rbfiles, 'main.rb') #=> false ;TI"CFile.fnmatch(rbfiles, './main.rb') #=> false ;TI"BFile.fnmatch(rbfiles, 'lib/song.rb') #=> true ;TI"BFile.fnmatch('**.rb', 'main.rb') #=> true ;TI"CFile.fnmatch('**.rb', './main.rb') #=> false ;TI"BFile.fnmatch('**.rb', 'lib/song.rb') #=> true ;TI"PFile.fnmatch('*', 'dave/.profile') #=> true ;TI" ;TI"pattern = '*' '/' '*' ;TI"KFile.fnmatch(pattern, 'dave/.profile', File::FNM_PATHNAME) #=> false ;TI"^File.fnmatch(pattern, 'dave/.profile', File::FNM_PATHNAME | File::FNM_DOTMATCH) #=> true ;TI" ;TI"pattern = '**' '/' 'foo' ;TI"IFile.fnmatch(pattern, 'a/b/c/foo', File::FNM_PATHNAME) #=> true ;TI"IFile.fnmatch(pattern, '/a/b/c/foo', File::FNM_PATHNAME) #=> true ;TI"IFile.fnmatch(pattern, 'c:/a/b/c/foo', File::FNM_PATHNAME) #=> true ;TI"JFile.fnmatch(pattern, 'a/.b/c/foo', File::FNM_PATHNAME) #=> false ;TI"ZFile.fnmatch(pattern, 'a/.b/c/foo', File::FNM_PATHNAME | File::FNM_DOTMATCH) #=> true;T: @format0: @fileI" dir.c;T:0@omit_headings_from_table_of_contents_below0I"yFile.fnmatch( pattern, path, [flags] ) -> (true or false) File.fnmatch?( pattern, path, [flags] ) -> (true or false);T0[I"(p1, p2, p3 = v3);T@—FI" File;TcRDoc::NormalClass00