lib/menagerie/collection.rb in menagerie-0.0.2 vs lib/menagerie/collection.rb in menagerie-0.0.3
- old
+ new
@@ -24,20 +24,21 @@
end
private
def rotate
- existing = releases.reverse.sort
- keepers = existing.shift(@options[:retention])
+ existing = releases.sort.reverse
+ keepers = existing.pop(@options[:retention])
existing.each(&:delete)
keepers.each(&:rotate)
end
def reap
end
def link_latest
- FileUtils.ln_sf releases.sort.first.path, "#{@paths[:latest]}"
+ FileUtils.rm_f @paths[:latest]
+ FileUtils.ln_sf releases.sort.first.path, @paths[:latest]
end
def default_paths
{
artifacts: 'artifacts',