Search code examples
rubybuildr

Purpose of Underscore method in Buildr


Can anyone explain the purpose of the "_" (underscore) in the following code? Thanks.

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


Solution

  • 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