def parse_file(file, options = {}, &block)
      if File.directory?(file)
        parse_files(Dir["#{ file }/*"], options, &block)
        return
      end

      @current_source = File.expand_path(file)
      @source_changes_handler.call(:started, @current_source) if @source_changes_handler

      if decompress_file?(file).empty?

        @progress_handler = @dormant_progress_handler
        @progress_handler.call(:started, file) if @progress_handler

        File.open(file, 'rb') { |f| parse_io(f, options, &block) }

        @progress_handler.call(:finished, file) if @progress_handler
        @progress_handler = nil

        @processed_files.push(@current_source.dup)

      else
        IO.popen(decompress_file?(file), 'rb') { |f| parse_io(f, options, &block) }
      end

      @source_changes_handler.call(:finished, @current_source) if @source_changes_handler

      @current_source = nil
    end
def parse_file(file, options = {}, &block)
      if File.directory?(file)
        parse_files(Dir["#{ file }/*"], options, &block)
        return
      end

      @current_source = File.expand_path(file)
      @source_changes_handler.call(:started, @current_source) if @source_changes_handler

      if decompress_file?(file).empty?

        @progress_handler = @dormant_progress_handler
        @progress_handler.call(:started, file) if @progress_handler

        File.open(file, 'rb') { |f| parse_io(f, options, &block) }

        @progress_handler.call(:finished, file) if @progress_handler
        @progress_handler = nil

        @processed_files.push(@current_source.dup)

      else
        IO.popen(decompress_file?(file), 'rb') { |f| parse_io(f, options, &block) }
      end

      @source_changes_handler.call(:finished, @current_source) if @source_changes_handler

      @current_source = nil
    end
Parses a log file. Creates an IO stream for the provided file, and sends it to parse_io for
 further handling. This method supports progress updates that can be used to display a progressbar

 If the logfile is compressed, it is uncompressed to stdout and read.
 TODO: Check if IO.popen encounters problems with the given command line.
 TODO: Fix progress bar that is broken for IO.popen, as it returns a single string.

 <tt>file</tt>:: The file that should be parsed.
 <tt>options</tt>:: A Hash of options that will be pased to parse_io.