lib/backup/jar.rb in encbs-0.2.1.beta1 vs lib/backup/jar.rb in encbs-0.2.1.beta2
- old
+ new
@@ -78,11 +78,11 @@
#@local_files = @meta_index.select {|k, v| v[:timestamp] == @timestamp if v.is_a? Hash}
begin
@local_files.keys.each do |file|
if @meta_index[file].nil?
- unless Dir.exists?(file)
+ unless File.directory? file
data = StringIO.new File.open(file, 'rb').read
checksum = Digest::MD5.hexdigest(data.read)
data.seek 0
data = compression.compress(data.read, 3) unless compression.nil?
@@ -130,15 +130,17 @@
@file_item.delete_file "#{meta_jar_path}/#{version}.yml"
@file_item.delete_dir "#{@root_path}/#{jar_hash}/#{version}"
end
end
end
+
+ @timestamp
end
def hash_local_files
files = {}
- if Dir.exists? @local_path
+ if File.directory? @local_path
matches = Dir.glob(File.join(@local_path, "/**/*"), File::FNM_DOTMATCH)
matches = matches.select do |match|
match[/\/..$/].nil? and match[/\/.$/].nil?
end