gh-archive 0.14 → 0.15

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/lib/gh-archive.rb +8 -1
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '09dad47f83d5fe7255be12f2aaa380331de9fc34380bc9c02d6288d7216c7778'
4
- data.tar.gz: c65569657989ad1df63e16e0ca50dfb91c97674465a767099b8bcb207aad8d16
3
+ metadata.gz: de82207e7b0f5588a694e22b9d94c8e15e6812e8ad2dd433a8c78080c3629253
4
+ data.tar.gz: 7bc6e39cb4834922e29764744a3a753d8cea34052b44b282126b520b36f69d64
5
5
  SHA512:
6
- metadata.gz: 5c4ad892837193a4665bb22241480db59bb1a3757b0cbde72cfef6e4ff242006c60591a83183b02215e6e05aa3efaa79d2ce71d6e802dbb5b5d210a1f0b462f7
7
- data.tar.gz: 24161291f01c2fb86f367f7c3b03045e4a8853433d3a4d0075a131adf2dba65f337808b5cac9480d131c9afae4b346c5904d99f630b1aa8115bb4a285832aedf
6
+ metadata.gz: 1acd0b50fdba7cf5944e50670817ad41879ea273b27c79d87d6463b0bc438220b9a806aba2db879b4dbe8394439f24a66ec9bace2a466f51fbb44755eefd6d99
7
+ data.tar.gz: a30a6de0c073840eff54b7f0678bd996a794194d2a19ae35db1559b7d8ff4ec4f29591f36a6f114878d4737d29406ba919f8907b6706afb2f7b6ab7e8bcd4c26
data/lib/gh-archive.rb CHANGED
@@ -285,7 +285,12 @@ class OnlineGHAProvider < GHAProvider
285
285
  sleep 1
286
286
  end
287
287
 
288
- return @cache.get(filename)
288
+ data = @cache.get(filename)
289
+ if data
290
+ return data
291
+ else
292
+ raise DownloadArchiveException, "Could not scan #{filename}: data unavailable."
293
+ end
289
294
  else
290
295
  URI.open("http://data.gharchive.org/#{filename}") do |gz|
291
296
  return self.read_gha_file(gz)
@@ -338,6 +343,8 @@ class OnlineGHAProvider < GHAProvider
338
343
  @logger.warn("Could not unzip, cache and analyze the zip at #{current_time}: " + e.message)
339
344
  end
340
345
  end
346
+
347
+ @cache.put(filename, nil) unless @cache.has?(filename)
341
348
  end
342
349
 
343
350
  def each(from = Time.gm(2015, 1, 1), to = Time.now)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gh-archive
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.14'
4
+ version: '0.15'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simone Scalabrino
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-29 00:00:00.000000000 Z
11
+ date: 2021-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: code-assertions