rsync 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/rsync/result.rb +30 -44
- data/lib/rsync/version.rb +1 -1
- metadata +7 -7
data/lib/rsync/result.rb
CHANGED
@@ -3,6 +3,30 @@ require 'rsync/change'
|
|
3
3
|
module Rsync
|
4
4
|
# The result of a sync.
|
5
5
|
class Result
|
6
|
+
# Error messages by exit code
|
7
|
+
ERROR_CODES = {
|
8
|
+
"0" => "Success",
|
9
|
+
"1" => "Syntax or usage error",
|
10
|
+
"2" => "Protocol incompatibility",
|
11
|
+
"3" => "Errors selecting input/output files, dirs",
|
12
|
+
"4" => "Requested action not supported: an attempt was made to manipulate 64-bit files on a platform that can not support them; or an option was specified that is supported by the client and not by the server.",
|
13
|
+
"5" => "Error starting client-server protocol",
|
14
|
+
"6" => "Daemon unable to append to log-file",
|
15
|
+
"10" => "Error in socket I/O",
|
16
|
+
"11" => "Error in file I/O",
|
17
|
+
"12" => "Error in rsync protocol data stream",
|
18
|
+
"13" => "Errors with program diagnostics",
|
19
|
+
"14" => "Error in IPC code",
|
20
|
+
"20" => "Received SIGUSR1 or SIGINT",
|
21
|
+
"21" => "Some error returned by waitpid()",
|
22
|
+
"22" => "Error allocating core memory buffers",
|
23
|
+
"23" => "Partial transfer due to error",
|
24
|
+
"24" => "Partial transfer due to vanished source files",
|
25
|
+
"25" => "The --max-delete limit stopped deletions",
|
26
|
+
"30" => "Timeout in data send/receive",
|
27
|
+
"35" => "Timeout waiting for daemon connection"
|
28
|
+
}
|
29
|
+
|
6
30
|
# @!visibility private
|
7
31
|
def initialize(raw, exitcode)
|
8
32
|
@raw = raw
|
@@ -12,55 +36,17 @@ module Rsync
|
|
12
36
|
# Whether the rsync job was run without errors.
|
13
37
|
# @return {Boolean}
|
14
38
|
def success?
|
15
|
-
@exitcode
|
39
|
+
@exitcode == 0
|
16
40
|
end
|
17
41
|
|
18
42
|
# The error message based on exit code.
|
19
43
|
# @return {String}
|
20
44
|
def error
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
when 2
|
27
|
-
"Protocol incompatibility"
|
28
|
-
when 3
|
29
|
-
"Errors selecting input/output files, dirs"
|
30
|
-
when 4
|
31
|
-
"Requested action not supported: an attempt was made to manipulate 64-bit files on a platform that can not support them; or an option was specified that is supported by the client and not by the server."
|
32
|
-
when 5
|
33
|
-
"Error starting client-server protocol"
|
34
|
-
when 6
|
35
|
-
"Daemon unable to append to log-file"
|
36
|
-
when 10
|
37
|
-
"Error in socket I/O"
|
38
|
-
when 11
|
39
|
-
"Error in file I/O"
|
40
|
-
when 12
|
41
|
-
"Error in rsync protocol data stream"
|
42
|
-
when 13
|
43
|
-
"Errors with program diagnostics"
|
44
|
-
when 14
|
45
|
-
"Error in IPC code"
|
46
|
-
when 20
|
47
|
-
"Received SIGUSR1 or SIGINT"
|
48
|
-
when 21
|
49
|
-
"Some error returned by waitpid()"
|
50
|
-
when 22
|
51
|
-
"Error allocating core memory buffers"
|
52
|
-
when 23
|
53
|
-
"Partial transfer due to error"
|
54
|
-
when 24
|
55
|
-
"Partial transfer due to vanished source files"
|
56
|
-
when 25
|
57
|
-
"The --max-delete limit stopped deletions"
|
58
|
-
when 30
|
59
|
-
"Timeout in data send/receive"
|
60
|
-
when 35
|
61
|
-
"Timeout waiting for daemon connection"
|
62
|
-
else
|
63
|
-
"Unknown Error"
|
45
|
+
error_key = @exitcode.to_s
|
46
|
+
if ERROR_CODES.has_key? error_key
|
47
|
+
ERROR_CODES[error_key]
|
48
|
+
else
|
49
|
+
"Unknown Error"
|
64
50
|
end
|
65
51
|
end
|
66
52
|
|
data/lib/rsync/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rsync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2013-07-24 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
16
|
-
requirement: &
|
16
|
+
requirement: &15368960 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '1.3'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *15368960
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rake
|
27
|
-
requirement: &
|
27
|
+
requirement: &15368460 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *15368460
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &15367860 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *15367860
|
47
47
|
description:
|
48
48
|
email:
|
49
49
|
- jbussdieker@gmail.com
|