class Runoff::Commandline::Command

Public: A base class for all runoff commands except None.

Should be used only by inheriting.

Attributes

parser[R]

Public: Returns an OptionParser object

Public Instance Methods

execute(args) { |chat, file_writer| ... } click to toggle source

Public: executes the command.

args - An Array of commandline arguments.

# File lib/runoff/commandline/command.rb, line 19
def execute(args)
  puts 'Exporting...'.colorize :green

  db_location = Location.get_database_path args, @options
  chat = Chat.new db_location, @options
  file_writer = FileWriter.new @options

  yield chat, file_writer if block_given?

  file_writer.archive if @options[:archive]

  puts 'Finished.'.colorize :green
end