Sha256: 9eba158bb18e196ea5c649e719b88b73a8c99bd7320649677630b24ef299f917

Contents?: true

Size: 1.32 KB

Versions: 17

Compression:

Stored size: 1.32 KB

Contents

# frozen_string_literal: true

#--
# Yast rake
#
# Copyright (C) 2009-2013 Novell, Inc.
#   This library is free software; you can redistribute it and/or modify
# it only under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
#   This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
# details.
#
#   You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#++
namespace :version do
  def version
    Yast::Tasks.spec_version
  end

  desc "Increase the last part of version in package/*.spec files"
  task :bump do
    version_parts = version.split(".")
    version_parts[-1] = (version_parts.last.to_i + 1).to_s
    new_version = version_parts.join(".")

    puts "Updating version to #{new_version}"

    # update all present *.spec files
    Dir.glob("package/*.spec").each do |spec_file|
      spec = File.read(spec_file)
      spec.gsub!(/^\s*Version:.*$/, "Version:        #{new_version}")

      File.write(spec_file, spec)
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
yast-rake-0.2.51 lib/tasks/version.rake
yast-rake-0.2.50 lib/tasks/version.rake
yast-rake-0.2.49 lib/tasks/version.rake
yast-rake-0.2.48 lib/tasks/version.rake
yast-rake-0.2.47 lib/tasks/version.rake
yast-rake-0.2.46 lib/tasks/version.rake
yast-rake-0.2.45 lib/tasks/version.rake
yast-rake-0.2.44 lib/tasks/version.rake
yast-rake-0.2.43 lib/tasks/version.rake
yast-rake-0.2.42 lib/tasks/version.rake
yast-rake-0.2.41 lib/tasks/version.rake
yast-rake-0.2.40 lib/tasks/version.rake
yast-rake-0.2.39 lib/tasks/version.rake
yast-rake-0.2.38 lib/tasks/version.rake
yast-rake-0.2.37 lib/tasks/version.rake
yast-rake-0.2.36 lib/tasks/version.rake
yast-rake-0.2.34 lib/tasks/version.rake