directory_push 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/directory_push/version.rb +1 -1
- data/lib/directory_push.rb +11 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 377f174e678abffd7f7edd112e7322be29ec537e
|
4
|
+
data.tar.gz: f5ce5f0f9e1e69a50175e847037a8bb1ce522643
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e23e45e536121fc6aa9a24cfc62e4de4fe29974cc3402e3f10e7fa6281fcfcf3af67a75c12e454244fda9acf293092130a34c7d0b0581a515c578d53be6c8e0
|
7
|
+
data.tar.gz: 02b03b1332e84652a62dd8ce143ec67dea8f4d5408d3082e2208877a7aa022e172a37cfcc873bed8d89c6f4acd7f2fa55a750c9a80ba06e9281512d194d02cbf
|
data/lib/directory_push.rb
CHANGED
@@ -40,6 +40,9 @@ remote = %Q{#{config.delete(:user)}@#{config.delete(:remote_address)}:"#{config.
|
|
40
40
|
rsync_options << source << remote
|
41
41
|
$rsync_command = rsync_options.join(' ')
|
42
42
|
|
43
|
+
rsync_options_without_delete = rsync_options.reject { |o| o.match('--del') }
|
44
|
+
$rsync_command_without_delete = rsync_options_without_delete.join(' ')
|
45
|
+
|
43
46
|
module ::Guard
|
44
47
|
class DirectoryPush < Plugin
|
45
48
|
def start() sync end
|
@@ -47,15 +50,15 @@ module ::Guard
|
|
47
50
|
def run_all() sync end
|
48
51
|
def run_on_additions(paths)
|
49
52
|
Compat::UI.info "Guard::DirectoryPush Files created: #{paths}."
|
50
|
-
|
53
|
+
sync_without_delete
|
51
54
|
end
|
52
55
|
def run_on_modifications(paths)
|
53
56
|
Compat::UI.info "Guard::DirectoryPush Files changed: #{paths}."
|
54
|
-
|
57
|
+
sync_without_delete
|
55
58
|
end
|
56
59
|
def run_on_removals(paths)
|
57
60
|
Compat::UI.info "Guard::DirectoryPush Files removed: #{paths}."
|
58
|
-
|
61
|
+
sync_without_delete
|
59
62
|
end
|
60
63
|
|
61
64
|
private
|
@@ -63,6 +66,11 @@ module ::Guard
|
|
63
66
|
Compat::UI.info %Q{Guard::DirectoryPush `#{$rsync_command}`.}
|
64
67
|
system $rsync_command
|
65
68
|
end
|
69
|
+
|
70
|
+
def sync_without_delete()
|
71
|
+
Compat::UI.info %Q{Guard::DirectoryPush `#{$rsync_command_without_delete}`.}
|
72
|
+
system $rsync_command_without_delete
|
73
|
+
end
|
66
74
|
end
|
67
75
|
end
|
68
76
|
|