vagrant-unison2 1.0.3 → 1.1.0

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
  SHA1:
3
- metadata.gz: 5fbeaa92d6a266486c3cb2c23f3bd7a37fcef419
4
- data.tar.gz: 343730bc81af11c15e9a938eb56f81784b13fc62
3
+ metadata.gz: a56396d3b841677ba05e588a000d1720dc2a8bad
4
+ data.tar.gz: 23822e18be0e28ad858c2fa2ff516279b3c6857b
5
5
  SHA512:
6
- metadata.gz: dd3e648f055d4c244a977af44478f8cbf7cca0f1b5cff388d5c662e460b37df41e7fb6a607ae81580b99a3629bb977f88392abd49935d8797d81e44eebc98c13
7
- data.tar.gz: 0a334a39731673322e8d68c54bc850c87cffb446954530c4f965940b8d3768e80afaebcfa901cd7ffd569b453af2b91bcb2bff1a060251f98ae2fda8ffba7564
6
+ metadata.gz: edbcc038df62a9793359da3842eedfdee9f2d498f926e7100742ac0592c7e527f2c2ee6f74f8c71384d768203ae76b2a8ac7f38b153ea2de522380baa1a1fb0c
7
+ data.tar.gz: 0d6e5322228b67d435706f55bdf3e3b92c18a9e18586983d2212f9d5e937bdd9677a5d870fe35fa5e2a20855238c63feac5f83f4a78c336b92b88102c5077673
@@ -109,7 +109,25 @@ module VagrantPlugins
109
109
 
110
110
  @env.ui.info "Running #{command}"
111
111
 
112
- system(command)
112
+ # Re-run on a crash.
113
+ # On a sigint, wait 2 seconds before respawning command.
114
+ # If INT comes in again while waiting, program exits.
115
+ # If INT comes in after we've respanwned,
116
+ # will bring us back to this trap handler.
117
+ exit_on_next_sigint = false
118
+ while true
119
+ begin
120
+ sleep 2 if exit_on_next_sigint
121
+ exit_on_next_sigint = false
122
+ system(command)
123
+ rescue Interrupt
124
+ exit 1 if exit_on_next_sigint
125
+ @env.ui.info '** Hit Ctrl + C again to kill. **'
126
+ exit_on_next_sigint = true
127
+ rescue Exception
128
+ @env.ui.info '** Sync crashed. Respawning. Hit Ctrl + C twice to kill. **'
129
+ end
130
+ end
113
131
  end
114
132
  end
115
133
 
@@ -23,7 +23,7 @@ module VagrantPlugins
23
23
  private
24
24
 
25
25
  def args
26
- [
26
+ _args = [
27
27
  'unison',
28
28
  @paths.host,
29
29
  @ssh_command.uri,
@@ -33,6 +33,7 @@ module VagrantPlugins
33
33
  ignore_arg,
34
34
  ['-sshargs', %("#{@ssh_command.command}")],
35
35
  ].flatten.compact
36
+ _args
36
37
  end
37
38
 
38
39
  def batch_arg
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Unison
3
- VERSION = "1.0.3"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-unison2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Laing
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-02-15 00:00:00.000000000 Z
13
+ date: 2016-02-25 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: listen