Class: SycLink::InternetExplorer
- Defined in:
- lib/syclink/internet_explorer.rb
Overview
Importer for Internet Explorer
Instance Attribute Summary
Attributes inherited from Importer
Instance Method Summary collapse
-
#read ⇒ Object
Reads the links from the Internet Explorer’s bookmarks directory.
Methods inherited from Importer
Constructor Details
This class inherits a constructor from SycLink::Importer
Instance Method Details
#read ⇒ Object
Reads the links from the Internet Explorer’s bookmarks directory
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/syclink/internet_explorer.rb', line 10 def read files = Dir.glob(File.join(path, "**/*")) regex = Regexp.new("(?<=#{path}).*") files.map do |file| unless ((File.directory? file) || (File.extname(file).upcase != ".URL")) url = File.read(file).scan(/(?<=\nURL=)(.*)$/).flatten.first name = File.basename(file, ".*") description = "" tag = (File.dirname(file).scan(regex)) [url, name, description, tag] end end.compact end |