lib/desi/upstream.rb in desi-0.6.4 vs lib/desi/upstream.rb in desi-0.6.5

- old
+ new

@@ -1,9 +1,10 @@ # encoding: utf-8 require "desi/http_client" require "json" +require "semantic" module Desi class Upstream class Release < Struct.new(:version_name, :download_url) @@ -32,10 +33,10 @@ end protected def sortable_version - version_name.split('.').map {|c| c.to_i } + @sortable_version ||= Semantic::Version.new(version.sub(%r{.(beta|alpha|rc)}i, '-\1')) end end def initialize(opts = {}) @client = opts.fetch(:http_client_factory, Desi::HttpClient).new('https://api.github.com/')