1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[DOC] Expanded glob patterns for Dir.glob

No longer need to get rid of C block comments in builtin ruby
script comments.
This commit is contained in:
Nobuyoshi Nakada 2020-10-26 09:09:45 +09:00
parent 3cb03a00a8
commit 507af75415
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

14
dir.rb
View file

@ -115,23 +115,19 @@ class Dir
# Dir.glob("*", File::FNM_DOTMATCH) #=> [".", "..", "config.h", "main.rb"]
# Dir.glob(["*.rb", "*.h"]) #=> ["main.rb", "config.h"]
#
# rbfiles = File.join("**", "*.rb")
# Dir.glob(rbfiles) #=> ["main.rb",
# Dir.glob("**/*.rb") #=> ["main.rb",
# # "lib/song.rb",
# # "lib/song/karaoke.rb"]
#
# Dir.glob(rbfiles, base: "lib") #=> ["song.rb",
# Dir.glob("**/*.rb", base: "lib") #=> ["song.rb",
# # "song/karaoke.rb"]
#
# libdirs = File.join("**", "lib")
# Dir.glob(libdirs) #=> ["lib"]
# Dir.glob("**/lib") #=> ["lib"]
#
# librbfiles = File.join("**", "lib", "**", "*.rb")
# Dir.glob(librbfiles) #=> ["lib/song.rb",
# Dir.glob("**/lib/**/*.rb") #=> ["lib/song.rb",
# # "lib/song/karaoke.rb"]
#
# librbfiles = File.join("**", "lib", "*.rb")
# Dir.glob(librbfiles) #=> ["lib/song.rb"]
# Dir.glob("**/lib/*.rb") #=> ["lib/song.rb"]
def self.glob(pattern, _flags = 0, flags: _flags, base: nil, sort: true)
Primitive.dir_s_glob(pattern, flags, base, sort)
end