Class: IPT::Propertylist::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/ipt/plist.rb

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Parser

Returns a new instance of Parser.



7
8
9
10
11
12
# File 'lib/ipt/plist.rb', line 7

def initialize(path)
  if File.file?(path)
    type = `file '#{path}'`
    @xml = type =~ /Apple binary property list/ ? `plutil -convert xml1  -o - '#{path}'` : path
  end
end

Instance Method Details

#parseObject



14
15
16
# File 'lib/ipt/plist.rb', line 14

def parse
  ::Plist::parse_xml(@xml) if @xml
end