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.
精彩评论