class AdobeCRX::PackageUtils

Public Class Methods

get_package_properties(package_file) click to toggle source
# File lib/adobe_crx/package_utils.rb, line 5
def self.get_package_properties(package_file)
  zipfile = Zip::ZipFile.new package_file.respond_to?(:path) ? package_file.path : package_file
  doc = REXML::Document.new(zipfile.read("META-INF/vault/properties.xml"))
  properties = Hash.new
  doc.elements.each("//properties/entry") do |ele|
    properties[ele.attributes['key']] = ele.text
  end
  return properties
end