fsevents_to_vm 1.0.0 → 1.0.1
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/README.md +6 -4
- data/lib/fsevents_to_vm/cli.rb +3 -1
- data/lib/fsevents_to_vm/ssh_config.rb +16 -0
- data/lib/fsevents_to_vm/ssh_emit.rb +2 -6
- data/lib/fsevents_to_vm/version.rb +1 -1
- data/lib/fsevents_to_vm.rb +1 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec796cab7e069c3672fdc4badd4bbcd6e9a78c58
|
4
|
+
data.tar.gz: f958b56bd1b97d4b56713776a28735f06d68b2dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01394b41e1466ae0000864d5c3cfcb22700ba8e665b4032338974e53806eaf667e1d505615b9b4a9960e4498fd0f1cc4826221966c02cce5a5a3c78753d49bd8
|
7
|
+
data.tar.gz: f94f843bbe27b859e7d63a1cc67c483db085d8363b1151235a46584ec5d5eb39d23878167d0f7b737a9e5c53fad31b00ecc473c39811e2cdefd0002b38b4de73
|
data/README.md
CHANGED
@@ -2,16 +2,18 @@
|
|
2
2
|
|
3
3
|
Forward OS X file system events to a VM, designed for use with Dinghy.
|
4
4
|
|
5
|
-
This is an early proof-of-concept implementation. If it works well in practice, it will be integrated into Dinghy.
|
6
|
-
|
7
5
|
# Installation
|
8
6
|
|
9
|
-
|
7
|
+
Normally you won't install this manually, Dinghy will do it for you.
|
8
|
+
|
9
|
+
If you want to manually install:
|
10
10
|
|
11
|
-
$
|
11
|
+
$ gem install fsevents_to_vm
|
12
12
|
|
13
13
|
## Usage
|
14
14
|
|
15
|
+
Dinghy will start fsevents_to_vm automatically. If you would like to run in manually:
|
16
|
+
|
15
17
|
The Dinghy VM must be running. Then in a terminal run:
|
16
18
|
|
17
19
|
$ fsevents_to_vm start
|
data/lib/fsevents_to_vm/cli.rb
CHANGED
@@ -4,6 +4,7 @@ require 'fsevents_to_vm'
|
|
4
4
|
module FseventsToVm
|
5
5
|
class Cli < Thor
|
6
6
|
option :debug, type: :boolean, default: false
|
7
|
+
option :ssh_config_file, type: :string
|
7
8
|
desc "start PATH",
|
8
9
|
"Watch PATH and forward filesystem touch events to the Dinghy VM."
|
9
10
|
def start(listen_dir = ENV['HOME'])
|
@@ -12,7 +13,8 @@ module FseventsToVm
|
|
12
13
|
watcher = FseventsToVm::Watch.new(listen_dir)
|
13
14
|
path_filter = FseventsToVm::PathFilter.new
|
14
15
|
recursion_filter = FseventsToVm::RecursionFilter.new
|
15
|
-
|
16
|
+
ssh_config = FseventsToVm::SshConfig.fetch(options[:ssh_config_file])
|
17
|
+
forwarder = FseventsToVm::SshEmit.new(ssh_config)
|
16
18
|
|
17
19
|
if debug
|
18
20
|
puts "Watching #{listen_dir} and forwarding events to Dinghy VM..."
|
@@ -0,0 +1,16 @@
|
|
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
|
@@ -4,12 +4,8 @@ require 'tempfile'
|
|
4
4
|
|
5
5
|
module FseventsToVm
|
6
6
|
class SshEmit
|
7
|
-
def initialize
|
8
|
-
@
|
9
|
-
@ssh_config.write(`cd /usr/local/var/dinghy/vagrant && vagrant ssh-config --host dinghy`)
|
10
|
-
raise("Could not read Vagrant VM ssh config") unless $?.success?
|
11
|
-
@ssh_config.flush
|
12
|
-
@ssh = Net::SSH.start('dinghy', 'docker', config: @ssh_config.path)
|
7
|
+
def initialize(ssh_config_file)
|
8
|
+
@ssh = Net::SSH.start('dinghy', 'docker', config: ssh_config_file.path)
|
13
9
|
end
|
14
10
|
|
15
11
|
def event(event)
|
data/lib/fsevents_to_vm.rb
CHANGED
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.0.1
|
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-
|
11
|
+
date: 2015-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rb-fsevent
|
@@ -104,6 +104,7 @@ 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
|
107
108
|
- lib/fsevents_to_vm/ssh_emit.rb
|
108
109
|
- lib/fsevents_to_vm/version.rb
|
109
110
|
- lib/fsevents_to_vm/watch.rb
|
@@ -132,3 +133,4 @@ signing_key:
|
|
132
133
|
specification_version: 4
|
133
134
|
summary: forward OS X file system events to a VM, designed for use with Dinghy
|
134
135
|
test_files: []
|
136
|
+
has_rdoc:
|