entangler 1.2.3 → 1.3.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
  SHA256:
3
- metadata.gz: 783a5b3ef9783c555695f78996ccd7708b336a7f6a96f3fed514d64b60c040aa
4
- data.tar.gz: d91234cd85293e33d26551f78da5057ca7ee9c4f8c8a4279371d7291dc9c5168
3
+ metadata.gz: 76ca4b85c0742a19215092fb199905604789027d5545d96cea9fea72e330b5aa
4
+ data.tar.gz: 8b77263b425f8deae8c0d32236545797e6a0e473264304112b138f7996ffd459
5
5
  SHA512:
6
- metadata.gz: 2765a50d87ff234c7b4311c80fbe9b58f20de55e46a60df8214145e43911948971e7b16bf9b25dc0bfadb5c24a2c909efc9b1b19e755d49b3a2488be72638994
7
- data.tar.gz: 6ab807597be96dfea700b7bc517318003b035b3d64782ea2b6c6dd122dda44e5bc42e82f9df7a3798b7a5c795d326ab374d5568f4ecfef213a26fe1256e5e733
6
+ metadata.gz: 48dfe981b3a6b59983e543b43f54e9a211743d30889d81321eed3ec846b9533c716177ac8551780f278123ff5622854ef0b7a19c2007451bac2d3d7ac334b920
7
+ data.tar.gz: 6734874d44e9ce19de8b2f50d275fc2ab8ef246b968fcbfffe546b778428b50d6bef2dc1b02eb39ef883578181600a3766a3996623d8e5c5eda0f196631c2620
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.2.3
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("source ~/.rvm/environments/default && #{entangler_cmd}")
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
- "ssh -q #{remote_hostname} -p #{@opts[:remote_port]} -C \"#{cmd}\""
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('source ~/.rvm/environments/default && entangler --version')}`
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.'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Entangler
4
- VERSION = '1.2.3'
4
+ VERSION = '1.3.0'
5
5
  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.2.3
4
+ version: 1.3.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: 2022-06-13 00:00:00.000000000 Z
11
+ date: 2023-12-07 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.3.7
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.