Sha256: 6ad44c5b0f86c7c06007367a10f3f1415d56fc741f352a8364aaaf41c796344d
Contents?: true
Size: 1.62 KB
Versions: 6
Compression:
Stored size: 1.62 KB
Contents
# # Copyright:: Copyright (c) 2016 Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # namespace :version do desc "Bump patch version in lib/chef-dk/version.rb and update Gemfile*.lock conservatively to include the new version. If Gemfile has changed, this will update modified constraints as well." task :bump => %w{version:bump_patch bundle:install} desc "Show the current version." task :show do puts ChefDK::VERSION end def version_rb_path File.expand_path("../../lib/chef-dk/version.rb", __FILE__) end # Add 1 to the current patch version in the VERSION file, and write it back out. desc "Bump the patch version in lib/chef-dk/version.rb." task :bump_patch do current_version_file = IO.read(version_rb_path) new_version = nil new_version_file = current_version_file.sub(/^(\s*VERSION\s*=\s*")(\d+\.\d+\.)(\d+)/) do new_version = "#{$2}#{$3.to_i + 1}" "#{$1}#{new_version}" end puts "Updating version in #{version_rb_path} from #{ChefDK::VERSION} to #{new_version.chomp}" IO.write(version_rb_path, new_version_file) end end
Version data entries
6 entries across 6 versions & 1 rubygems