MyDocument.rb
def conditional_reload
		return if !File.exists?(@file)
		
		new_mtime = File.new(@file).mtime
		
		if @mtime.nil? || @mtime < new_mtime
			@mtime = new_mtime
			reload
		end
	end
###
# Calls reload if the db file has been modified since last reload
###
Calls reload if the db file has been modified since last reload
Calls reload if the db file has been modified since last reload
def conditional_reload
		return if !File.exists?(@file)
		new_mtime = File.new(@file).mtime
		if @mtime.nil? || @mtime < new_mtime
			@mtime = new_mtime
			reload
		end
	end
def conditional_reload return if ! File . exists? ( @file ) new_mtime = File . new ( @file ) . mtime if @mtime . nil? || @mtime < new_mtime @mtime = new_mtime reload end end
Calls reload if the db file has been modified since last reload
Calls reload if the db file has been modified since last reload