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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b3d540d10e4362b276db487f4915ee2927f13eba
4
- data.tar.gz: 713d7d73f6fd4a894480e4dceab87237dd6a0f6e
3
+ metadata.gz: 24ab1f0ac689c51c2a2b353c2cd9b9f6de09358e
4
+ data.tar.gz: 61005288c87456ed526ee85b96c100a240315752
5
5
  SHA512:
6
- metadata.gz: e98e1de0ea9443650890f13700330d4303c7c7d804d870cae40feab81a57c833ff3f0cacac9f855cc6ce9527046cd58003a4c4a1256c5261e6308ca3579f188f
7
- data.tar.gz: b886c9c1977daad158135718d78859890ca81992d4ce41b24b934799236a928a083d44a7e24fdb618f98a75519f1dd2651b947af71eddcfd01d2a801533d2da3
6
+ metadata.gz: 6bff0242ca552222c8c2f8d9b6a85f4d6e5f7a4d2f1a05a830390513db30abd519867b907f383d62789e763c22a78bcf619e6c6b5eb836e252404e7cab5ea0bc
7
+ data.tar.gz: 4e09843aa732a4f8263d86acac49767c35793a3060aea43886999e76466fdc4e8aa3e55974f095b1db599590643bf6116d2e66dd0f30bfe1287c61e38ffa13af
data/README.md CHANGED
@@ -18,7 +18,7 @@ $ entangler master /some/base/path user@remote:/some/remote/path
18
18
 
19
19
  ```
20
20
  $ entangler -h
21
- Entangler v1.0.0.beta4
21
+ Entangler v1.0.0
22
22
 
23
23
  Usage:
24
24
  entangler master <base_dir> <remote_user>@<remote_host>:<remote_base_dir> [options]
data/exe/entangler CHANGED
@@ -90,7 +90,6 @@ end
90
90
 
91
91
  if options[:ignore]
92
92
  opts[:ignore] = options[:ignore].map do |opt|
93
-
94
93
  if opt.start_with?('"') && opt.end_with?('"') || opt.start_with?("'") && opt.end_with?("'")
95
94
  opt = opt[1..-2]
96
95
  end
@@ -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('starting listener')
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('starting remote IO')
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("PROCESSING #{changes.length} local changes")
66
- logger.debug(changes.map(&:path).join("\n"))
67
- send_to_remote(changes)
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("PROCESSING #{changes.length} remote changes")
76
- logger.debug(changes.map(&:path).join("\n"))
77
- changes.each(&:process)
78
- update_recently_received_paths(changes)
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('Starting executor')
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 entangler')
41
+ logger.info('Stopping Entangler')
42
42
  end
43
43
 
44
44
  protected
@@ -1,3 +1,3 @@
1
1
  module Entangler
2
- VERSION = '1.0.0.beta4'.freeze
2
+ VERSION = '1.0.0'.freeze
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: 1.0.0.beta4
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-20 00:00:00.000000000 Z
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: 1.3.1
144
+ version: '0'
145
145
  requirements: []
146
146
  rubyforge_project:
147
147
  rubygems_version: 2.4.8