method

sub

v2_4_6 - Show latest stable - Class: Pathname
sub(*args)
public

Return a pathname which is substituted by String#sub.

path1 = Pathname.new('/usr/bin/perl')
path1.sub('perl', 'ruby')
    #=> #<Pathname:/usr/bin/ruby>