class JsonVersioner

Constants

VERSION_REGEX

Public Instance Methods

get_current_version() click to toggle source
# File lib/rake-extensions.rb, line 132
def get_current_version()
  current_version_with_regex(['package.json'], VERSION_REGEX)
end
update_version(new_version) click to toggle source
# File lib/rake-extensions.rb, line 135
def update_version(new_version)
  FileUtils.cd @version_dir, :verbose => false do
    ['package.json'].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