Class: Extractors::Safari

Inherits:
Object
  • Object
show all
Defined in:
lib/bkmrq/extractors/safari.rb

Overview

Chrome Bookmarks Extractor

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extractObject



8
9
10
# File 'lib/bkmrq/extractors/safari.rb', line 8

def self.extract
  new.extract
end

Instance Method Details

#bookmarks_pathObject



16
17
18
19
20
21
22
# File 'lib/bkmrq/extractors/safari.rb', line 16

def bookmarks_path
  unless /darwin|mac os/i.match?(RbConfig::CONFIG['host_os'])
    raise Bkmrq::Extractors::Error, 'bkmrq does not support Safari on your OS'
  end

  File.expand_path('~/Library/Safari/Bookmarks.plist')
end

#extractObject



12
13
14
# File 'lib/bkmrq/extractors/safari.rb', line 12

def extract
  File.read(bookmarks_path)
end