Skip to content

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

class method

Pathname.glob

glob(p1, p2 = v2, p3 = v3)

Returns or yields Pathname objects.

Example
Pathname.glob("lib/i*.rb")
    #=> [#<Pathname:lib/ipaddr.rb>, #<Pathname:lib/irb.rb>]

See Dir.glob.

See also #glob .getwd .new .pwd also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1