class TomlVersioner
Constants
- VERSION_REGEX
Public Instance Methods
get_current_version()
click to toggle source
# File lib/rake-extensions.rb, line 99 def get_current_version() current_version_with_regex(['Cargo.toml'], VERSION_REGEX) end
update_version(new_version)
click to toggle source
# File lib/rake-extensions.rb, line 102 def update_version(new_version) FileUtils.cd @version_dir, :verbose => false do ['Cargo.toml'].each do |file| text = File.read(file) new_contents = text.gsub(VERSION_REGEX, "\\1#{new_version}\\3") File.open(file, "w") { |f| f.puts new_contents } end end end