Class: Runoff::Commands::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/runoff/commands/command.rb

Overview

The base class for every runoff command.

Direct Known Subclasses

All, Some

Class Method Summary collapse

Class Method Details

.get_file_writer_components(args, options) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/runoff/commands/command.rb', line 6

def self.get_file_writer_components(args, options)
  if args.empty? && !options.from
    raise ArgumentError.new 'Error: You must specify the Skype username or a --from option'
  end

  main_db_path = Runoff::Location.get_database_path args[0], options
  export_path  = Runoff::Location.get_export_path options
  db_handler   = Sequel.sqlite main_db_path

  return Runoff::FileWriter.new(db_handler), export_path
end