The result of a sync.
Error messages by exit code
Exit code returned by rsync
@!visibility private
# File lib/rsync/result.rb, line 34 def initialize(raw, exitcode) @raw = raw @exitcode = exitcode end
List of changes made during this run.
@return {Array<Change>}
# File lib/rsync/result.rb, line 59 def changes change_list end
The error message based on exit code. @return {String}
# File lib/rsync/result.rb, line 47 def error error_key = @exitcode.to_s if ERROR_CODES.has_key? error_key ERROR_CODES[error_key] else "Unknown Error" end end
Whether the rsync job was run without errors. @return {Boolean}
# File lib/rsync/result.rb, line 41 def success? @exitcode == 0 end
# File lib/rsync/result.rb, line 65 def change_list list = [] @raw.split("\n").each do |line| #if line =~ /^([<>ch.*][fdLDS][ .+\?cstTpoguax]{9}) (.*)$/ if line =~ /^([<>ch+\.\*].{10}) (.*)$/ detail = Change.new(line) list << detail if detail.changed? end end list end