Class: Pincerna::SafariBookmark

Inherits:
Bookmark show all
Defined in:
lib/pincerna/safari_bookmark.rb

Overview

Show the list of Safari bookmarks.

Constant Summary collapse

ICON =

The icon to show for each feedback item.

Pincerna::Base::ROOT + "/images/safari.png"
BOOKMARKS_DATA =

The file with bookmarks data.

File.expand_path("~/Library/Safari/Bookmarks.plist")

Constants inherited from Bookmark

Bookmark::MATCHER, Bookmark::SEPARATOR

Constants inherited from Base

Base::CACHE_ROOT, Base::FULL_NAME, Base::MATCHER, Base::RELEVANT_MATCHES, Base::ROOT, Base::TYPES, Base::WORKFLOW_ROOT

Instance Attribute Summary

Attributes inherited from Base

#format, #format_content_type, #output

Instance Method Summary collapse

Methods inherited from Bookmark

#perform_filtering, #process_results

Methods inherited from Base

#add_feedback_item, execute!, #filter, #format_float, #initialize, #output_feedback, #perform_filtering, #process_results, #round_float

Constructor Details

This class inherits a constructor from Pincerna::Base

Instance Method Details

#read_bookmarksObject

Reads the list of Safari Bookmarks.



17
18
19
20
21
22
23
24
25
# File 'lib/pincerna/safari_bookmark.rb', line 17

def read_bookmarks
  data = execute_command("/usr/bin/plutil", "-convert", "xml1", "-o", "-", BOOKMARKS_DATA)

  if data && !data.empty? then
    Plist.parse_xml(data)["Children"].each do |children|
      scan_folder(children, "")
    end
  end
end