Skip to content

Commit

Permalink
LogParser can accept directories, now
Browse files Browse the repository at this point in the history
If it encounters a directory in the argument list, it will recursively
go through the files in it and parse them. (no tests for this use-case)
  • Loading branch information
spikegrobstein committed Oct 4, 2012
1 parent b256c46 commit 6279f7a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/request_log_analyzer/source/log_parser.rb
Expand Up @@ -121,7 +121,9 @@ def parse_file(file, options = {}, &block)
@current_source = File.expand_path(file) @current_source = File.expand_path(file)
@source_changes_handler.call(:started, @current_source) if @source_changes_handler @source_changes_handler.call(:started, @current_source) if @source_changes_handler


if decompress_file?(file).empty? if File.directory?(@current_source)
parse_files(Dir["#{ @current_source }/*"], options, &block)
elsif decompress_file?(file).empty?


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

0 comments on commit 6279f7a

Please sign in to comment.