hem-tasks-rsync 1.3.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hem/tasks/rsync/deps.rb +13 -1
- data/lib/hem/tasks/rsync/version.rb +1 -1
- data/lib/hem/tasks/rsync/vm.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4dd7b4af1434eba3ad12054fe91c082707017f8f
|
4
|
+
data.tar.gz: 844c803b83283fde9df9ebd8fac7a95ab5405988
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f75fdb8b707fad8080fdd666e4cb4e9b2c951d309633e9ef2f86c07b00fc1206e857dde6659f661d139cc51e29b96d06a92e8b720f0b9de5741653e064f0753b
|
7
|
+
data.tar.gz: 33e05149624b7a915283c3172d0a6c2afe2561037c1926c5f16454763f32cad1836a7884e99c4cf63d88643e89a225be55bc00800383cdbb461eaea8c10c8091
|
data/lib/hem/tasks/rsync/deps.rb
CHANGED
@@ -88,10 +88,22 @@ namespace :deps do
|
|
88
88
|
from_path: 'vendor/',
|
89
89
|
to_path: 'vendor',
|
90
90
|
deciding_file_path: File.join('vendor', 'autoload.php'),
|
91
|
-
|
91
|
+
host_to_guest_allowed: false
|
92
92
|
)
|
93
93
|
end
|
94
94
|
|
95
|
+
desc 'Upload the vendor directory from the host to the guest'
|
96
|
+
task :vendor_directory_to_guest do
|
97
|
+
Hem.ui.title 'Uploading vendor directory changes to guest'
|
98
|
+
|
99
|
+
Rake::Task['vm:rsync_manual'].execute(
|
100
|
+
from_path: 'vendor/',
|
101
|
+
to_path: 'vendor'
|
102
|
+
)
|
103
|
+
|
104
|
+
Hem.ui.success('Uploaded vendor directory changes to guest')
|
105
|
+
end
|
106
|
+
|
95
107
|
desc 'Reload the VM to use NFS mounts per directory, or sync rsync mounts if already enabled'
|
96
108
|
task :reload_or_sync do
|
97
109
|
one_mount_point = run 'grep "/vagrant " /proc/mounts || true', capture: true
|
data/lib/hem/tasks/rsync/vm.rb
CHANGED
@@ -86,7 +86,7 @@ namespace :vm do
|
|
86
86
|
argument :from_path
|
87
87
|
argument :to_path
|
88
88
|
argument :deciding_file_path
|
89
|
-
argument :
|
89
|
+
argument :host_to_guest_allowed, optional: true, default: true
|
90
90
|
task :sync_guest_changes do |_task_name, args|
|
91
91
|
Hem.ui.title "Determining if #{args[:deciding_file_path]} is newer on the host or guest"
|
92
92
|
|
@@ -108,7 +108,7 @@ namespace :vm do
|
|
108
108
|
to_path: to_path,
|
109
109
|
is_reverse: true
|
110
110
|
)
|
111
|
-
elsif args[:
|
111
|
+
elsif args[:host_to_guest_allowed] && local_file_modified.to_i > remote_file_modified.to_i
|
112
112
|
Hem.ui.success("Host file #{args[:deciding_file_path]} is newer, syncing to guest")
|
113
113
|
from_path = File.join(Hem.project_path, args[:to_path])
|
114
114
|
to_path = File.join(Hem.project_config.vm.project_mount_path, args[:from_path])
|
@@ -117,7 +117,7 @@ namespace :vm do
|
|
117
117
|
from_path: from_path,
|
118
118
|
to_path: to_path
|
119
119
|
)
|
120
|
-
elsif !args[:
|
120
|
+
elsif !args[:host_to_guest_allowed]
|
121
121
|
Hem.ui.success('Host is more up to date than the guest but syncing via another method')
|
122
122
|
else
|
123
123
|
Hem.ui.success("Host and guest file #{args[:deciding_file_path]} are up to date, not doing anything")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hem-tasks-rsync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kieren Evans
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|