entangler 1.2.3 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/exe/entangler +2 -0
- data/lib/entangler/executor/background/master.rb +1 -1
- data/lib/entangler/executor/master.rb +9 -2
- data/lib/entangler/executor/validation/master.rb +1 -1
- data/lib/entangler/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b405d69c91dd74bb2f638da3d1204475962d781421ac2a6a146bfab43097ff9
|
4
|
+
data.tar.gz: '08a7f913c8a7d6717c2f0f549b2d1e1c7b43e08d815d38baf41cf8359461fdd7'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1c21079b0e05c852c2ddcbf3451bf3a232975c2378a54eda2d4e295611c592fe7757171d25bd4082029e59b0f7c6045744e4ddeeea1c1f8bc8ec426ffefe06a
|
7
|
+
data.tar.gz: 79c45d86b0b136bbaaacd1fb8f895714593aee7caa154948e567e5565b3045d5f922a217e6382f683ad5362cb35aa3c32294f2ec83e7578574ebe058579eab90
|
data/README.md
CHANGED
@@ -19,7 +19,7 @@ $ entangler master /some/base/path user@remote:/some/remote/path
|
|
19
19
|
|
20
20
|
```
|
21
21
|
$ entangler -h
|
22
|
-
Entangler v1.
|
22
|
+
Entangler v1.3.0
|
23
23
|
|
24
24
|
Usage:
|
25
25
|
entangler master <base_dir> <remote_user>@<remote_host>:<remote_base_dir> [options]
|
@@ -30,6 +30,7 @@ Options:
|
|
30
30
|
All paths should be relative to the base sync directory.
|
31
31
|
-p, --port PORT Overwrite the SSH port (usually 22)
|
32
32
|
(doesn't do anything in slave mode)
|
33
|
+
--no-rvm Skip attempting to load RVM on remote
|
33
34
|
-v, --verbose Log Debug lines
|
34
35
|
-q, --quiet Don't log to stdout in master process
|
35
36
|
--version Show version number
|
data/exe/entangler
CHANGED
@@ -36,6 +36,7 @@ Usage:
|
|
36
36
|
|
37
37
|
value_opt(options, opts, :port, '-p', '--port PORT', 'Overwrite the SSH port (usually 22)',
|
38
38
|
"(doesn't do anything in slave mode)")
|
39
|
+
bool_opt(options, opts, :no_rvm, '--no-rvm', 'Skip attempting to load RVM on remote')
|
39
40
|
bool_opt(options, opts, :verbose, '-v', '--verbose', 'Log Debug lines')
|
40
41
|
bool_opt(options, opts, :quiet, '-q', '--quiet', "Don't log to stdout in master process")
|
41
42
|
|
@@ -112,6 +113,7 @@ if options[:ignore]
|
|
112
113
|
end
|
113
114
|
end
|
114
115
|
|
116
|
+
opts[:no_rvm] = options[:no_rvm]
|
115
117
|
opts[:quiet] = options[:quiet]
|
116
118
|
opts[:verbose] = options[:verbose]
|
117
119
|
|
@@ -12,7 +12,7 @@ module Entangler
|
|
12
12
|
logger.info('Starting - Entangler on remote')
|
13
13
|
ignore_opts = @opts[:ignore].map { |regexp| "-i '#{regexp.inspect}'" }.join(' ')
|
14
14
|
entangler_cmd = "entangler slave #{@opts[:remote_base_dir]} #{ignore_opts}"
|
15
|
-
ssh_cmd = generate_ssh_command(
|
15
|
+
ssh_cmd = generate_ssh_command(entangler_cmd, source_rvm: true)
|
16
16
|
full_cmd = @opts[:remote_mode] ? ssh_cmd : entangler_cmd
|
17
17
|
|
18
18
|
@remote_writer, @remote_reader, remote_err, @remote_thread = Open3.popen3(full_cmd)
|
@@ -57,8 +57,15 @@ module Entangler
|
|
57
57
|
end.compact.uniq
|
58
58
|
end
|
59
59
|
|
60
|
-
def generate_ssh_command(cmd)
|
61
|
-
|
60
|
+
def generate_ssh_command(cmd, source_rvm: false)
|
61
|
+
prefixed_cmd =
|
62
|
+
if source_rvm && !@opts[:no_rvm]
|
63
|
+
"[[ -f ~/.rvm/environments/default ]] && source ~/.rvm/environments/default || true && #{cmd}"
|
64
|
+
else
|
65
|
+
cmd
|
66
|
+
end
|
67
|
+
|
68
|
+
"ssh -q #{remote_hostname} -p #{@opts[:remote_port]} -C \"#{prefixed_cmd}\""
|
62
69
|
end
|
63
70
|
|
64
71
|
def remote_hostname
|
@@ -49,7 +49,7 @@ module Entangler
|
|
49
49
|
def validate_remote_entangler_version
|
50
50
|
return unless @opts[:remote_mode]
|
51
51
|
|
52
|
-
res = `#{generate_ssh_command('
|
52
|
+
res = `#{generate_ssh_command('entangler --version', source_rvm: true)}`
|
53
53
|
if res.empty?
|
54
54
|
msg = 'Entangler is not installed on the remote server.' \
|
55
55
|
' Install Entangler on the remote server (SSH in, then `gem install entangler`), then try again.'
|
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.
|
4
|
+
version: 1.3.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:
|
11
|
+
date: 2024-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
168
168
|
- !ruby/object:Gem::Version
|
169
169
|
version: '0'
|
170
170
|
requirements: []
|
171
|
-
rubygems_version: 3.
|
171
|
+
rubygems_version: 3.4.10
|
172
172
|
signing_key:
|
173
173
|
specification_version: 4
|
174
174
|
summary: Two way file syncer using platform native notify.
|