lib/buildr/core/build.rb
def with_release_candidate_version
      release_candidate_buildfile = Buildr.application.buildfile.to_s + '.next'
      release_candidate_buildfile_contents = change_version { |version| version[-1] = version[-1].to_i }
      File.open(release_candidate_buildfile, 'w') { |file| file.write release_candidate_buildfile_contents }
      begin
        yield release_candidate_buildfile
        mv release_candidate_buildfile, Buildr.application.buildfile.to_s
      ensure
        rm release_candidate_buildfile rescue nil
      end
    end
# :call-seq:
#   with_release_candidate_version() { |filename| ... }
#
# Yields to block with release candidate buildfile, before committing to use it.
#
# We need a Buildfile with upgraded version numbers to run the build, but we don't want the
# Buildfile modified unless the build succeeds. So this method updates the version number in
# a separate (Buildfile.next) file, yields to the block with that filename, and if successful
# copies the new file over the existing one.
#
# The release version is the current version without '-SNAPSHOT'.  So:
#   THIS_VERSION = 1.1.0-SNAPSHOT
# becomes:
#   THIS_VERSION = 1.1.0
# for the release buildfile.
:call-seq:
with_release_candidate_version() { |filename| ...

Yields to block with release candidate buildfile, before committing to use it.

We need a Buildfile with upgraded version numbers to run the build, but we don't want the
Buildfile modified unless the build succeeds. So this method updates the version number in
a separate (Buildfile.next) file, yields to the block with that filename, and if successful
copies the new file over the existing one.

The release version is the current version without '-SNAPSHOT'.
: call - seq : with_release_candidate_version () { |filename| ... Yields to block with release candidate buildfile before committing to use it . We need a Buildfile with upgraded version numbers to run the build but we don ' t want the Buildfile modified unless the build succeeds . So this method updates the version number in a separate ( Buildfile . next ) file yields to the block with that filename and if successful copies the new file over the existing one . The release version is the current version without ' - SNAPSHOT ' .
def with_release_candidate_version
      release_candidate_buildfile = Buildr.application.buildfile.to_s + '.next'
      release_candidate_buildfile_contents = change_version { |version| version[-1] = version[-1].to_i }
      File.open(release_candidate_buildfile, 'w') { |file| file.write release_candidate_buildfile_contents }
      begin
        yield release_candidate_buildfile
        mv release_candidate_buildfile, Buildr.application.buildfile.to_s
      ensure
        rm release_candidate_buildfile rescue nil
      end
    end
def with_release_candidate_version release_candidate_buildfile = Buildr . application . buildfile . to_s + '.next' release_candidate_buildfile_contents = change_version { | version | version [ - 1 ] = version [ - 1 ] . to_i } File . open ( release_candidate_buildfile , 'w' ) { | file | file . write release_candidate_buildfile_contents } begin yield release_candidate_buildfile mv release_candidate_buildfile , Buildr . application . buildfile . to_s ensure rm release_candidate_buildfile rescue nil end end
:call-seq:
with_release_candidate_version() { |filename| ... }
: call - seq : with_release_candidate_version () { |filename| ... }