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 +4 -4
- data/lib/simple_stats_store/file_dump.rb +5 -3
- 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: 11f8d3e8e99a6bef9199f16be06b9abb82d21e78
|
4
|
+
data.tar.gz: d5379b72cfc958607572ea809ffc43448724204e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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}
|
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
|
-
|
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",
|
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.
|
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-
|
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
|