wslc-wip 0.7.2 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/wip/command_runner.rb +14 -1
- data/lib/wip/sync_settings.rb +8 -3
- data/lib/wip/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 39d1c4da0d3b7446f90692ccf3d16ed693613edce14fafc4941d9fd51732486b
|
|
4
|
+
data.tar.gz: bdd0f8e5b7a5a18ffd833d77844c5d0acf5638f0e0e2f2a337c0129b9cb0682a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c5e3824808f307422ad5e6e402309242bb884bbcc2b3d708e8f576a97100a66fda81e20e5b63922b5123160c7348987716ca951e8de37f8a4875b522cd23d471
|
|
7
|
+
data.tar.gz: a187b673ed8efea261c2c8218e69940e1e5fd64cdc911ea2b217f2276eb72193d674c4933709ce1437f67359ac46376a3280b04c397d3f7e98d78f2492141624
|
data/lib/wip/command_runner.rb
CHANGED
|
@@ -32,6 +32,9 @@ module Wip
|
|
|
32
32
|
rescue Errno::ENOENT => e
|
|
33
33
|
@stderr.puts e.message
|
|
34
34
|
127
|
|
35
|
+
rescue Interrupt
|
|
36
|
+
@stderr.puts "\nwip: interrupted"
|
|
37
|
+
130
|
|
35
38
|
end
|
|
36
39
|
|
|
37
40
|
private
|
|
@@ -49,9 +52,19 @@ module Wip
|
|
|
49
52
|
127
|
|
50
53
|
end
|
|
51
54
|
|
|
55
|
+
# An Interrupt during the main thread's `join` closes these pipes out from
|
|
56
|
+
# under a still-reading pump thread; treat that as a normal stop rather
|
|
57
|
+
# than an uncaught background-thread exception. Only the read from
|
|
58
|
+
# `source` is rescued, so a genuine write failure on `destination` still
|
|
59
|
+
# surfaces.
|
|
52
60
|
def pump(source, destination, captured)
|
|
53
61
|
Thread.new do
|
|
54
|
-
|
|
62
|
+
loop do
|
|
63
|
+
chunk = begin
|
|
64
|
+
source.readpartial(4096)
|
|
65
|
+
rescue IOError # includes EOFError, raised at end of stream
|
|
66
|
+
break
|
|
67
|
+
end
|
|
55
68
|
destination.write(chunk)
|
|
56
69
|
captured << chunk
|
|
57
70
|
end
|
data/lib/wip/sync_settings.rb
CHANGED
|
@@ -16,9 +16,14 @@ module Wip
|
|
|
16
16
|
DEFAULT_TARGET = '/app'
|
|
17
17
|
DEFAULT_BINARY = 'rsync'
|
|
18
18
|
DEFAULT_INTERVAL = 2
|
|
19
|
-
#
|
|
20
|
-
#
|
|
21
|
-
|
|
19
|
+
# Minimal set for a fast local-to-local mirror: -r walks the tree, -l
|
|
20
|
+
# keeps symlinks as symlinks, -t preserves mtimes so re-syncs can quick-
|
|
21
|
+
# check (size+mtime) instead of re-transferring unchanged files, and
|
|
22
|
+
# --whole-file skips the delta-transfer checksum pass that only pays off
|
|
23
|
+
# over a slow network. Owner/group/perm preservation (-o -g -p, part of
|
|
24
|
+
# -a) is left out since both sides are the same user; add them back via
|
|
25
|
+
# sync.options if a project needs them.
|
|
26
|
+
BASE_OPTIONS = %w[-r -l -t --whole-file].freeze
|
|
22
27
|
# Trailing mount options wslc/docker accept after the container path.
|
|
23
28
|
VOLUME_MODES = %w[ro rw z Z cached delegated consistent].freeze
|
|
24
29
|
|
data/lib/wip/version.rb
CHANGED