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

ruby-changes:66658

From: Nobuyoshi <ko1@a...>
Date: Thu, 1 Jul 2021 14:49:41 +0900 (JST)
Subject: [ruby-changes:66658] 9692aeedf1 (master): [DOC] expanded `pattern`s in examples of File.fnmatch [ci skip]

https://git.ruby-lang.org/ruby.git/commit/?id=9692aeedf1

From 9692aeedf117a35933cf63cdce964e6403337306 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Tue, 27 Oct 2020 00:52:43 +0900
Subject: [DOC] expanded `pattern`s in examples of File.fnmatch [ci skip]

---
 dir.rb | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/dir.rb b/dir.rb
index 91f9c7f..3b0e9d9 100644
--- a/dir.rb
+++ b/dir.rb
@@ -285,25 +285,19 @@ class << File https://github.com/ruby/ruby/blob/trunk/dir.rb#L285
   #    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
-- 
cgit v1.1


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

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