Class: SafariBookmarksParser::Commands::DumpCommand

Inherits:
BaseCommand
  • Object
show all
Defined in:
lib/safari_bookmarks_parser/commands/dump_command.rb

Instance Attribute Summary collapse

Attributes inherited from BaseCommand

#output_format, #output_path, #plist_path

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ DumpCommand

Returns a new instance of DumpCommand.



8
9
10
11
12
13
# File 'lib/safari_bookmarks_parser/commands/dump_command.rb', line 8

def initialize(argv)
  @output_style = :tree
  @output_parts = :all

  super
end

Instance Attribute Details

#output_partsObject (readonly)

Returns the value of attribute output_parts.



6
7
8
# File 'lib/safari_bookmarks_parser/commands/dump_command.rb', line 6

def output_parts
  @output_parts
end

#output_styleObject (readonly)

Returns the value of attribute output_style.



6
7
8
# File 'lib/safari_bookmarks_parser/commands/dump_command.rb', line 6

def output_style
  @output_style
end

Instance Method Details

#runObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/safari_bookmarks_parser/commands/dump_command.rb', line 15

def run
  plist_parser = Parser.parse(@plist_path)

  result = select_output_parts(plist_parser)
  result = select_output_style(result)

  text = format_to_text(result)

  output_text(text)
end