php-composer 0.4.2 → 0.4.3
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 +4 -4
- data/lib/composer/json/json_file.rb +7 -10
- data/lib/composer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f4fef9e32074a6500ae797874890fda4025bc99
|
4
|
+
data.tar.gz: 5089e218bae13ef1bd70bc2b8aadd0041865f02b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b9f6656b78a14d010c6301c21220d4744efff3b3950e60c0f55a70c6521390d4dc242a636b57a0997b3dd1f8a8724f37e9784db3ffd606fe01bd3473b66a3c7
|
7
|
+
data.tar.gz: efff2210450d467cb7eaaacd54261322a4a9694a749f9bb7380d86677463eb7465fd8ac2dc857140acde7baecd47637e7ec91bc360934f958a49f882a67e9f52
|
@@ -53,7 +53,7 @@ module Composer
|
|
53
53
|
# Returns:
|
54
54
|
# true if this json file exists; otherwise false.
|
55
55
|
def exists?
|
56
|
-
File.exists?(path)
|
56
|
+
File.exists?(@path)
|
57
57
|
end
|
58
58
|
|
59
59
|
# Reads the json file.
|
@@ -84,26 +84,23 @@ module Composer
|
|
84
84
|
raise UnexpectedValueError,
|
85
85
|
"#{dir} exists and is not a directory."
|
86
86
|
end
|
87
|
-
FileUtils.mkdir_p(dir, 0777)
|
87
|
+
FileUtils.mkdir_p(dir, mode: 0777)
|
88
88
|
end
|
89
89
|
|
90
90
|
retries = 3
|
91
91
|
while retries >= 0
|
92
92
|
begin
|
93
|
-
file_ending = options & JSON_PRETTY_PRINT ? "\n" : ''
|
93
|
+
file_ending = options & JsonFormatter::JSON_PRETTY_PRINT ? "\n" : ''
|
94
94
|
File.open(@path, 'w') do |f|
|
95
|
-
content = encode(hash, options) + file_ending
|
95
|
+
content = JsonFile::encode(hash, options) + file_ending
|
96
96
|
f.write(content)
|
97
97
|
end
|
98
98
|
break
|
99
99
|
|
100
100
|
rescue Exception => e
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
else
|
105
|
-
raise e
|
106
|
-
end
|
101
|
+
raise e unless retries > 0
|
102
|
+
retries -= 1
|
103
|
+
sleep 0.5
|
107
104
|
end
|
108
105
|
end
|
109
106
|
|
data/lib/composer/version.rb
CHANGED