lib/acs/ldap/logger.rb in acs-ldap-0.2.3 vs lib/acs/ldap/logger.rb in acs-ldap-0.2.4
- old
+ new
@@ -44,10 +44,14 @@
def self.clear
%x(echo > #{file_path})
end
def self.size
- File.new(file_path).size
+ if File.exist?(file_path)
+ File.new(file_path).size
+ else
+ 0
+ end
end
def self.targz_file_path
targz_file_name = "#{file_name}-" + %x(date "+%Y%m%d_%H%M%S").gsub("\n", '') + ".gz"
Rails.root.join("log", targz_file_name).to_s