gpt4 book ai didi

ruby - Buildr 中 Underscore 方法的用途

转载 作者:数据小太阳 更新时间:2023-10-29 07:44:28 25 4
gpt4 key购买 nike

谁能解释一下下面代码中“_”(下划线)的用途?谢谢。

package(:zip).include _('target/docs/*')

最佳答案

在 Buildr 中,underscore method is an alias to the path_to method :

_('foo', 'bar')
# => foo/bar
_('/tmp')
# => /tmp
_(:base_dir, 'foo')
# => /home/project1/foo

关于ruby - Buildr 中 Underscore 方法的用途,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6471054/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com