vagrant-vaimo-unison 2.0.2 → 2.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 20d076324ca8f25800a53bd151ec7f6ca60707dc
4
- data.tar.gz: aeb4809321eaa49bae3faf5103928aab4f86d7d8
3
+ metadata.gz: f25dc5fd5ddd86766446b5411f91848bf12f8d95
4
+ data.tar.gz: 87d0c221cd01df1d72648503351f78a9a0f7a807
5
5
  SHA512:
6
- metadata.gz: 53dd3543cfa29a444dc14f0e1002dffeab8cbe44b17e3ca9be071e53eeac3b063f67d1003cb3c435c6b86de8be5ebd13fda3db87af96d81f6ab773414ff8fc9b
7
- data.tar.gz: 294085065542b4ebd4c00a008b0781a4f8e1c706a3a545cf307c5362d6a583f50ecee9d8260609f35bd21fec5416faf50ddfcfe603fae3ebaffc2ffe10e060af
6
+ metadata.gz: b3cf06f546ef3ef98361be397ab66093214dab326911f517b2ed9b75e6e6bd61efd2eb4de8553cea21bf45855cac8f08c087f8bbaf974001b97d319de8676d2b
7
+ data.tar.gz: 43885decdea686d54e54644092079994e230aa148882ce545903a8f949f239cbb683ac6d931b6c9fabef662ad637d2047fb9de4e0380c97eb5dd55e3fb3c25a7
@@ -19,6 +19,8 @@ module VagrantPlugins
19
19
  end
20
20
 
21
21
  def execute
22
+ parse_options!
23
+
22
24
  sync_once
23
25
  sync_polling unless options[:no_polling]
24
26
  end
@@ -26,7 +28,7 @@ module VagrantPlugins
26
28
  def sync_once
27
29
  status = nil
28
30
  with_target_vms do |machine|
29
- execute_sync_command(machine) do |command|
31
+ execute_sync_command(machine, true) do |command|
30
32
  command.batch = true
31
33
  command.terse = true
32
34
  command = command.to_s
@@ -129,7 +131,7 @@ module VagrantPlugins
129
131
  def execute
130
132
  with_target_vms do |machine|
131
133
  ssh_user = machine.config.unison.ssh_user
132
- command = "rm -rf ~/Library/'Application Support'/Unison/*"
134
+ command = "rm -rf ~/Library/'Application Support'/Unison/*"
133
135
  @env.ui.info "Running #{command} on host" if options[:verbose]
134
136
  system(command)
135
137
 
@@ -4,25 +4,27 @@ module VagrantPlugins
4
4
  module Unison
5
5
  # mixin providing common functionality for our vagrant commands
6
6
  module UnisonSync
7
- def execute_sync_command(machine)
7
+ def execute_sync_command(machine, display_sync_message = false)
8
8
  parse_options!
9
9
 
10
10
  return 0 if machine.config.unison.host_folder.nil?
11
11
 
12
12
  unison_paths = UnisonPaths.new(@env, machine, options[:project])
13
13
 
14
- startup_command(machine, unison_paths)
14
+ startup_command(machine, unison_paths, display_sync_message)
15
15
 
16
16
  yield set_shell_command(machine, options, unison_paths)
17
17
  end
18
18
 
19
- def startup_command(machine, unison_paths)
19
+ def startup_command(machine, unison_paths, display_sync_message = false)
20
20
  guest_path = unison_paths.guest
21
21
  host_path = unison_paths.host
22
22
  ssh_user = machine.config.unison.ssh_user
23
23
 
24
- @env.ui.info "Sync changes from {host}::#{host_path}"
25
- @env.ui.info " --> {guest VM}::#{guest_path}"
24
+ if display_sync_message
25
+ @env.ui.info "Sync changes from {host}::#{host_path}"
26
+ @env.ui.info " --> {guest VM}::#{guest_path}"
27
+ end
26
28
 
27
29
  # Create the guest and host path if they don't exists path
28
30
  machine.communicate.sudo("mkdir -p '#{guest_path}'")
@@ -78,10 +80,9 @@ module VagrantPlugins
78
80
  end
79
81
 
80
82
  def options_optional_flags(o)
81
- # Coming soon
82
- # o.on('--no-polling', 'trigger sync without starting the polling process') do |flag|
83
- # options[:no_polling] = flag
84
- # end
83
+ o.on('--no-polling', 'trigger sync without starting the polling process') do |flag|
84
+ options[:no_polling] = !flag
85
+ end
85
86
 
86
87
  o.on('--verbose', 'print additional debug information') do |flag|
87
88
  options[:verbose] = flag
@@ -119,7 +120,8 @@ module VagrantPlugins
119
120
  end
120
121
 
121
122
  def check_conflicting_options!
122
- enabled = %i[prefer_local prefer_remote force_local force_remote].select do |opt|
123
+ conflicting = %i[prefer_local prefer_remote force_local force_remote]
124
+ enabled = conflicting.select do |opt|
123
125
  options[opt]
124
126
  end
125
127
 
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Unison
3
- VERSION = '2.0.2'
3
+ VERSION = '2.2.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-vaimo-unison
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Platform Team @ Vaimo