Class: Extractors::Firefox

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

Overview

Chrome Bookmarks Extractor

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extractObject



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

def self.extract
  new.extract
end

Instance Method Details

#bookmarks_pathObject



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/bkmrq/extractors/firefox.rb', line 16

def bookmarks_path
  case RbConfig::CONFIG['host_os']
  when /mswin|msys|mingw|cygwin|bccwin|wince/i
    File.expand_path('~/AppData/Roaming/Mozilla/Firefox/Profiles/{PROFILE_FOLDER}/bookmarks.html')
  when /darwin|mac os/i
    File.expand_path('~/Library/Application Support/Firefox/Profiles/{PROFILE_FOLDER}/bookmarks.html')
  when /linux/i, /solaris|bsd/i
    File.expand_path('~/.mozilla/firefox/{PROFILE_FOLDER}/bookmarks.html')
  else
    raise Bkmrq::Extractors::Error, 'bkmrq is not supported on your OS.'
  end
end

#extractObject



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

def extract
  File.read(bookmarks_path)
end