Class: Pidgin2Adium::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/pidgin2adium/runner.rb

Constant Summary collapse

ADIUM_LOG_DIRECTORY =
Pathname.new(File.expand_path('~/Library/Application Support/Adium 2.0/Users/Default/Logs/'))

Instance Method Summary collapse

Constructor Details

#initialize(path_to_input_directory, aliases, output_directory) ⇒ Runner

Returns a new instance of Runner


5
6
7
8
9
# File 'lib/pidgin2adium/runner.rb', line 5

def initialize(path_to_input_directory, aliases, output_directory)
  @path_to_input_directory = path_to_input_directory
  @aliases = aliases
  @output_directory = output_directory || ADIUM_LOG_DIRECTORY
end

Instance Method Details

#runObject


11
12
13
14
15
16
17
18
19
20
# File 'lib/pidgin2adium/runner.rb', line 11

def run
  files_to_parse.each do |file_path|
    success = AdiumChatFileCreator.new(file_path, @aliases, @output_directory).create
    if success
      $stdout.print "."
    else
      $stderr.puts "\n!! Could not parse #{file_path}"
    end
  end
end