开发者

Purpose of Underscore method in Buildr

开发者 https://www.devze.com 2023-03-15 11:13 出处:网络
Can anyone explain the purpose of the \"_\" (underscore) 开发者_JAVA技巧in the following code? Thanks.

Can anyone explain the purpose of the "_" (underscore) 开发者_JAVA技巧in the following code? Thanks.

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


In Buildr, the underscore method is an alias to the path_to method:

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


This could be a method that Buildr defines. You may need to hunt around and find it in the gem source. It's probably a helper method that expands that path specification.

0

精彩评论

暂无评论...
验证码 换一张
取 消