entangler 0.2.0 → 0.2.1
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.
- checksums.yaml +4 -4
- data/README.md +17 -1
- data/lib/entangler/executor/processing/base.rb +6 -6
- data/lib/entangler/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fce99ceae57ea4c4ffcde6dda904c6bb030f98e
|
4
|
+
data.tar.gz: 9a9d36b04315449753ab3752053330e9e6f2e10f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2315af430ac4814b443e51ee0ae7433531475ccffeb283680c1604515b7e5dd41a17871fb1a9a72062fcc04a3568dd1c33caf8270828eec392dd5ce8d910c0c
|
7
|
+
data.tar.gz: 583b0a09e0abc0a211e020292e5a2eb2a149f12786d84f74ca1b05a412db212fef05081736d32273829f9f7e44a9e114ee16156b97ec0e8e39f3a5cc881a1152
|
data/README.md
CHANGED
@@ -1,15 +1,31 @@
|
|
1
1
|
# Entangler
|
2
2
|
|
3
|
+
Syncing tool used to keep a local and remote (over SSH) folder in sync.
|
3
4
|
|
5
|
+
## Prerequisites
|
6
|
+
- librsync 2.x
|
4
7
|
|
5
8
|
## Installation
|
6
9
|
|
7
|
-
|
10
|
+
```
|
11
|
+
$ gem install entangler
|
12
|
+
```
|
8
13
|
|
9
14
|
## Usage
|
10
15
|
|
11
16
|
```shell
|
12
17
|
entangler master /some/base/path user@remote:/some/remote/path
|
18
|
+
|
19
|
+
entangler -h
|
20
|
+
Usage:
|
21
|
+
entangler master <base_dir> <remote_user>@<remote_host>:<remote_base_dir> [options]
|
22
|
+
entangler slave <base_dir> [options]
|
23
|
+
|
24
|
+
Options:
|
25
|
+
-p, --port PORT Overwrite the SSH port (usually 22)
|
26
|
+
(doesn't do anything in slave mode)
|
27
|
+
-v, --version Show version number
|
28
|
+
-h, --help Show this message
|
13
29
|
```
|
14
30
|
|
15
31
|
## Development
|
@@ -21,7 +21,7 @@ module Entangler
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def process_new_changes(content)
|
24
|
-
logger.debug("
|
24
|
+
logger.debug("RECIEVING #{content.length} folder/s from remote:\n#{content.join("\n")}")
|
25
25
|
|
26
26
|
created_dirs = []
|
27
27
|
dirs_to_remove = []
|
@@ -65,15 +65,15 @@ module Entangler
|
|
65
65
|
@notify_sleep = Time.now.to_i + 60 if (files_to_remove + created_dirs + dirs_to_remove + files_to_update).any?
|
66
66
|
|
67
67
|
if files_to_remove.any?
|
68
|
-
logger.debug("
|
68
|
+
logger.debug("DELETING #{files_to_remove.length} files")
|
69
69
|
FileUtils.rm files_to_remove
|
70
70
|
end
|
71
71
|
if dirs_to_remove.any?
|
72
|
-
logger.debug("
|
72
|
+
logger.debug("DELETING #{dirs_to_remove.length} dirs")
|
73
73
|
FileUtils.rm_r dirs_to_remove
|
74
74
|
end
|
75
75
|
if files_to_update.any?
|
76
|
-
logger.debug("
|
76
|
+
logger.debug("CREATING #{files_to_update.length} new entangled file/s")
|
77
77
|
send_to_remote(type: :entangled_files, content: files_to_update.map{|f| Entangler::EntangledFile.new(f) })
|
78
78
|
end
|
79
79
|
@notify_sleep = Time.now.to_f + 0.5 if (files_to_remove + created_dirs + dirs_to_remove + files_to_update).any?
|
@@ -81,7 +81,7 @@ module Entangler
|
|
81
81
|
end
|
82
82
|
|
83
83
|
def process_entangled_files(content)
|
84
|
-
logger.debug("
|
84
|
+
logger.debug("UPDATING #{content.length} entangled file/s from remote")
|
85
85
|
completed_files, updated_files = content.partition(&:done?)
|
86
86
|
|
87
87
|
if completed_files.any?
|
@@ -113,7 +113,7 @@ module Entangler
|
|
113
113
|
end.compact.sort_by(&:first)
|
114
114
|
|
115
115
|
return unless to_process.any?
|
116
|
-
logger.debug("PROCESSING #{to_process.count} folder/s")
|
116
|
+
logger.debug("PROCESSING #{to_process.count} folder/s:\n#{to_process.join("\n")}")
|
117
117
|
send_to_remote(type: :new_changes, content: to_process)
|
118
118
|
end
|
119
119
|
end
|
data/lib/entangler/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: entangler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dave Allie
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|