зеркало из https://github.com/github/ruby.git
dir.c: Dir.glob example
* dir.c (dir_s_glob): [DOC] added an example of Dir.glob using pattern list. [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
484cc6b3bc
Коммит
5dfd225c64
1
dir.c
1
dir.c
|
@ -2698,6 +2698,7 @@ dir_s_aref(int argc, VALUE *argv, VALUE obj)
|
||||||
* Dir.glob("*.{rb,h}") #=> ["main.rb", "config.h"]
|
* Dir.glob("*.{rb,h}") #=> ["main.rb", "config.h"]
|
||||||
* Dir.glob("*") #=> ["config.h", "main.rb"]
|
* Dir.glob("*") #=> ["config.h", "main.rb"]
|
||||||
* Dir.glob("*", File::FNM_DOTMATCH) #=> [".", "..", "config.h", "main.rb"]
|
* Dir.glob("*", File::FNM_DOTMATCH) #=> [".", "..", "config.h", "main.rb"]
|
||||||
|
* Dir.glob(["*.rb", "*.h"]) #=> ["main.rb", "config.h"]
|
||||||
*
|
*
|
||||||
* rbfiles = File.join("**", "*.rb")
|
* rbfiles = File.join("**", "*.rb")
|
||||||
* Dir.glob(rbfiles) #=> ["main.rb",
|
* Dir.glob(rbfiles) #=> ["main.rb",
|
||||||
|
|
Загрузка…
Ссылка в новой задаче