local_data_cacher 0.0.1 → 0.0.2
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/local_data_cacher.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a545c81644b2df919ff18b35d291de9b4ebc5f3d
|
4
|
+
data.tar.gz: 9d3f4f0e7cb53ad4b44015ec6eb05f42930b3dbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 132722a132b7c7b5f0ca09024ffb3cfde4db2ddbd3da2594d123cff4149e6bded4279c84f7e79bcef5d2aa619992b313eb63164b53a994c1fb11371db79c2342
|
7
|
+
data.tar.gz: fb82d9a58e7f8c4a7f93bf903e582f078bacc1ce444a1847bef97ae1e4f59c5251afc14a3ccf6cbba475edae1cfa29b710f5ccdd3d1791a4e4b231bde11080d9
|
data/lib/local_data_cacher.rb
CHANGED
@@ -29,4 +29,12 @@ class LocalDataCacher
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
+
def print_cached_data_info(file_name)
|
33
|
+
if(File.exists?("#{@cache_dir}/#{file_name}"))
|
34
|
+
age = ((Time.now - File.stat("#{@cache_dir}/#{file_name}").mtime).to_i / 86400.0).round.to_i
|
35
|
+
puts "The locally cached data is currently about #{age} day(s) old"
|
36
|
+
else
|
37
|
+
puts "The file: #{@cache_dir}/#{file_name} does not exist"
|
38
|
+
end
|
39
|
+
end
|
32
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: local_data_cacher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Sykes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Allows a user to not have to continously re-fetch data within a time
|
14
14
|
frame
|