lib/buildr/core/build.rb
# :call-seq:
#   change_version() { |this_version| ... } => buildfile
#
# Change version number in the current Buildfile, but without writing a new file (yet).
# Returns the contents of the Buildfile with the modified version number.
#
# This method yields to the block with the current (this) version number as an array and expects
# the block to update it.


Change version number in the current Buildfile, but without writing a new file (yet).
Returns the contents of the Buildfile with the modified version number.

This method yields to the block with the current (this) version number as an array and expects
the block to update it.
Change version number in the current Buildfile but without writing a new file ( yet ) . Returns the contents of the Buildfile with the modified version number . This method yields to the block with the current ( this ) version number as an array and expects the block to update it .
def change_version
      this_version = extract_version
      new_version = this_version.split('.')
      yield(new_version)
      new_version = new_version.join('.')
      buildfile = File.read(Buildr.application.buildfile.to_s)
      buildfile.gsub(THIS_VERSION_PATTERN) { |ver| ver.sub(/(["']).*\1/, %Q{"#{new_version}"}) }
    end
def change_version this_version = extract_version new_version = this_version . split ( '.' ) yield ( new_version ) new_version = new_version . join ( '.' ) buildfile = File . read ( Buildr . application . buildfile . to_s ) buildfile . gsub ( THIS_VERSION_PATTERN ) { | ver | ver . sub ( / (["']).* \1 / , %Q{"#{new_version}"} ) } end
:call-seq:
change_version() { |this_version| ... } => buildfile
: call - seq : change_version () { |this_version| ... } = > buildfile