Module: Device::Kindle

Includes:
BackupBookmarkUtility
Defined in:
lib/device/kindle.rb

Constant Summary collapse

PHYSICAL_SUPPORT =
true
VOLUME_NAME =
"Kindle"
DOCUMENTS_PATH_LIST =
%w(documents Documents Books)
EBOOK_FILE_EXT =
".mobi"
NAME =
"Kindle"
DISPLAY_NAME =
"Kindle"
{
  "default.enable_half_indent_bracket" => true,
}

Instance Method Summary collapse

Methods included from BackupBookmarkUtility

#get_storage_path

Instance Method Details

#backup_bookmarkObject



23
24
25
26
27
28
29
# File 'lib/device/kindle.rb', line 23

def backup_bookmark
  documents_path = get_documents_path
  raise Device::DontConneting unless documents_path
  paths = Dir.glob(File.join(documents_path, "*.sdr/*.azw3{f,r}"))
  Helper.copy_files(paths, get_storage_path, exception: false)
  paths.size
end

#restore_bookmarkObject



31
32
33
34
35
36
37
# File 'lib/device/kindle.rb', line 31

def restore_bookmark
  documents_path = get_documents_path
  raise Device::DontConneting unless documents_path
  paths = Dir.glob(File.join(get_storage_path, "*.sdr/*"))
  Helper.copy_files(paths, documents_path, exception: false)
  paths.size
end