Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Pathname#glob

glob(p1, p2 = v2)

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 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1