local_data_cacher 0.0.1 → 0.0.2

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/local_data_cacher.rb +8 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f43b684fae48f822de57da45d742589d35745c70
4
- data.tar.gz: 70437380c9dacedb788dc780b26c2cf780e5af22
3
+ metadata.gz: a545c81644b2df919ff18b35d291de9b4ebc5f3d
4
+ data.tar.gz: 9d3f4f0e7cb53ad4b44015ec6eb05f42930b3dbc
5
5
  SHA512:
6
- metadata.gz: dfb4fa11d7ea39d864dbe4e66ac1551294b344d46491f8cb5437120fa96e5f013c3f2fe92ce7d4d772f6bdd87b4620d9a1be72cc0ac49188cfecffc5d10d9b9f
7
- data.tar.gz: f5c9adb8ea3057ddc5284b748c954b6cd91b5ce5a62fbef60dfaa9ba93b1de0ec7487e09127e6a5377530520fba4efb3b184c0d0eebca8a3a794bc175351a98a
6
+ metadata.gz: 132722a132b7c7b5f0ca09024ffb3cfde4db2ddbd3da2594d123cff4149e6bded4279c84f7e79bcef5d2aa619992b313eb63164b53a994c1fb11371db79c2342
7
+ data.tar.gz: fb82d9a58e7f8c4a7f93bf903e582f078bacc1ce444a1847bef97ae1e4f59c5251afc14a3ccf6cbba475edae1cfa29b710f5ccdd3d1791a4e4b231bde11080d9
@@ -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.1
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-08 00:00:00.000000000 Z
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