vagrant-unison-morroni 0.0.16 → 0.0.17

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: ba44c81368f6e3599f6e949cac3facf725b5d302
4
- data.tar.gz: f72fe8e35dff47ae0375db755245ab7e9e3fac49
3
+ metadata.gz: 75c1475be13bdce2a2d98df72246e21e329e32ea
4
+ data.tar.gz: 47fc0845a101569d1e7f66db0f9f26b78040ed6e
5
5
  SHA512:
6
- metadata.gz: 7c9e2115f11ad1ddca33335a8d4846e890f5ba09640bb41886203792a16564165b4fbea25f196702a80b9d5fcffb990e1ed6ec007c84edfff4a5dbf857169034
7
- data.tar.gz: 584126d0f40b221d5bfdf0aa052aca95b0e8de28864c3a1b6fea0fcab1a2d8b8093f45a8c3e454f93dbe051232d853fe186d115673080721a38602087e85721a
6
+ metadata.gz: f428b4df4665910a6f319c9cfaa21021e1e78cbae4a8b0b8274d2c69e242dc45487a662ce494e02b768f6715b62f10b58f8882ac917205dd17a40b081f82b56b
7
+ data.tar.gz: f8181cdcaf04cb1b254d34300831bce8f2be4cc51ba06311bcd13fbadb166beb7957d40527527d32dd403861ef1f5578d188bf208aa3aa4c5d2a9e8f23522821
@@ -64,6 +64,64 @@ module VagrantPlugins
64
64
  CommandInteract
65
65
  end
66
66
 
67
+ provisioner "start-unison" do
68
+ require "log4r"
69
+ require "vagrant"
70
+ require "thread"
71
+ require 'listen'
72
+
73
+ require_relative 'unison_paths'
74
+ require_relative 'ssh_command'
75
+ require_relative 'shell_command'
76
+ require_relative 'unison_sync'
77
+ class StartUnisonProvisioner < Vagrant.plugin("2", :provisioner)
78
+
79
+ def initialize(machine, config)
80
+ @@machine = machine
81
+ super
82
+ end
83
+
84
+ def configure(root_config)
85
+ end
86
+
87
+ def provision
88
+
89
+ unison_paths = UnisonPaths.new(@@machine.env, @@machine)
90
+ guest_path = unison_paths.guest
91
+ host_path = unison_paths.host
92
+
93
+ user_name = @@machine.ssh_info[:username]
94
+
95
+ @@machine.ui.info(host_path)
96
+ @@machine.ui.info(guest_path)
97
+
98
+
99
+ @@machine.env.ui.info "Unisoning changes from {host}::#{host_path} --> {guest VM}::#{guest_path}"
100
+
101
+ # Create the guest path
102
+ @@machine.communicate.sudo("mkdir -p '#{guest_path}'")
103
+ @@machine.communicate.sudo("chown #{user_name} '#{guest_path}'")
104
+
105
+ ssh_command = SshCommand.new(@@machine, unison_paths)
106
+ command = ShellCommand.new(@@machine, unison_paths, ssh_command)
107
+
108
+ command.repeat = true
109
+ command.terse = true
110
+ command = command.to_s + '> ' + @@machine.env.root_path.to_s + '/.vagrant/unison.log 2>&1 &'
111
+
112
+ @@machine.env.ui.info "Running #{command}"
113
+
114
+ system(command)
115
+
116
+ end
117
+
118
+ def cleanup
119
+ end
120
+
121
+ end
122
+ StartUnisonProvisioner
123
+ end
124
+
67
125
  # This initializes the internationalization strings.
68
126
  def self.setup_i18n
69
127
  I18n.load_path << File.expand_path("locales/en.yml", Unison.source_root)
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Unison
3
- VERSION = "0.0.16"
3
+ VERSION = "0.0.17"
4
4
  end
5
5
  end
@@ -0,0 +1,5 @@
1
+ module VagrantPlugins
2
+ module Unison
3
+ VERSION = "0.0.16"
4
+ end
5
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-unison-morroni
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Laing
@@ -116,6 +116,7 @@ files:
116
116
  - lib/vagrant-unison-morroni/unison_paths.rb
117
117
  - lib/vagrant-unison-morroni/unison_sync.rb
118
118
  - lib/vagrant-unison-morroni/version.rb
119
+ - lib/vagrant-unison-morroni/version.rb~
119
120
  - locales/en.yml
120
121
  - spec/vagrant-unison-morroni/config_spec.rb
121
122
  - vagrant-unison-morroni.gemspec