From 171cd53005c439ab76f2e8ca41d13b9b329a800c Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Mon, 25 Nov 2013 17:31:55 +0000 Subject: Ruby 1.8 compatibility fixes. --- lib/tasks/temp.rake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/tasks') diff --git a/lib/tasks/temp.rake b/lib/tasks/temp.rake index bdee3027b..67fa10174 100644 --- a/lib/tasks/temp.rake +++ b/lib/tasks/temp.rake @@ -12,10 +12,10 @@ namespace :temp do f = is_gz ? Zlib::GzipReader.open(log_file_path) : File.open(log_file_path, 'r') processed = 0 f.each_line do |line| - line.force_encoding('ASCII-8BIT') - if request_match = line.match(/^Started (?GET|OPTIONS|POST) "(?\/request\/.*?)"/) + line.force_encoding('ASCII-8BIT') if RUBY_VERSION.to_f >= 1.9 + if request_match = line.match(/^Started (GET|OPTIONS|POST) "(\/request\/.*?)"/) next if line.match(/request\/\d+\/response/) - urls[request_match[:path]] += 1 + urls[request_match[2]] += 1 processed += 1 end end -- cgit v1.2.3