Return a new LocalFile object if it's valid. Otherwise, log a warning and return nil.
# File lib/backup/syncer/cloud/base.rb, line 196 def self.new(*args) local_file = super(*args) if local_file.invalid? Logger.warn( "\s\s[skipping] #{ local_file.path }\n" + "\s\sPath Contains Invalid UTF-8 byte sequences" ) return nil end local_file end
Creates a new LocalFile object using the given directory and line from the md5 hash checkup. This object figures out the path, relative_path and md5 hash for the file.
# File lib/backup/syncer/cloud/base.rb, line 212 def initialize(directory, line) @invalid = false @directory = sanitize(directory) line = sanitize(line).chomp @path = line.slice(4..-36) @md5 = line.slice(-32..-1) @relative_path = @path.sub(@directory + '/', '') end
Generated with the Darkfish Rdoc Generator 2.