entangler 1.3.3 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/entangler.gemspec +1 -0
- data/exe/entangler +17 -6
- data/lib/entangler/entangled_file.rb +1 -1
- data/lib/entangler/executor/background/base.rb +6 -6
- data/lib/entangler/executor/base.rb +8 -2
- data/lib/entangler/executor/validation/master.rb +4 -4
- data/lib/entangler/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: caeaeab73f12f452f171a80fc4c202f4e3bfcafea5f7c1509057175e6bec0c1f
|
4
|
+
data.tar.gz: 950085ffeb8d56d5d5d23163f5024ee09ae173ae5d95dbb5981ee2274e24189d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ccbc2db0d327844b0a78f52468bb11582d55c53a986ddb7158102017d229448cdb34b7ed4c16449338eb2d00f231b44ff949edebb2b40eaa0fa52d8f896b87c
|
7
|
+
data.tar.gz: 6f89e593575e7120bfc897f213219c1174eef54dcdc16c8a5a125cd363fceecd4fc6cd820abca981da4e9d7f1bf974a16cac0e0a2a55217194040094631485b1
|
data/entangler.gemspec
CHANGED
data/exe/entangler
CHANGED
@@ -18,12 +18,15 @@ def value_opt(options, opts, key, *args)
|
|
18
18
|
end
|
19
19
|
|
20
20
|
options = {}
|
21
|
+
# rubocop:disable Metrics/BlockLength
|
21
22
|
OptionParser.new do |opts|
|
22
|
-
opts.banner =
|
23
|
+
opts.banner = <<~BANNER
|
24
|
+
Entangler v#{Entangler::VERSION}
|
23
25
|
|
24
|
-
Usage:
|
25
|
-
|
26
|
-
|
26
|
+
Usage:
|
27
|
+
entangler master <base_dir> <remote_user>@<remote_host>:<remote_base_dir> [options]
|
28
|
+
entangler master <base_dir> <other_synced_base_dir> [options]
|
29
|
+
BANNER
|
27
30
|
|
28
31
|
opts.separator ''
|
29
32
|
opts.separator 'Options:'
|
@@ -36,8 +39,14 @@ Usage:
|
|
36
39
|
|
37
40
|
value_opt(options, opts, :port, '-p', '--port PORT', 'Overwrite the SSH port (usually 22)',
|
38
41
|
"(doesn't do anything in slave mode)")
|
42
|
+
|
43
|
+
bool_opt(options, opts, :force_polling, '--force-polling',
|
44
|
+
'Forces the use of the listen polling adapter (works cross-platform, generally slower)')
|
45
|
+
|
39
46
|
bool_opt(options, opts, :no_rvm, '--no-rvm', 'Skip attempting to load RVM on remote')
|
47
|
+
|
40
48
|
bool_opt(options, opts, :verbose, '-v', '--verbose', 'Log Debug lines')
|
49
|
+
|
41
50
|
bool_opt(options, opts, :quiet, '-q', '--quiet', "Don't log to stdout in master process")
|
42
51
|
|
43
52
|
opts.on_tail('--version', 'Show version number') do
|
@@ -50,6 +59,7 @@ Usage:
|
|
50
59
|
exit
|
51
60
|
end
|
52
61
|
end.parse!
|
62
|
+
# rubocop:enable Metrics/BlockLength
|
53
63
|
|
54
64
|
mode = ARGV.shift
|
55
65
|
unless mode && %w[master slave].include?(mode)
|
@@ -102,17 +112,18 @@ end
|
|
102
112
|
|
103
113
|
if options[:ignore]
|
104
114
|
opts[:ignore] = options[:ignore].map do |opt|
|
105
|
-
opt = opt[1..-2] if opt.start_with?('"') && opt.end_with?('"') || opt.start_with?("'") && opt.end_with?("'")
|
115
|
+
opt = opt[1..-2] if (opt.start_with?('"') && opt.end_with?('"')) || (opt.start_with?("'") && opt.end_with?("'"))
|
106
116
|
|
107
117
|
if ToRegexp::String.literal? opt
|
108
118
|
source, *rest = opt.as_regexp(detect: true)
|
109
|
-
|
119
|
+
Regexp.new "^#{source}(?:/[^/]+)*$", *rest
|
110
120
|
else
|
111
121
|
opt.to_regexp(detect: true)
|
112
122
|
end
|
113
123
|
end
|
114
124
|
end
|
115
125
|
|
126
|
+
opts[:force_polling] = options[:force_polling]
|
116
127
|
opts[:no_rvm] = options[:no_rvm]
|
117
128
|
opts[:quiet] = options[:quiet]
|
118
129
|
opts[:verbose] = options[:verbose]
|
@@ -47,7 +47,7 @@ module Entangler
|
|
47
47
|
|
48
48
|
def write_contents
|
49
49
|
delete_file if file_exists? && File.directory?(full_path)
|
50
|
-
File.
|
50
|
+
File.write(full_path, contents)
|
51
51
|
File.utime(File.atime(full_path), desired_modtime, full_path)
|
52
52
|
end
|
53
53
|
|
@@ -42,12 +42,12 @@ module Entangler
|
|
42
42
|
private
|
43
43
|
|
44
44
|
def listener
|
45
|
-
@listener ||=
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
45
|
+
@listener ||= Listen::Listener.new(base_dir,
|
46
|
+
ignore!: @opts[:ignore],
|
47
|
+
force_polling: @opts[:force_polling]) do |modified, added, removed|
|
48
|
+
process_local_changes(generate_entangled_files(added, :create) +
|
49
|
+
generate_entangled_files(modified, :update) +
|
50
|
+
generate_entangled_files(removed, :delete))
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
@@ -11,6 +11,9 @@ module Entangler
|
|
11
11
|
include Entangler::Executor::Background::Base
|
12
12
|
include Entangler::Executor::Validation::Base
|
13
13
|
|
14
|
+
GIT_IGNORE_REGEX = %r{^\.git(?:/[^/]+)*$}.freeze
|
15
|
+
ENTANGLER_IGNORE_REGEX = /^\.entangler.*/.freeze
|
16
|
+
|
14
17
|
attr_reader :base_dir
|
15
18
|
|
16
19
|
def initialize(base_dir, opts = {})
|
@@ -19,8 +22,9 @@ module Entangler
|
|
19
22
|
@recently_received_paths = []
|
20
23
|
@listener_pauses = [false, false]
|
21
24
|
@opts = opts
|
22
|
-
@opts[:ignore] = [
|
23
|
-
@opts[:ignore] <<
|
25
|
+
@opts[:ignore] = [GIT_IGNORE_REGEX] unless @opts.key?(:ignore)
|
26
|
+
@opts[:ignore] << ENTANGLER_IGNORE_REGEX
|
27
|
+
@opts[:force_polling] ||= false
|
24
28
|
|
25
29
|
validate_opts
|
26
30
|
Entangler::Logger.create_log_dir(base_dir)
|
@@ -56,6 +60,8 @@ module Entangler
|
|
56
60
|
@logger ||= Entangler::Logger.new(log_outputs, verbose: @opts[:verbose])
|
57
61
|
end
|
58
62
|
|
63
|
+
private
|
64
|
+
|
59
65
|
def log_outputs
|
60
66
|
[Entangler::Logger.log_file_path(base_dir)]
|
61
67
|
end
|
@@ -51,8 +51,8 @@ module Entangler
|
|
51
51
|
|
52
52
|
res = `#{generate_ssh_command('entangler --version', source_rvm: true)}`
|
53
53
|
if res.empty?
|
54
|
-
msg = 'Entangler is not installed on the remote server.' \
|
55
|
-
'
|
54
|
+
msg = 'Entangler is not installed on the remote server. ' \
|
55
|
+
'Install Entangler on the remote server (SSH in, then `gem install entangler`), then try again.'
|
56
56
|
raise Entangler::NotInstalledOnRemoteError, msg
|
57
57
|
end
|
58
58
|
|
@@ -60,8 +60,8 @@ module Entangler
|
|
60
60
|
local_version = Gem::Version.new(Entangler::VERSION)
|
61
61
|
return unless major_version_mismatch?(local_version, remote_version)
|
62
62
|
|
63
|
-
msg = 'Entangler version too far apart, please update either local or remote Entangler.' \
|
64
|
-
"
|
63
|
+
msg = 'Entangler version too far apart, please update either local or remote Entangler. ' \
|
64
|
+
"Local version is #{local_version} and remote version is #{remote_version}."
|
65
65
|
raise Entangler::VersionMismatchError, msg
|
66
66
|
end
|
67
67
|
|
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.4.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: 2024-01-
|
11
|
+
date: 2024-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -152,7 +152,8 @@ files:
|
|
152
152
|
homepage: https://github.com/daveallie/entangler
|
153
153
|
licenses:
|
154
154
|
- MIT
|
155
|
-
metadata:
|
155
|
+
metadata:
|
156
|
+
rubygems_mfa_required: 'true'
|
156
157
|
post_install_message:
|
157
158
|
rdoc_options: []
|
158
159
|
require_paths:
|