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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '029d796a1f1d80a039fc1765f194b6b9cd144ceed002568bc9f38275814bb31a'
4
- data.tar.gz: 13c45a601b75b7a32dba0824a3424f1f34adc86dc176957318eabc783416ca2d
3
+ metadata.gz: 39d1c4da0d3b7446f90692ccf3d16ed693613edce14fafc4941d9fd51732486b
4
+ data.tar.gz: bdd0f8e5b7a5a18ffd833d77844c5d0acf5638f0e0e2f2a337c0129b9cb0682a
5
5
  SHA512:
6
- metadata.gz: b9941bb1dab65040e55e2711681283ab43a12c5715ea3af8a64b349a110a80e2066380109d6567667bb00fa898b9f66b34f5c000d382d989419e310d14a27531
7
- data.tar.gz: 6e5f11ceb6282415d6f8d164c3bde0620c9d2f9886af96d8c08f55d329ebb21efd65d4198dad3669e19566075b08df324abdfe3c0feb57eb605820f5ccff1447
6
+ metadata.gz: c5e3824808f307422ad5e6e402309242bb884bbcc2b3d708e8f576a97100a66fda81e20e5b63922b5123160c7348987716ca951e8de37f8a4875b522cd23d471
7
+ data.tar.gz: a187b673ed8efea261c2c8218e69940e1e5fd64cdc911ea2b217f2276eb72193d674c4933709ce1437f67359ac46376a3280b04c397d3f7e98d78f2492141624
@@ -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
- source.each(4096) do |chunk|
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
@@ -16,9 +16,14 @@ module Wip
16
16
  DEFAULT_TARGET = '/app'
17
17
  DEFAULT_BINARY = 'rsync'
18
18
  DEFAULT_INTERVAL = 2
19
- # -a preserves modes and timestamps so file watchers and bundler see a
20
- # faithful copy rather than a tree that looks freshly written every sync.
21
- BASE_OPTIONS = %w[-a].freeze
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Wip
4
- VERSION = '0.7.2'
4
+ VERSION = '0.7.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wslc-wip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wip contributors