sig/file_finder.rbs in rbs-3.5.3 vs sig/file_finder.rbs in rbs-3.6.0.dev.1
- old
+ new
@@ -1,6 +1,28 @@
module RBS
module FileFinder
- def self?.each_file: (Pathname path, immediate: boolish, skip_hidden: boolish) { (Pathname) -> void } -> void
- | (Pathname path, immediate: boolish, skip_hidden: boolish) -> Enumerator[Pathname, void]
+ # Enumerate RBS files under path
+ #
+ # When `path` is a file, it yields the path.
+ #
+ # ```rb
+ # FileFinder.each_file(Pathname("foo.rbs")) {} # => yields `foo.rbs`
+ # ```
+ #
+ # When `path` is a directory, it yields all `.rbs` files under the directory, recursively.
+ #
+ # * Skips files under directory starting with `_`, if `skip_hidden` is `true`
+ # * Yields files under directory starting with `_` even if `skip_hidden` is true, when the `_` directory is given explicitly, and `immediate:` is `true`
+ #
+ # ```rb
+ # FileFinder.each_file(Pathname("sig"), skip_hidden: false) {} # => yields all `.rbs` files under `sig`
+ # FileFinder.each_file(Pathname("sig"), skip_hidden: true) {} # => yields all `.rbs` files under `sig`, skips `_` directories
+ #
+ # FileFinder.each_file(Pathname("_hidden"), skip_hidden: true) {} # => yields all `.rbs` files under `_hidden`, skips other `_` directories
+ # ```
+ #
+ # `immediate` keyword is unused and left for API compatibility.
+ #
+ def self?.each_file: (Pathname path, ?immediate: top, skip_hidden: boolish) { (Pathname) -> void } -> void
+ | (Pathname path, ?immediate: top, skip_hidden: boolish) -> Enumerator[Pathname, void]
end
end