aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/tasks/temp.rake6
1 files changed, 3 insertions, 3 deletions
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 (?<method>GET|OPTIONS|POST) "(?<path>\/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