问题
Note: This has already been posted on Ruby Forum some weeks ago. I'm crossposting it here, because I didn't get any response so far
Dir.glob provides an optional parameter, usually referred as 'flags'. Where can I find a documentation about what flags are possible?
The Ruby 2.0 docs just say that the flags are "the same as used in File.fnmatch".
Looking up the documentation of File.fnmatch, I only find the explanation that these are the "FNM_xxx" flags, which can be or'ed together. I could however find no documentation about what FNM_xxx flags exist.
Where is this described?
回答1:
It's actually defined inside File::Constants
, and thereby documented under the same.
Look it up with ri
:
ri File::Constants
Or read the html doc : Module: File::Constants (Ruby 2.2.2).
来源:https://stackoverflow.com/questions/30868689/ruby-dir-glob-mystery-where-are-the-fnm-xxx-flags-described