lib/smallcage/commands/update.rb in smallcage-0.1.6 vs lib/smallcage/commands/update.rb in smallcage-0.1.7
- old
+ new
@@ -49,12 +49,13 @@
private :render_smc_obj
def delete_expired_files(urilist)
old_urilist = load_list
root = @loader.root
- target_uri = SmallCage::DocumentPath.new(root, @loader.target).uri
-
+ target = SmallCage::DocumentPath.new(root, @loader.target)
+ target_uri = target.uri
+ target_uri += "/" if target.path.directory? and target_uri[-1] != ?/
if @loader.target.file?
old_urilist << target_uri unless old_urilist.include?(target_uri)
return old_urilist
end
@@ -65,10 +66,10 @@
target_uris << uri
else
not_target_uris << uri
end
end
-
+
deletelist = target_uris - urilist
deletelist.each do |uri|
delfile = SmallCage::DocumentPath.new(root, root + ("." + uri)).outfile
next unless delfile.path.file?