Class: SafariBookmarksParser::Commands::EmptyCommand
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- SafariBookmarksParser::Commands::EmptyCommand
- Defined in:
- lib/safari_bookmarks_parser/commands/empty_command.rb
Instance Attribute Summary
Attributes inherited from BaseCommand
#output_format, #output_path, #plist_path
Instance Method Summary collapse
Methods inherited from BaseCommand
Constructor Details
This class inherits a constructor from SafariBookmarksParser::Commands::BaseCommand
Instance Method Details
#run ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/safari_bookmarks_parser/commands/empty_command.rb', line 6 def run plist_parser = Parser.parse(@plist_path) empty_folders = Services::FindEmptyFolders.call(root_folder: plist_parser.root_folder) return if empty_folders.empty? text = format_to_text(empty_folders.map(&:to_h)) output_text(text) end |