fsevents_to_vm 1.0.0 → 1.0.1

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: bcb778ce441e59e1c508839c74ab72f129315328
4
- data.tar.gz: cb6a7c1a54cf648fd54f44d2b17e2321ce0bd645
3
+ metadata.gz: ec796cab7e069c3672fdc4badd4bbcd6e9a78c58
4
+ data.tar.gz: f958b56bd1b97d4b56713776a28735f06d68b2dd
5
5
  SHA512:
6
- metadata.gz: db5a302a53c468f1d18c73bb32cf57cec1d05b12cd92a5f00148fbee14af5616fc532e2576359adf71a63ef1fed7d485a0ebe53bbb4064f7d7770c48796fd3cc
7
- data.tar.gz: af329d180f4ce7779666d9b01a3ed5287f9b3823c14b90e53501850dd014eafc03f2f73d2dbc111ff1566557f6fa8042770814c6398a23f263cbbea55a4de22b
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
- This is a ruby gem, but isn't published yet. To install, clone the repo and run:
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
- $ rake install
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
@@ -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
- forwarder = FseventsToVm::SshEmit.new
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
- @ssh_config = Tempfile.new('fsevents-ssh-config')
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)
@@ -1,3 +1,3 @@
1
1
  module FseventsToVm
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -4,6 +4,7 @@ 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'
7
8
  require 'fsevents_to_vm/ssh_emit'
8
9
 
9
10
  module FseventsToVm
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.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-05 00:00:00.000000000 Z
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: