Sha256: 43c0179d30153d67947bdacb4dde14b2724e43d91ef3d07e79913fe52ce9bf80

Contents?: true

Size: 489 Bytes

Versions: 4

Compression:

Stored size: 489 Bytes

Contents

require 'net/http'
require 'rexml/document'

module Latest
  class RubiniusRetriever

    include REXML

    def retrieve(rbx)
      page = Net::HTTP.get(URI(rbx.source))
      xml  = Document.new(page)
      all_versions = XPath.match(xml, '//Contents//Key').map(&:text)
      candidates = all_versions.find_all { |v| v =~ /\Arubinius-/ }
      stables = candidates.flat_map { |v| v.scan(/-(\d\.\d\.\d)\.tar/) }.flatten
      stables.map { |v| RubyVersion.new(v) }.max
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
latest_ruby-0.0.4 lib/latest_ruby/retrievers/rubinius_retriever.rb
latest_ruby-0.0.3 lib/latest_ruby/retrievers/rubinius_retriever.rb
latest_ruby-0.0.2 lib/latest_ruby/retrievers/rubinius_retriever.rb
latest_ruby-0.0.1 lib/latest_ruby/retrievers/rubinius_retriever.rb