Sha256: 9a9b94e3b9d2f1b80021d42870f77e5f6c8a82b55eb8c3e3f2a2a5cba69ef40b
Contents?: true
Size: 588 Bytes
Versions: 293
Compression:
Stored size: 588 Bytes
Contents
rule /^version:bump:.*/ do |t| sh "git status | grep 'nothing to commit'" # ensure we are not dirty index = ['major', 'minor','patch'].index(t.name.split(':').last) file = 'lib/GEM_NAME/version.rb' version_file = File.read(file) old_version, *version_parts = version_file.match(/(\d+)\.(\d+)\.(\d+)/).to_a version_parts[index] = version_parts[index].to_i + 1 new_version = version_parts * '.' File.open(file,'w'){|f| f.write(version_file.sub(old_version, new_version)) } sh "bundle && git add #{file} Gemfile.lock && git commit -m 'bump version to #{new_version}'" end
Version data entries
293 entries across 293 versions & 1 rubygems