lib/rally_user_helper.rb
# Given the name of a file, calculates age of that file
Given the name of a file, calculates age of that file
Given the name of a file calculates age of that file
def calc_file_age(filename)
      today = Time.now
      file_age = 10000
      if !FileTest.exist?(filename) then
        return file_age
      end
      file_reference = File.new(filename, "r")
      file_age = ((today - file_reference.mtime)/86400).ceil
      return file_age
    end
def calc_file_age ( filename ) today = Time . now file_age = 10000 if ! FileTest . exist? ( filename ) then return file_age end file_reference = File . new ( filename , "r" ) file_age = ( ( today - file_reference . mtime ) / 86400 ) . ceil return file_age end
Given the name of a file, calculates age of that file
Given the name of a file calculates age of that file
# Return really big number to prompt refresh if files not found # Maintain "really big" age and return # Round fractional days up
filename