public
Rubygem
Description: Ruby osx/plist extension for reading/writing property lists
Clone URL: git://github.com/kballard/osx-plist.git
Search Repo:
• truncate the date parsed to 1970 ± INT_MAX so to not cause a Ruby 
exception when the date is out of range (e.g. when using NSDate’s 
distantPast or distantFuture)
kballard (author)
Sun Feb 26 06:52:55 -0800 2006
commit  fee9a8be9a683b9c48304e4d18fe41f2334db4ce
tree    eb6254fce1cc5b7a3e19fdc3667db6a23575783e
parent  679c8be4176e34f845feef1063c94a2785630f4c
...
295
296
297
 
 
 
 
 
 
298
299
300
...
295
296
297
298
299
300
301
302
303
304
305
306
0
@@ -295,6 +295,12 @@
0
 // Converts a CFDateRef to a Time
0
 VALUE convertDateRef(CFDateRef plist) {
0
   CFAbsoluteTime seconds = CFDateGetAbsoluteTime(plist);
0
+
0
+ // trunace the time since Ruby's Time object stores it as a 32 bit signed offset from 1970 (undocumented)
0
+ const float min_time = -3124310400.0f;
0
+ const float max_time = 1169098047.0f;
0
+ seconds = seconds < min_time ? min_time : (seconds > max_time ? max_time : seconds);
0
+
0
   return rb_funcall(timeEpoch, id_plus, 1, rb_float_new(seconds));
0
 }
0
 

Comments

    No one has commented yet.