Pathname#pathmap is still (erronously) documented
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 42/100
- Issue 类型
- 文档
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- ruby
- 领域
- build-system
调研方向
从链接的 Pathname 文档开始,并查看 issue #130,以了解为什么移除了 Pathname#pathmap。根据当前 API 检查报告中的 Ruby 示例,然后确定文档是否只应删除该方法,还是还应说明受支持的替代方案。完成标准是文档准确反映可用的 Pathname 方法,并且范围问题已解决。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Ruby
- 星标
- 2.5k
- 派生
- 650
- 平均合并
- 6 分钟
- 30 天内合并 PR
- 3
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ruby/rake 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 68/100
-
难度 3/5 1-2 天 新手友好度 48/100
-
难度 5/5 一周以上 新手友好度 28/100
-
难度 1/5 1 小时以内 新手友好度 45/100
-
难度 4/5 3-5 天 新手友好度 38/100
相似的 Issue
-
SyncEm always forwards a dummy block, so wrapped methods lose their no-block/Enumerator behavior 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
endoflife-date/endoflife.date#11086 ·
-
internal
难度 1/5 1 小时以内 新手友好度 88/100
Kong/developer.konghq.com#7322 ·
-
bug P2
难度 2/5 1-3 小时 新手友好度 88/100