Sha256: b2497e7923626a3da14c59ecf2aa47aa0c2c0c4ec6c85e13bf007c119a10f8c2

Contents?: true

Size: 642 Bytes

Versions: 5

Compression:

Stored size: 642 Bytes

Contents

require 'open-uri'
require 'tins/string_version'

module Hackmac
  class KextDownload
    include Tins::StringVersion

    def initialize(name, version, url)
      @name    = name
      @url     = url
      @version = Version.new(version)
    end

    attr_reader :name

    attr_reader :version

    def download_asset
      data = URI.open(
        @url,
        'Accept' => 'application/octet-stream',
        &:read
      )
      return File.basename(@url), data
    end

    def inspect
      "#<#{self.class}: #{to_s}>"
    end

    def to_s
      "#{name} #{version}"
    end

    def to_s
      "#{name} #{version}"
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hackmac-0.8.3 lib/hackmac/kext_download.rb
hackmac-0.8.2 lib/hackmac/kext_download.rb
hackmac-0.8.1 lib/hackmac/kext_download.rb
hackmac-0.8.0 lib/hackmac/kext_download.rb
hackmac-0.7.0 lib/hackmac/kext_download.rb