Skip to content
instance method

Pathname#glob

(::String | ::Array[::String] pattern, ?::Integer flags) -> ::Array[::Pathname]
(::String | ::Array[::String] pattern, ?::Integer flags) { (::Pathname) -> untyped } -> nil
glob(*args, **kwargs) { |pathname| ... }

Returns or yields Pathname objects.

Example
Pathname("ruby-2.4.2").glob("R*.md")
#=> [#<Pathname:ruby-2.4.2/README.md>, #<Pathname:ruby-2.4.2/README.ja.md>]

See Dir.glob. This method uses the base keyword argument of Dir.glob.

See also .glob #ftype #grpowned? #freeze also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0