vagrant-phpstorm-tunnel 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/data/php +24 -5
  3. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5ce5b93dfae8b36654916c65ecd96d32f6008424
4
- data.tar.gz: 787bda93f441242c1fb0851501b9d79c24fd1a9a
3
+ metadata.gz: f51f152562f305e26ae6ff6ff2541508dfe9b7e3
4
+ data.tar.gz: 926845a0929f66ec51d3fed87f9222e5e72885bb
5
5
  SHA512:
6
- metadata.gz: b25486928d1015ebd66b2fad4b3763b51566627a15274cd14985bf601391f9f94148a672726390612e4fbc0a8651bf5ac43575725003516fdbb5a05ce81cdd18
7
- data.tar.gz: 7ce1e3a785a43f5e2c36f48512c6a4fae41a794a9e1526e68fa14068012ba1d581403710a4f26e5c7eb2ab7e001c8c3b1d22f5dd0f7692d3ed10d463526d6e35
6
+ metadata.gz: e1e902d86093c85e69d7f23fca97306a812a0f1c5ea3c72bc334b053779104df5f78bd0c3f2e0f045011842d00106d5e7940008c90616964e8a37f9e26e72864
7
+ data.tar.gz: ddbd456f1c2ef6175348c822395148a15c508ab78733487a00b403a9cb4a8f794b1f45661d7f20868d5f7114f34c10d4d3e58760d588d1d75ae3b9444ca0919e
data/data/php CHANGED
@@ -33,6 +33,8 @@ if (file_exists($commandPrefixFile)) {
33
33
  $commandPrefix = trim(file_get_contents($commandPrefixFile));
34
34
  }
35
35
 
36
+ $coverageFileList = array();
37
+
36
38
  $arguments = $argv;
37
39
  array_shift($arguments);
38
40
  foreach ($arguments as $index => &$argument) {
@@ -41,24 +43,30 @@ foreach ($arguments as $index => &$argument) {
41
43
 
42
44
  // Paths mapping
43
45
  $filePath = $argument;
44
- if (file_exists($filePath)) {
46
+ if (strrpos($filePath, '.coverage') == strlen($filePath) - 9) {
47
+ // Mapping output files to remote paths
48
+ if(!is_dir($homeDirHost . '/output/')) {
49
+ mkdir($homeDirHost . '/output/', 0777, true);
50
+ }
51
+ $argument = $homeDirGuest . '/output/' . basename($filePath);
52
+ $coverageFileList[$filePath] = $homeDirHost . '/output/' . basename($filePath);
53
+ } elseif (file_exists($filePath)) {
45
54
  if (strpos($filePath, $projectDirHost) !== false) {
46
55
  // Mapping project paths to remote paths
47
- $arguments[$index] = str_replace($projectDirHost, $projectDirGuest, $filePath);
56
+ $argument = str_replace($projectDirHost, $projectDirGuest, $filePath);
48
57
  } else {
49
58
  // Mapping any other local system paths to remote paths, upload files
50
59
  if(!is_dir($homeDirHost . '/scripts/')) {
51
60
  mkdir($homeDirHost . '/scripts/', 0777, true);
52
61
  }
53
62
  copy($filePath, $homeDirHost . '/scripts/' . basename($filePath));
54
- $arguments[$index] = $homeDirGuest . '/scripts/' . basename($filePath);
63
+ $argument = $homeDirGuest . '/scripts/' . basename($filePath);
55
64
  }
56
65
  }
57
66
 
58
67
  $argument = escapeshellarg($argument);
59
68
  }
60
69
 
61
-
62
70
  // Get XDEBUG environment variable
63
71
  $env = '';
64
72
  if (isset($_SERVER['XDEBUG_CONFIG'])) {
@@ -68,4 +76,15 @@ if (isset($_SERVER['XDEBUG_CONFIG'])) {
68
76
  $includePaths = array('.', $projectDirGuest . '/vendor/phpunit/phpunit');
69
77
  $arguments = array_merge(array('-d', 'include_path=' . implode(':', $includePaths)), $arguments);
70
78
 
71
- passthru($pipe . '"' .$commandPrefix. ' ' . $env . ' php ' . implode(' ', $arguments) . '"');
79
+ passthru($pipe . escapeshellarg($commandPrefix. ' ' . $env . ' php ' . implode(' ', $arguments)));
80
+
81
+ // Copy output files to their location, adapt paths
82
+ foreach($coverageFileList as $filePath => $hostPath) {
83
+ if (!file_exists($hostPath)) {
84
+ @unlink($filePath);
85
+ } else {
86
+ $contents = file_get_contents($hostPath);
87
+ $contents = str_replace($projectDirGuest, $projectDirHost, $contents);
88
+ file_put_contents($filePath, $contents);
89
+ }
90
+ }
metadata CHANGED
@@ -1,16 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-phpstorm-tunnel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cargo Media
8
8
  - kris-lab
9
9
  - njam
10
+ - fauvel
10
11
  autorequire:
11
12
  bindir: bin
12
13
  cert_chain: []
13
- date: 2014-03-28 00:00:00.000000000 Z
14
+ date: 2014-04-09 00:00:00.000000000 Z
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
16
17
  name: rake