Campers : Beware of time warps!

by Gregory Brown

Just because Everyone Is Here In The Future, doesn't mean you should be too!

The culprit, in camping's reloader:

86 # The timestamp of the most recently modified app dependency.
87 def mtime
88 ((@requires || []) + [@script]).map do |fname|
89 fname = fname.gsub(/^#{Regexp::quote File.dirname(@script)}\//, '')
90 begin
91 File.mtime(File.join(File.dirname(@script), fname))
92 rescue Errno::ENOENT
93 remove_app
94 @mtime
95 end
96 end.max
97 end

If your most recent modified time is more recent than your current system time, your reloader will break until you go Back To The Future.

I figure this is probably a rare case, and not really a bug, but if you're playing around with system time dependant apps (I am), this might bite you.


2007-04-29 16:01:17
Clearly everyone should only write code in the past from now on.