dependabot-composer 0.112.32 → 0.112.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/helpers/src/UpdateChecker.php +31 -26
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91a4093bf950e8bc4c8f79d1ce3133d054ee18e5efc23e0cfedbc61ecf417439
|
4
|
+
data.tar.gz: 1d1a19877cc4eb6ac7d32ebd827d1cea6bbca1c9782f352453c58392d61a898c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 205451c0d8d74f86c9c34b137a0875afba60fdd0b924f7f1595880a02107369fe4115d3fbb9f9d5290fe92cae92223999c70f23bef1745d14d782bafc98e7767
|
7
|
+
data.tar.gz: 4322682f89a52185443fc24c4f76b01136a953a6b2dec3fbbe211111323b8f8e2d6f88e6ead31b689766411fbcb64b5884becf0f141f51b6cd41418461b01ea1
|
@@ -14,37 +14,40 @@ class UpdateChecker
|
|
14
14
|
{
|
15
15
|
[$workingDirectory, $dependencyName, $gitCredentials, $registryCredentials] = $args;
|
16
16
|
|
17
|
-
$io = new ExceptionIO();
|
18
|
-
$composer = Factory::create($io, $workingDirectory . '/composer.json');
|
19
|
-
$config = $composer->getConfig();
|
20
17
|
$httpBasicCredentials = [];
|
21
18
|
|
22
|
-
foreach ($gitCredentials as
|
23
|
-
$httpBasicCredentials[$
|
24
|
-
'username' => $
|
25
|
-
'password' => $
|
19
|
+
foreach ($gitCredentials as $credentials) {
|
20
|
+
$httpBasicCredentials[$credentials['host']] = [
|
21
|
+
'username' => $credentials['username'],
|
22
|
+
'password' => $credentials['password'],
|
26
23
|
];
|
27
24
|
}
|
28
25
|
|
29
|
-
foreach ($registryCredentials as
|
30
|
-
$httpBasicCredentials[$
|
31
|
-
'username' => $
|
32
|
-
'password' => $
|
26
|
+
foreach ($registryCredentials as $credentials) {
|
27
|
+
$httpBasicCredentials[$credentials['registry']] = [
|
28
|
+
'username' => $credentials['username'],
|
29
|
+
'password' => $credentials['password'],
|
33
30
|
];
|
34
31
|
}
|
35
32
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
33
|
+
$io = new ExceptionIO();
|
34
|
+
|
35
|
+
$composer = Factory::create($io, $workingDirectory . '/composer.json');
|
36
|
+
|
37
|
+
$config = $composer->getConfig();
|
38
|
+
|
39
|
+
if (0 < count($httpBasicCredentials)) {
|
40
|
+
$config->merge([
|
41
|
+
'config' => [
|
42
|
+
'http-basic' => $httpBasicCredentials,
|
43
|
+
],
|
44
|
+
]);
|
45
|
+
|
44
46
|
$io->loadConfiguration($config);
|
45
47
|
}
|
46
48
|
|
47
49
|
$installationManager = new DependabotInstallationManager();
|
50
|
+
|
48
51
|
$install = new Installer(
|
49
52
|
$io,
|
50
53
|
$config,
|
@@ -73,25 +76,26 @@ class UpdateChecker
|
|
73
76
|
|
74
77
|
$installedPackages = $installationManager->getInstalledPackages();
|
75
78
|
|
76
|
-
$updatedPackage = current(array_filter($installedPackages, function (PackageInterface $package) use ($dependencyName) {
|
77
|
-
return $package->getName()
|
79
|
+
$updatedPackage = current(array_filter($installedPackages, static function (PackageInterface $package) use ($dependencyName): bool {
|
80
|
+
return $package->getName() === $dependencyName;
|
78
81
|
}));
|
79
82
|
|
80
83
|
// We found the package in the list of updated packages. Return its version.
|
81
|
-
if ($updatedPackage) {
|
84
|
+
if ($updatedPackage instanceof PackageInterface) {
|
82
85
|
return preg_replace('/^([v])/', '', $updatedPackage->getPrettyVersion());
|
83
86
|
}
|
84
87
|
|
85
88
|
// We didn't find the package in the list of updated packages. Check if
|
86
89
|
// it was replaced by another package (in which case we can ignore).
|
87
90
|
foreach ($composer->getPackage()->getReplaces() as $link) {
|
88
|
-
if ($link->getTarget()
|
91
|
+
if ($link->getTarget() === $dependencyName) {
|
89
92
|
return null;
|
90
93
|
}
|
91
94
|
}
|
95
|
+
|
92
96
|
foreach ($installedPackages as $package) {
|
93
97
|
foreach ($package->getReplaces() as $link) {
|
94
|
-
if ($link->getTarget()
|
98
|
+
if ($link->getTarget() === $dependencyName) {
|
95
99
|
return null;
|
96
100
|
}
|
97
101
|
}
|
@@ -99,13 +103,14 @@ class UpdateChecker
|
|
99
103
|
|
100
104
|
// Similarly, check if the package was provided by any other package.
|
101
105
|
foreach ($composer->getPackage()->getProvides() as $link) {
|
102
|
-
if ($link->getTarget()
|
106
|
+
if ($link->getTarget() === $dependencyName) {
|
103
107
|
return preg_replace('/^([v])/', '', $link->getPrettyConstraint());
|
104
108
|
}
|
105
109
|
}
|
110
|
+
|
106
111
|
foreach ($installedPackages as $package) {
|
107
112
|
foreach ($package->getProvides() as $link) {
|
108
|
-
if ($link->getTarget()
|
113
|
+
if ($link->getTarget() === $dependencyName) {
|
109
114
|
return preg_replace('/^([v])/', '', $link->getPrettyConstraint());
|
110
115
|
}
|
111
116
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dependabot-composer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.112.
|
4
|
+
version: 0.112.33
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dependabot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-09-
|
11
|
+
date: 2019-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dependabot-common
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.112.
|
19
|
+
version: 0.112.33
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.112.
|
26
|
+
version: 0.112.33
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: byebug
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|