local_data_cacher 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/local_data_cacher.rb +3 -3
- 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: d218decdd6c2358491fe6fe52f434d982c9442a9
|
4
|
+
data.tar.gz: e79de1fcd46a8a52fc25550fa7d0a8545b86e947
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bda31205d7b55daaf871eebae79ad8d8f96282ac00588c87c6ff28441c19c2bed1408931541b73e68fdf7b86e2bd76b6590ffc4ce40c93aec945924fbecadb64
|
7
|
+
data.tar.gz: 3f13c5261fdae9edf417b9d60126bec04f5610fc660f24a1eefb083ea6f5784ce4d9d520a65f1cbf9c454f2d35f07d67491aa567f60691f5516a496afe5ceecd
|
data/lib/local_data_cacher.rb
CHANGED
@@ -29,12 +29,12 @@ class LocalDataCacher
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
-
def
|
32
|
+
def get_cached_data_info(file_name)
|
33
33
|
if(File.exists?("#{@cache_dir}/#{file_name}"))
|
34
34
|
age = ((Time.now - File.stat("#{@cache_dir}/#{file_name}").mtime).to_i / 86400.0).round.to_i
|
35
|
-
|
35
|
+
return "#{@cache_dir}/#{file_name} is currently about #{age} day(s) old"
|
36
36
|
else
|
37
|
-
|
37
|
+
return "#{@cache_dir}/#{file_name} does not exist"
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|