fsevents_to_vm 1.0.1 → 1.0.2

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
  SHA1:
3
- metadata.gz: ec796cab7e069c3672fdc4badd4bbcd6e9a78c58
4
- data.tar.gz: f958b56bd1b97d4b56713776a28735f06d68b2dd
3
+ metadata.gz: 124e6037bd036859c7d514b92ed5b8ab0dab59be
4
+ data.tar.gz: 43d4d7cf2e483c0ee9b6c28d16a0d29c499c3b59
5
5
  SHA512:
6
- metadata.gz: 01394b41e1466ae0000864d5c3cfcb22700ba8e665b4032338974e53806eaf667e1d505615b9b4a9960e4498fd0f1cc4826221966c02cce5a5a3c78753d49bd8
7
- data.tar.gz: f94f843bbe27b859e7d63a1cc67c483db085d8363b1151235a46584ec5d5eb39d23878167d0f7b737a9e5c53fad31b00ecc473c39811e2cdefd0002b38b4de73
6
+ metadata.gz: bc9bc260fb294da69de46fc69792e5eec6d763c74fdcc49b5e06bf9337430cbf87f06aec2ebc3f15bb9265f01ab094a1df7661051da63f75b806e225ab118186
7
+ data.tar.gz: cdba2d66334200bc349b2232f8b7f741b558d8201118b173ea37bf2d8589a60b64c3b42dfc2988d73111a6280e6a9d90b814f4e0dad0d657d10edcec4200bcb2
@@ -5,11 +5,25 @@ require 'tempfile'
5
5
  module FseventsToVm
6
6
  class SshEmit
7
7
  def initialize(ssh_config_file)
8
- @ssh = Net::SSH.start('dinghy', 'docker', config: ssh_config_file.path)
8
+ @config_path = ssh_config_file.path
9
9
  end
10
10
 
11
11
  def event(event)
12
- @ssh.exec!("touch -m -c -t #{event.mtime} #{Shellwords.escape event.path}".force_encoding(Encoding::BINARY))
12
+ ssh.exec!("touch -m -c -t #{event.mtime} #{Shellwords.escape event.path}".force_encoding(Encoding::BINARY))
13
+ rescue SystemCallError => e
14
+ $stderr.puts "Error sending event: #{e}"
15
+ $stderr.puts "\t#{e.backtrace.join("\n\t")}"
16
+ disconnect!
17
+ end
18
+
19
+ protected
20
+
21
+ def ssh
22
+ @ssh ||= Net::SSH.start('dinghy', 'docker', config: @config_path)
23
+ end
24
+
25
+ def disconnect!
26
+ @ssh = nil
13
27
  end
14
28
  end
15
29
  end
@@ -1,3 +1,3 @@
1
1
  module FseventsToVm
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fsevents_to_vm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Palmer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-08-06 00:00:00.000000000 Z
11
+ date: 2015-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rb-fsevent