Builder中Underscore方法的用途

时间:2011-06-24 16:47:31

标签: ruby buildr

任何人都可以在下面的代码中解释“_”(下划线)的用途吗?感谢。

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

2 个答案:

答案 0 :(得分:10)

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

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

答案 1 :(得分:0)

这可能是Buildr定义的方法。您可能需要寻找并在宝石源中找到它。它可能是一种扩展路径规范的辅助方法。

相关问题