lib/stashify/directory.rb in stashify-2.1.0 vs lib/stashify/directory.rb in stashify-2.1.1

- old
+ new

@@ -31,9 +31,22 @@ def write_directory(directory) subdir = self.directory(directory.name) directory.files.each { |file| subdir.write(file) } end + def delete(name) + if directory?(name) + delete_directory(name) + else + delete_file(name) + end + end + + def delete_directory(name) + subdir = directory(name) + subdir.files.each { |file| subdir.delete(file.name) } + end + def ==(other) files == other.files end def eql?(other)