disk_store 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +1 -1
- data/lib/disk_store/version.rb +1 -1
- data/lib/disk_store.rb +9 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07024f79a815fe1a7ad79d9434e92a81011d06b7
|
4
|
+
data.tar.gz: 6b625b7bda7b8f4a037b8611d2e1c6445eaf742f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7808037a0c737663fd5c5efe482259b33c61a2e942afe67e41e0b87fbd4bbc34f14080aa990d4b6dceb2f200ce231353ce1ced4b9d258c2068b590ed5c95dfd8
|
7
|
+
data.tar.gz: 466111d5bdba677b81855decdf668f67e5960d70dc55f9c1d50bfe0202010f4582f974a970ba43d239d8c6e07dae4e12258df9aab5f1c7c59396a8c7430a2f12
|
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
*.gem
|
data/Gemfile.lock
CHANGED
data/lib/disk_store/version.rb
CHANGED
data/lib/disk_store.rb
CHANGED
@@ -17,7 +17,15 @@ class DiskStore
|
|
17
17
|
def write(key, io)
|
18
18
|
file_path = key_file_path(key)
|
19
19
|
ensure_cache_path(File.dirname(file_path))
|
20
|
-
|
20
|
+
|
21
|
+
File.open(file_path, 'wb') do |f|
|
22
|
+
begin
|
23
|
+
f.flock File::LOCK_EX
|
24
|
+
IO::copy_stream(io, f)
|
25
|
+
ensure
|
26
|
+
f.flock File::LOCK_UN
|
27
|
+
end
|
28
|
+
end
|
21
29
|
end
|
22
30
|
|
23
31
|
def exist?(key)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: disk_store
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kelly Sutton
|
@@ -87,6 +87,7 @@ executables: []
|
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
|
+
- .gitignore
|
90
91
|
- Gemfile
|
91
92
|
- Gemfile.lock
|
92
93
|
- README.md
|