ruby-changes:63439
From: Nobuyoshi <ko1@a...>
Date: Mon, 26 Oct 2020 12:40:12 +0900 (JST)
Subject: [ruby-changes:63439] 507af75415 (master): [DOC] Expanded glob patterns for Dir.glob
https://git.ruby-lang.org/ruby.git/commit/?id=507af75415 From 507af7541574d3c7f0e5d990b9de0011cb49a35d Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Mon, 26 Oct 2020 09:09:45 +0900 Subject: [DOC] Expanded glob patterns for Dir.glob No longer need to get rid of C block comments in builtin ruby script comments. diff --git a/dir.rb b/dir.rb index f063659..da19fc7 100644 --- a/dir.rb +++ b/dir.rb @@ -115,23 +115,19 @@ class Dir https://github.com/ruby/ruby/blob/trunk/dir.rb#L115 # 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 -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/