simple_stats_store 1.0.3 → 1.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 03e2164dbdf319c2849f0e069de9ee0cd874661a
4
- data.tar.gz: 1ead7eb30a4435ccf37e954a7b9b33cea6244e64
3
+ metadata.gz: 11f8d3e8e99a6bef9199f16be06b9abb82d21e78
4
+ data.tar.gz: d5379b72cfc958607572ea809ffc43448724204e
5
5
  SHA512:
6
- metadata.gz: 417d80a4426147b7602d87aec5ef390ec56469b11325a245cff949d394a50d00188ca177ea39642fc5f056c13f48ecf4c2392200da3c1847e211063ce085cedb
7
- data.tar.gz: 8f28c0fccfaf8bc7034acb8ffd681bdac4c5c88063a091f31de69af37e61bd20dee13e2d85f6611353c6ba4b92a20bb1126776ff00d075b4680196e5e9e2eafb
6
+ metadata.gz: f7de803ffcc617d5711870cb4499702b8344b1dddcc904a522ee590232300b566836cf1718b584d1c4a9f61ac301abfab14d274b25f3c020defaaba98d086553
7
+ data.tar.gz: ad7830d2f1d8b75f276cd82d3e6793994ee7ba77ed8194ea7009e72e4c0988622fcc962dd050b280e03de35a267a19f548daf8fe9e6dc8f6423ca2d686f0e812
@@ -8,7 +8,7 @@ module SimpleStatsStore
8
8
 
9
9
  def files_contents
10
10
  contents = []
11
- Dir["#{@dir}/*"].each do |f|
11
+ Dir["#{@dir}/**/*.stats"].each do |f|
12
12
  begin
13
13
  data = File.open(f, 'r').read
14
14
  if /\n---\n$/.match(data)
@@ -28,10 +28,12 @@ module SimpleStatsStore
28
28
 
29
29
  def write(model, data)
30
30
  i = 0
31
- while File.exists?(File.expand_path("sss-#{$$}-#{Time.new.to_i}-#{i}.stats", @dir))
31
+ subdir = File.expand_path(model, @dir)
32
+ Dir.mkdir(subdir) if ! Dir.exists?(subdir)
33
+ while File.exists?(File.expand_path("sss-#{$$}-#{Time.new.to_i}-#{i}.stats", subdir))
32
34
  i += 1
33
35
  end
34
- File.open(File.expand_path("sss-#{$$}-#{Time.new.to_i}-#{i}.stats", @dir), 'w') do |f|
36
+ File.open(File.expand_path("sss-#{$$}-#{Time.new.to_i}-#{i}.stats", subdir), 'w') do |f|
35
37
  f.puts "---"
36
38
  f.puts model
37
39
  data.each do |key, value|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_stats_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Haig
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-28 00:00:00.000000000 Z
11
+ date: 2015-08-24 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Using SQLite3 to store statistics from a multithreaded application
14
14
  email: joe.haig@bbc.co.uk