Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def bump_version(file)
- content = File.read(file)
- versions_parts = content.match(/s\.version\s+=\s'(\d+)\.(\d+)\.(\d+)'/).to_a
- content.gsub!(/s\.version\s+=\s'\d+\.\d+\.\d+'/, "s.version = '#{versions_parts[1]}.#{versions_parts[2]}.#{versions_parts[3].to_i + 1}'")
- File.open(file, 'w') do |f|
- f.write(content)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement