fsevents_to_vm 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +16 -0
- data/lib/fsevents_to_vm.rb +0 -1
- data/lib/fsevents_to_vm/cli.rb +3 -3
- data/lib/fsevents_to_vm/ssh_emit.rb +4 -3
- data/lib/fsevents_to_vm/version.rb +1 -1
- metadata +3 -5
- data/lib/fsevents_to_vm/ssh_config.rb +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c593568f83e0c594792bedcd1d1edee22bdb16c
|
4
|
+
data.tar.gz: 0d96d92e28e2f189e9d77daa34d719f086360307
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb2f79df416d0290884a7631f1db311d1677a5c5475f89d11dc79515d755fca82e217eedd4e492a191137e5129a8d7b7d682e58209c962528b932f805795e417
|
7
|
+
data.tar.gz: c32a880014f839db86d30f9536ad5bc2b4e6ceb016b76e36b764b019506e95ba4271539a7b2c32f52bd17eae57a0df74dc0061d96063794ce6671967ec0053ca
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -27,3 +27,19 @@ You can specify a specific directory to watch. This directory must be already mo
|
|
27
27
|
* Delete events are not forwarded.
|
28
28
|
* Multiple events for the same file within the same 1/100th of a second may cause events to be missed.
|
29
29
|
* Some directories that you are unlikely to care about are ignored, for example `~/Library`.
|
30
|
+
|
31
|
+
## Testing
|
32
|
+
|
33
|
+
First, make sure that `fsevents` isn't already running due to `dinghy start`, kill it if necessary.
|
34
|
+
|
35
|
+
Then run manually:
|
36
|
+
|
37
|
+
be ruby exe/fsevents_to_vm start --debug --ssh-identity-file ~/.docker/machine/machines/dinghy/id_rsa --ssh-ip $(dinghy ip) ~
|
38
|
+
|
39
|
+
You can use inotifywait in the VM to watch for events:
|
40
|
+
|
41
|
+
docker run --rm -it -v $HOME:/fstest ubuntu:trusty
|
42
|
+
apt-get update && apt-get install -y inotify-tools
|
43
|
+
inotifywait /fstest/some/dir
|
44
|
+
|
45
|
+
Then modify a file in `~/some/dir` and watch for inotifywait to catch the change.
|
data/lib/fsevents_to_vm.rb
CHANGED
data/lib/fsevents_to_vm/cli.rb
CHANGED
@@ -4,7 +4,8 @@ require 'fsevents_to_vm'
|
|
4
4
|
module FseventsToVm
|
5
5
|
class Cli < Thor
|
6
6
|
option :debug, type: :boolean, default: false
|
7
|
-
option :
|
7
|
+
option :ssh_identity_file, type: :string
|
8
|
+
option :ssh_ip, type: :string
|
8
9
|
desc "start PATH",
|
9
10
|
"Watch PATH and forward filesystem touch events to the Dinghy VM."
|
10
11
|
def start(listen_dir = ENV['HOME'])
|
@@ -13,8 +14,7 @@ module FseventsToVm
|
|
13
14
|
watcher = FseventsToVm::Watch.new(listen_dir)
|
14
15
|
path_filter = FseventsToVm::PathFilter.new
|
15
16
|
recursion_filter = FseventsToVm::RecursionFilter.new
|
16
|
-
|
17
|
-
forwarder = FseventsToVm::SshEmit.new(ssh_config)
|
17
|
+
forwarder = FseventsToVm::SshEmit.new(options[:ssh_identity_file], options[:ssh_ip])
|
18
18
|
|
19
19
|
if debug
|
20
20
|
puts "Watching #{listen_dir} and forwarding events to Dinghy VM..."
|
@@ -4,8 +4,9 @@ require 'tempfile'
|
|
4
4
|
|
5
5
|
module FseventsToVm
|
6
6
|
class SshEmit
|
7
|
-
def initialize(
|
8
|
-
@
|
7
|
+
def initialize(identity_file, ip)
|
8
|
+
@identity_file = identity_file
|
9
|
+
@ip = ip
|
9
10
|
end
|
10
11
|
|
11
12
|
def event(event)
|
@@ -19,7 +20,7 @@ module FseventsToVm
|
|
19
20
|
protected
|
20
21
|
|
21
22
|
def ssh
|
22
|
-
@ssh ||= Net::SSH.start(
|
23
|
+
@ssh ||= Net::SSH.start(@ip, 'docker', config: false, keys: [@identity_file])
|
23
24
|
end
|
24
25
|
|
25
26
|
def disconnect!
|
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
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Palmer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rb-fsevent
|
@@ -104,7 +104,6 @@ files:
|
|
104
104
|
- lib/fsevents_to_vm/event.rb
|
105
105
|
- lib/fsevents_to_vm/path_filter.rb
|
106
106
|
- lib/fsevents_to_vm/recursion_filter.rb
|
107
|
-
- lib/fsevents_to_vm/ssh_config.rb
|
108
107
|
- lib/fsevents_to_vm/ssh_emit.rb
|
109
108
|
- lib/fsevents_to_vm/version.rb
|
110
109
|
- lib/fsevents_to_vm/watch.rb
|
@@ -128,9 +127,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
127
|
version: '0'
|
129
128
|
requirements: []
|
130
129
|
rubyforge_project:
|
131
|
-
rubygems_version: 2.
|
130
|
+
rubygems_version: 2.5.1
|
132
131
|
signing_key:
|
133
132
|
specification_version: 4
|
134
133
|
summary: forward OS X file system events to a VM, designed for use with Dinghy
|
135
134
|
test_files: []
|
136
|
-
has_rdoc:
|
@@ -1,16 +0,0 @@
|
|
1
|
-
module FseventsToVm
|
2
|
-
module SshConfig
|
3
|
-
def self.fetch(ssh_config_file)
|
4
|
-
if ssh_config_file
|
5
|
-
File.open(ssh_config_file, 'rb')
|
6
|
-
else
|
7
|
-
ssh_config = `dinghy ssh-config`
|
8
|
-
raise("Could not read Vagrant VM ssh config") unless $?.success?
|
9
|
-
file = Tempfile.new('fsevents-ssh-config')
|
10
|
-
file.write(ssh_config)
|
11
|
-
file.flush
|
12
|
-
file
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|