entangler 1.0.0.beta4 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/exe/entangler +0 -1
- data/lib/entangler/executor/background/base.rb +23 -9
- data/lib/entangler/executor/background/master.rb +1 -0
- data/lib/entangler/executor/base.rb +2 -2
- data/lib/entangler/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24ab1f0ac689c51c2a2b353c2cd9b9f6de09358e
|
4
|
+
data.tar.gz: 61005288c87456ed526ee85b96c100a240315752
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bff0242ca552222c8c2f8d9b6a85f4d6e5f7a4d2f1a05a830390513db30abd519867b907f383d62789e763c22a78bcf619e6c6b5eb836e252404e7cab5ea0bc
|
7
|
+
data.tar.gz: 4e09843aa732a4f8263d86acac49767c35793a3060aea43886999e76466fdc4e8aa3e55974f095b1db599590643bf6116d2e66dd0f30bfe1287c61e38ffa13af
|
data/README.md
CHANGED
data/exe/entangler
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'listen'
|
2
2
|
require 'entangler/entangled_file'
|
3
|
+
require 'benchmark'
|
3
4
|
|
4
5
|
module Entangler
|
5
6
|
module Executor
|
@@ -8,7 +9,7 @@ module Entangler
|
|
8
9
|
protected
|
9
10
|
|
10
11
|
def start_listener
|
11
|
-
logger.info('
|
12
|
+
logger.info('Starting - Local file watcher')
|
12
13
|
listener.start
|
13
14
|
end
|
14
15
|
|
@@ -17,7 +18,7 @@ module Entangler
|
|
17
18
|
end
|
18
19
|
|
19
20
|
def start_remote_io
|
20
|
-
logger.info('
|
21
|
+
logger.info('Starting - Remote communications')
|
21
22
|
@remote_io_thread = Thread.new do
|
22
23
|
with_kill_threads_rescue do
|
23
24
|
loop do
|
@@ -62,9 +63,11 @@ module Entangler
|
|
62
63
|
with_listener_pause(0) do
|
63
64
|
changes = remove_recently_changed_files(changes)
|
64
65
|
if changes.any?
|
65
|
-
logger.info("
|
66
|
-
logger.debug(changes.map(&:path).join("\n"))
|
67
|
-
|
66
|
+
logger.info("Processing - #{changes.length} local changes")
|
67
|
+
logger.debug("File List:\n#{changes.map(&:path).join("\n")}")
|
68
|
+
with_log_time("Completed - #{changes.length} local changes") do
|
69
|
+
send_to_remote(changes)
|
70
|
+
end
|
68
71
|
end
|
69
72
|
end
|
70
73
|
end
|
@@ -72,10 +75,12 @@ module Entangler
|
|
72
75
|
def process_remote_changes(changes)
|
73
76
|
with_listener_pause(1) do
|
74
77
|
return if changes.nil?
|
75
|
-
logger.info("
|
76
|
-
logger.debug(changes.map(&:path).join("\n"))
|
77
|
-
changes.
|
78
|
-
|
78
|
+
logger.info("Processing - #{changes.length} remote changes")
|
79
|
+
logger.debug("File List:\n#{changes.map(&:path).join("\n")}")
|
80
|
+
with_log_time("Completed - #{changes.length} remote changes") do
|
81
|
+
changes.each(&:process)
|
82
|
+
update_recently_received_paths(changes)
|
83
|
+
end
|
79
84
|
end
|
80
85
|
end
|
81
86
|
|
@@ -105,6 +110,15 @@ module Entangler
|
|
105
110
|
@listener_pauses[idx] = false
|
106
111
|
listener.start if @listener_pauses.none?
|
107
112
|
end
|
113
|
+
|
114
|
+
def with_log_time(msg)
|
115
|
+
res = nil
|
116
|
+
time = Benchmark.realtime do
|
117
|
+
res = yield
|
118
|
+
end
|
119
|
+
logger.debug("#{msg} in #{time * 1000}ms")
|
120
|
+
res
|
121
|
+
end
|
108
122
|
end
|
109
123
|
end
|
110
124
|
end
|
@@ -5,6 +5,7 @@ module Entangler
|
|
5
5
|
protected
|
6
6
|
|
7
7
|
def start_remote_slave
|
8
|
+
logger.info('Starting - Entangler on remote')
|
8
9
|
require 'open3'
|
9
10
|
ignore_opts = @opts[:ignore].map { |regexp| "-i '#{regexp.inspect}'" }.join(' ')
|
10
11
|
entangler_cmd = "entangler slave #{@opts[:remote_base_dir]} #{ignore_opts}"
|
@@ -31,14 +31,14 @@ module Entangler
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def run
|
34
|
-
logger.info(
|
34
|
+
logger.info("Entangler v#{Entangler::VERSION}")
|
35
35
|
start_listener
|
36
36
|
start_remote_io
|
37
37
|
Signal.trap('INT') { kill_off_threads }
|
38
38
|
wait_for_threads
|
39
39
|
ensure
|
40
40
|
stop_listener
|
41
|
-
logger.info('Stopping
|
41
|
+
logger.info('Stopping Entangler')
|
42
42
|
end
|
43
43
|
|
44
44
|
protected
|
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: 1.0.0
|
4
|
+
version: 1.0.0
|
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-12-
|
11
|
+
date: 2016-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -139,9 +139,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
139
139
|
version: '0'
|
140
140
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
141
141
|
requirements:
|
142
|
-
- - "
|
142
|
+
- - ">="
|
143
143
|
- !ruby/object:Gem::Version
|
144
|
-
version:
|
144
|
+
version: '0'
|
145
145
|
requirements: []
|
146
146
|
rubyforge_project:
|
147
147
|
rubygems_version: 2.4.8
|