-
Notifications
You must be signed in to change notification settings - Fork 627
Open
Description
The rake docs here still indicate that Pathname#pathmap exists. However, it was removed by #130
It would be easy enough to fix the docs. But perhaps a different question is, why was this removed from Pathname?
I expected the following to work, but instead got NoMethodError: undefined method 'pathmap' for #<Pathname
array_of_pathnames.each do |p|
directory p.pathmap('%d')
endSurely it's easy enough to use directory p.dirname. However, I have a lambda that is also used as a rule dep (to ensure the parent directories are created). I was hoping to use the same lambda when iterating over the array_of_pathnames.
dirname = ->(f) { f.pathmap('%d') }
pathnames.map(&dirname).map(&method(:directory))
rule %r{pattern} => dirname do |t|
# stuff
endAs long as we're extending String, I'd expect the same extensions to work on the "more domain appropriate" Pathname.
Metadata
Metadata
Assignees
Labels
No labels