lib/yologga/logs_lifetime.rb in yologga-0.3.2 vs lib/yologga/logs_lifetime.rb in yologga-0.3.3
- old
+ new
@@ -14,10 +14,10 @@
entries = Dir.glob(pathname.dirname.join("#{pathname.basename}*")).map { |f| Pathname.new(f) }
entries.each do |entry|
next unless entry.file?
old_enough = entry.mtime < (Time.now - Yologga.logs_lifetime)
- if entry.basename.to_s =~ /\.log\.\d+\z/ && old_enough
+ if entry.basename.to_s =~ /\.log\.\d+(?:\.gz)?\z/ && old_enough
entry.delete
end
end
end
end