Class: Extractors::Chromium

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

Overview

Chrome Bookmarks Extractor

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extractObject



9
10
11
# File 'lib/bkmrq/extractors/chromium.rb', line 9

def self.extract
  new.extract
end

Instance Method Details

#bookmarks_pathObject



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

def bookmarks_path
  case RbConfig::CONFIG['host_os']
  when /mswin|msys|mingw|cygwin|bccwin|wince/i
    File.expand_path('~/AppData/Local/Chromium/User Data/Default/Bookmarks')
  when /darwin|mac os/i
    File.expand_path('~/Library/Application Support/Chromium/Default/Bookmarks')
  when /linux/i, /solaris|bsd/i
    File.expand_path('~/.config/chromium/Default/Bookmarks')
  else
    raise Bkmrq::Extractors::Error, 'bkmrq is not supported on your OS.'
  end
end

#extractObject



13
14
15
# File 'lib/bkmrq/extractors/chromium.rb', line 13

def extract
  File.read(bookmarks_path)
end