Pathname#pathmap is still (erronously) documented
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Ruby
- Sterne
- 2.5k
- Forks
- 650
- Ø Merge
- 6 Min.
- Gemergte PRs (30 T.)
- 3
Beschreibung
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')
end
Surely 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
end
As long as we're extending String, I'd expect the same extensions to work on the "more domain appropriate" Pathname.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit der verlinkten Pathname-Dokumentation und prüfe Issue #130, um zu verstehen, warum Pathname#pathmap entfernt wurde. Überprüfe die gemeldeten Ruby-Beispiele anhand der aktuellen API und ermittle anschließend, ob die Dokumentation nur die Methode entfernen oder auch die unterstützte Alternative erläutern sollte. Als abgeschlossen gilt die Aufgabe, wenn die Dokumentation die verfügbaren Pathname-Methoden korrekt widerspiegelt und der Umfang geklärt ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- ruby
- Bereich
- build-system
- Issue-Typ
- Dokumentation
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 42/100