class SemVer

def format fmt

def format fmt
  fmt = fmt.gsub '%M', @major.to_s
  fmt = fmt.gsub '%m', @minor.to_s
  fmt = fmt.gsub '%p', @patch.to_s
  if @special.nil? or @special.length == 0 then
    fmt = fmt.gsub '%s', ''
  else
    fmt = fmt.gsub '%s', "-" + @special.to_s
  end
  fmt
end