diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-10-27 00:52:43 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-07-01 14:45:47 +0900 |
commit | 9692aeedf117a35933cf63cdce964e6403337306 (patch) | |
tree | b0b977fe2556858f91a58b4693fe17e79becb77d /dir.rb | |
parent | 1467328edc877ada0361e89f55158d2ed1bbb075 (diff) |
[DOC] expanded `pattern`s in examples of File.fnmatch [ci skip]
Diffstat (limited to 'dir.rb')
-rw-r--r-- | dir.rb | 22 |
1 files changed, 8 insertions, 14 deletions
@@ -285,25 +285,19 @@ class << File # File.fnmatch('*', '.profile', File::FNM_DOTMATCH) #=> true # period by default. # File.fnmatch('.*', '.profile') #=> true # - # rbfiles = '**/*.rb' - # File.fnmatch(rbfiles, 'main.rb') #=> false - # File.fnmatch(rbfiles, './main.rb') #=> false - # File.fnmatch(rbfiles, 'lib/song.rb') #=> true + # File.fnmatch('**/*.rb', 'main.rb') #=> false + # File.fnmatch('**/*.rb', './main.rb') #=> false + # File.fnmatch('**/*.rb', 'lib/song.rb') #=> true # File.fnmatch('**.rb', 'main.rb') #=> true # File.fnmatch('**.rb', './main.rb') #=> false # File.fnmatch('**.rb', 'lib/song.rb') #=> true # File.fnmatch('*', 'dave/.profile') #=> true # - # pattern = '*/*' - # File.fnmatch(pattern, 'dave/.profile', File::FNM_PATHNAME) #=> false - # File.fnmatch(pattern, 'dave/.profile', File::FNM_PATHNAME | File::FNM_DOTMATCH) #=> true - # - # pattern = '**/foo' - # File.fnmatch(pattern, 'a/b/c/foo', File::FNM_PATHNAME) #=> true - # File.fnmatch(pattern, '/a/b/c/foo', File::FNM_PATHNAME) #=> true - # File.fnmatch(pattern, 'c:/a/b/c/foo', File::FNM_PATHNAME) #=> true - # File.fnmatch(pattern, 'a/.b/c/foo', File::FNM_PATHNAME) #=> false - # File.fnmatch(pattern, 'a/.b/c/foo', File::FNM_PATHNAME | File::FNM_DOTMATCH) #=> true + # File.fnmatch('**/foo', 'a/b/c/foo', File::FNM_PATHNAME) #=> true + # File.fnmatch('**/foo', '/a/b/c/foo', File::FNM_PATHNAME) #=> true + # File.fnmatch('**/foo', 'c:/a/b/c/foo', File::FNM_PATHNAME) #=> true + # File.fnmatch('**/foo', 'a/.b/c/foo', File::FNM_PATHNAME) #=> false + # File.fnmatch('**/foo', 'a/.b/c/foo', File::FNM_PATHNAME | File::FNM_DOTMATCH) #=> true def fnmatch(pattern, path, flags = nil) end alias fnmatch? fnmatch |