Sha256: 89f94e5ac3d997a370760dc40a9c1be9f85551a9b174d638ba053cb5ca6f92c8

Contents?: true

Size: 516 Bytes

Versions: 3

Compression:

Stored size: 516 Bytes

Contents

require 'yaml'
require 'open-uri'

module Box
  module Release
    class Loader

      attr_reader :url

      def initialize(url)
        @url = url
      end

      def self.release_at(url)
        new(url).release if url
      end

      def attributes
        @attributes ||= YAML.load open(url,&:read) 
      rescue => e
        Box::Release.logger.error "Can't load attributes from #{url} : #{e}"
        {}
      end

      def release
        Box::Release::Memory.new attributes
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
box-release-0.0.3 lib/box/release/loader.rb
box-release-0.0.2 lib/box/release/loader.rb
box-release-0.0.1 lib/box/release/loader.rb