entangler 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4338665fa9a10ccedafc5eca1b0ad709fd351f01
4
- data.tar.gz: 06eeb20f8ed99e4c74a4a3a930a95e3a306f84ca
3
+ metadata.gz: 3fce99ceae57ea4c4ffcde6dda904c6bb030f98e
4
+ data.tar.gz: 9a9d36b04315449753ab3752053330e9e6f2e10f
5
5
  SHA512:
6
- metadata.gz: 142266121a2a95f0f4936f008d3906bdcc10ca8eb56c32d8106d2deafbe43234d72d61054c846f5438a451c6e0b845505cafba0bd51527c191f9fadb8bfd7321
7
- data.tar.gz: d44890b934d08df1bfe4f49b9d769019ca4849e43410dcc7488f7e887164bc3db6606fe2f109e9f5f2f5feca26847c4c77eca1f02d9e8a1b4bde8fba0ae377d0
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
- $ gem install entangler
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("Got #{content.length} new folder changes from remote")
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("Deleting #{files_to_remove.length} files")
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("Deleting #{dirs_to_remove.length} dirs")
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("Creating #{files_to_update.length} new entangled files to sync")
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("Got #{content.length} entangled files from remote")
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
@@ -1,3 +1,3 @@
1
1
  module Entangler
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
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.0
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-25 00:00:00.000000000 Z
11
+ date: 2016-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler