Sha256: ffe9520313cde231fff397cc353f3e27f7480c65d63c8b6a880fc8a869f2d38a

Contents?: true

Size: 610 Bytes

Versions: 27

Compression:

Stored size: 610 Bytes

Contents

require 'faraday'
require 'multi_json'

module Cloudstrap
  class ComponentVersions
    def initialize(config)
      @config = config
      self
    end

    def hcp
      version_from https.get @config.hcp_metadata
    end

    def hce
      version_from https.get @config.hce_metadata
    end

    def hsm
      version_from https.get @config.hsm_metadata
    end

    private

    def https
      @https ||= Faraday.new "https://#{@config.artifact_origin}"
    end

    def version_from(response)
      return unless response.success?

      MultiJson.load(response.body).fetch('Version')
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
cloudstrap-0.51.1.pre lib/cloudstrap/component_versions.rb
cloudstrap-0.50.1.pre lib/cloudstrap/component_versions.rb
cloudstrap-0.49.12.pre lib/cloudstrap/component_versions.rb
cloudstrap-0.49.11.pre lib/cloudstrap/component_versions.rb
cloudstrap-0.49.10.pre lib/cloudstrap/component_versions.rb
cloudstrap-0.49.8.pre lib/cloudstrap/component_versions.rb
cloudstrap-0.49.4.pre lib/cloudstrap/component_versions.rb
cloudstrap-0.49.2.pre lib/cloudstrap/component_versions.rb
cloudstrap-0.49.1.pre lib/cloudstrap/component_versions.rb
cloudstrap-0.49.0.pre lib/cloudstrap/component_versions.rb
cloudstrap-0.48.15.pre lib/cloudstrap/component_versions.rb
cloudstrap-0.48.2.pre lib/cloudstrap/component_versions.rb
cloudstrap-0.48.0.pre lib/cloudstrap/component_versions.rb
cloudstrap-0.47.8.pre lib/cloudstrap/component_versions.rb
cloudstrap-0.47.7.pre lib/cloudstrap/component_versions.rb
cloudstrap-0.47.2.pre lib/cloudstrap/component_versions.rb
cloudstrap-0.47.0.pre lib/cloudstrap/component_versions.rb
cloudstrap-0.46.7.pre lib/cloudstrap/component_versions.rb
cloudstrap-0.46.4.pre lib/cloudstrap/component_versions.rb
cloudstrap-0.46.3.pre lib/cloudstrap/component_versions.rb