Sha256: b2a129b378c21fd21bdf7d569c84868a2e29f6fdb1595fa43ac4bafea4b38c1e

Contents?: true

Size: 886 Bytes

Versions: 17

Compression:

Stored size: 886 Bytes

Contents

module Hackmac
  include Hackmac::AssetTools

  class OCValidator
    def initialize(mdev:, config:)
      @config = config
      mount_path   = Pathname.new('/Volumes').join(mdev)
      @config_plist =
        Pathname.new(mount_path).join(@config.oc.efi_path).join('OC/config.plist')
    end

    def perform
      isolate do |dir|
        oc = OC.new(config: @config)
        name, data = oc.remote.download_asset
        if name
          File.secure_write(name, data)
          decompress(name)
          result = %x(Utilities/ocvalidate/ocvalidate #{@config_plist.to_s.inspect} 2>&1)
          if $?.success?
            STDERR.puts result
            true
          else
            STDERR.puts "Validation has failed!", "", result
            false
          end
          true
        else
          fail "#{oc} could not be downloaded"
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
hackmac-1.8.0 lib/hackmac/oc_validator.rb
hackmac-1.7.1 lib/hackmac/oc_validator.rb
hackmac-1.7.0 lib/hackmac/oc_validator.rb
hackmac-1.6.1 lib/hackmac/oc_validator.rb
hackmac-1.6.0 lib/hackmac/oc_validator.rb
hackmac-1.5.1 lib/hackmac/oc_validator.rb
hackmac-1.5.0 lib/hackmac/oc_validator.rb
hackmac-1.4.2 lib/hackmac/oc_validator.rb
hackmac-1.4.1 lib/hackmac/oc_validator.rb
hackmac-1.4.0 lib/hackmac/oc_validator.rb
hackmac-1.3.0 lib/hackmac/oc_validator.rb
hackmac-1.2.1 lib/hackmac/oc_validator.rb
hackmac-1.2.0 lib/hackmac/oc_validator.rb
hackmac-1.1.3 lib/hackmac/oc_validator.rb
hackmac-1.1.2 lib/hackmac/oc_validator.rb
hackmac-1.1.1 lib/hackmac/oc_validator.rb
hackmac-1.1.0 lib/hackmac/oc_validator.rb