It seems that (apparently randomly) the index.json files are getting compressed and causing URI.open to fail. Possibly, it's a little unclear. Nonetheless, sending the "Accept-Encoding" of "identity" seems to do the trick.
Unified · Split
| @@ -239,7 +239,7 @@ class DocsCLI < Thor · 238 unmodified lines | |||
| 239 | ['index.json', 'meta.json'].each do |filename| | 239 | ['index.json', 'meta.json'].each do |filename| |
| 240 | json = "https://documents.devdocs.io/#{doc.path}/#{filename}?#{time}" | 240 | json = "https://documents.devdocs.io/#{doc.path}/#{filename}?#{time}" |
| 241 | begin | 241 | begin |
| 242 | URI.open(json) do |file| | 242 | URI.open(json, "Accept-Encoding" => "identity") do |file| |
| 243 | mutex.synchronize do | 243 | mutex.synchronize do |
| 244 | path = File.join(dir, filename) | 244 | path = File.join(dir, filename) |
| 245 | File.write(path, file.read) | 245 | File.write(path, file.read) |