lib/buildr/core/build.rb
# :call-seq:
#   tag_url(svn_url, version) => tag_url
#
# Returns the SVN url for the tag.
# Can tag from the trunk or from branches.
# Can handle the two standard repository layouts.
#   - http://my.repo/foo/trunk => http://my.repo/foo/tags/1.0.0
#   - http://my.repo/trunk/foo => http://my.repo/tags/foo/1.0.0


Returns the SVN url for the tag.
Can tag from the trunk or from branches.
Can handle the two standard repository layouts.
Returns the SVN url for the tag . Can tag from the trunk or from branches . Can handle the two standard repository layouts .
def tag_url(svn_url, tag)
      trunk_or_branches = Regexp.union(%r{^(.*)/trunk(.*)$}, %r{^(.*)/branches(.*)/([^/]*)$})
      match = trunk_or_branches.match(svn_url)
      prefix = match[1] || match[3]
      suffix = match[2] || match[4]
      prefix + '/tags' + suffix + '/' + tag
    end
def tag_url ( svn_url , tag ) trunk_or_branches = Regexp . union ( %r{ ^(.*)/trunk(.*)$ } , %r{ ^(.*)/branches(.*)/([^/]*)$ } ) match = trunk_or_branches . match ( svn_url ) prefix = match [ 1 ] || match [ 3 ] suffix = match [ 2 ] || match [ 4 ] prefix + '/tags' + suffix + '/' + tag end
:call-seq:
tag_url(svn_url, version) => tag_url
: call - seq : tag_url ( svn_url version ) = > tag_url
svn_url
tag