class XSemVer::SemVer

def <=> other

Compare version numbers according to SemVer 2.0.0-rc2
def <=> other
  [:major, :minor, :patch].each do |method|
    comparison = (send(method) <=> other.send(method))
    return comparison unless comparison == 0
  end
  PreRelease.new(prerelease) <=> PreRelease.new(other.prerelease)
end