bump in mixed_gauge-1.2.0.beta2 vs bump in mixed_gauge-1.2.0
- old
+ new
@@ -9,11 +9,16 @@
regexp = /VERSION = '(.+)'.freeze$/
version = File.read(path).scan(regexp)[0][0]
version_strs = version.split('.')
if version_strs.size > 3
- warn "Current version includes a prelease suffix, drop it: #{version}"
+ puts "Current version includes a prelease suffix, drop it: #{version}"
version_strs = version_strs[0..2]
+ next_version = version_strs.join('.')
+ File.write(path, File.read(path).gsub(regexp, "VERSION = '#{next_version}'.freeze"))
+ system('git', 'add', path)
+ system('git', 'commit', '-m', "v#{next_version}")
+ exit
end
case level
when 'tiny'
version_strs[2] = version_strs[2].to_i + 1