update_repo 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -0
- data/lib/update_repo/version.rb +1 -1
- data/lib/update_repo.rb +15 -11
- 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: 346f6182f6f8df5dd8df4a07c32ac05994d9f9e1
|
4
|
+
data.tar.gz: dd0dda699e127125c8145ca1441fc4617528eb4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f98c18dbc7cb0986e7ec5db0d7706503534ee53208effc265301d39ca0f8531f482fd32b650369f538bf49ae2f533d2326812c110b824e26eec46dff47c9247
|
7
|
+
data.tar.gz: a46e7cc3cae4384af3aecfe57c4d84b264112724848d7e750d620b816c261be8d4e15a4bf71d665dc58f71a51571b8f6423e0c0a13dd10c57ba4e6472f277b2a
|
data/.rubocop.yml
CHANGED
data/lib/update_repo/version.rb
CHANGED
data/lib/update_repo.rb
CHANGED
@@ -195,20 +195,24 @@ EOS
|
|
195
195
|
def do_update(repo_url)
|
196
196
|
print '* Checking ', Dir.pwd.green, " (#{repo_url})\n"
|
197
197
|
Open3.popen3('git pull') do |_stdin, stdout, stderr, thread|
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
198
|
+
do_threads(stdout, stderr)
|
199
|
+
thread.join
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
203
|
+
def do_threads(stdout, stderr)
|
204
|
+
{ out: stdout, err: stderr }.each do |key, stream|
|
205
|
+
Thread.new do
|
206
|
+
while (line = stream.gets)
|
207
|
+
if key == :err && line =~ /^fatal:/
|
208
|
+
print ' ', line.red
|
209
|
+
@metrics[:failed] += 1
|
210
|
+
else
|
211
|
+
print ' ', line.cyan
|
212
|
+
@metrics[:updated] += 1 if line =~ /files?\schanged/
|
208
213
|
end
|
209
214
|
end
|
210
215
|
end
|
211
|
-
thread.join
|
212
216
|
end
|
213
217
|
end
|
214
218
|
|