scratch/lib/gitmtime.rb

11 lines
277 B
Ruby
Raw Normal View History

2010-09-02 08:20:45 +00:00
def gitmtime
filepath=@item.path.sub('/Scratch/','content/html/').sub(/\/$/,'')
filepath<<=%{.#{@item[:extension]}}
str=`git log -1 --format='%ci' -- #{filepath}`
2010-09-02 08:51:36 +00:00
if str == ""
return @item.mtime
else
return DateTime.parse( str )
end
2010-09-02 08:20:45 +00:00
end