Class: AdobeCRX::PackageUtils

Inherits:
Object
  • Object
show all
Defined in:
lib/adobe_crx/package_utils.rb

Class Method Summary collapse

Class Method Details

.get_package_properties(package_file) ⇒ Object



5
6
7
8
9
10
11
12
13
# 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