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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 124e6037bd036859c7d514b92ed5b8ab0dab59be
4
- data.tar.gz: 43d4d7cf2e483c0ee9b6c28d16a0d29c499c3b59
3
+ metadata.gz: 4c593568f83e0c594792bedcd1d1edee22bdb16c
4
+ data.tar.gz: 0d96d92e28e2f189e9d77daa34d719f086360307
5
5
  SHA512:
6
- metadata.gz: bc9bc260fb294da69de46fc69792e5eec6d763c74fdcc49b5e06bf9337430cbf87f06aec2ebc3f15bb9265f01ab094a1df7661051da63f75b806e225ab118186
7
- data.tar.gz: cdba2d66334200bc349b2232f8b7f741b558d8201118b173ea37bf2d8589a60b64c3b42dfc2988d73111a6280e6a9d90b814f4e0dad0d657d10edcec4200bcb2
6
+ metadata.gz: bb2f79df416d0290884a7631f1db311d1677a5c5475f89d11dc79515d755fca82e217eedd4e492a191137e5129a8d7b7d682e58209c962528b932f805795e417
7
+ data.tar.gz: c32a880014f839db86d30f9536ad5bc2b4e6ceb016b76e36b764b019506e95ba4271539a7b2c32f52bd17eae57a0df74dc0061d96063794ce6671967ec0053ca
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## 1.1.0 - 2016-01-07
5
+
6
+ ### Changed
7
+ - Switch to direct ip and identity_file params, rather than reading a SSH config file
8
+
4
9
  ## 1.0.0 - 2015-08-05
5
10
 
6
11
  ### 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.
@@ -4,7 +4,6 @@ require 'fsevents_to_vm/event'
4
4
  require 'fsevents_to_vm/watch'
5
5
  require 'fsevents_to_vm/path_filter'
6
6
  require 'fsevents_to_vm/recursion_filter'
7
- require 'fsevents_to_vm/ssh_config'
8
7
  require 'fsevents_to_vm/ssh_emit'
9
8
 
10
9
  module FseventsToVm
@@ -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 :ssh_config_file, type: :string
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
- ssh_config = FseventsToVm::SshConfig.fetch(options[:ssh_config_file])
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(ssh_config_file)
8
- @config_path = ssh_config_file.path
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('dinghy', 'docker', config: @config_path)
23
+ @ssh ||= Net::SSH.start(@ip, 'docker', config: false, keys: [@identity_file])
23
24
  end
24
25
 
25
26
  def disconnect!
@@ -1,3 +1,3 @@
1
1
  module FseventsToVm
2
- VERSION = "1.0.2"
2
+ VERSION = "1.1.0"
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.2
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: 2015-11-03 00:00:00.000000000 Z
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.4.7
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