Skip to content
Browse files

LogParser can accept directories, now

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...
1 parent b256c46 commit 6279f7a5515301e6d63c6c13a624013aaeeb0836 @spikegrobstein spikegrobstein committed Oct 4, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/request_log_analyzer/source/log_parser.rb
View
4 lib/request_log_analyzer/source/log_parser.rb
@@ -121,7 +121,9 @@ def parse_file(file, options = {}, &block)
@current_source = File.expand_path(file)
@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.call(:started, file) if @progress_handler

0 comments on commit 6279f7a

Please sign in to comment.
Something went wrong with that request. Please try again.