Class: Booker::Parsers::Safari
Overview
Safari bookmark parser (binary plist format)
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Booker::Parsers::Base
Instance Method Details
#parse ⇒ Object
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 |
# File 'lib/booker/parsers.rb', line 196 def parse xml = convert_plist_to_xml(@file_path) return if xml.nil? begin require "rexml/document" doc = REXML::Document.new(xml) plist_el = doc.root root_node = plist_el.elements.to_a.first root = parse_node(root_node) rescue => e warn "Warning: ".yel + "Could not parse Safari bookmarks: #{e.}" return end walk(root, "|") end |