disk_store 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -0
- data/Gemfile.lock +2 -2
- data/README.md +2 -0
- data/Rakefile +7 -0
- data/lib/disk_store.rb +4 -0
- data/lib/disk_store/version.rb +1 -1
- data/spec/disk_store_spec.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7faa15c4c175c701e092ae666603104e0cd3c79d
|
4
|
+
data.tar.gz: 645d9a33a2dbe7f3174ab36227ab3618ed6d147c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22842f3a27bc962003309cad6e0ccb573667984049615167d22d6024d01b85b3eb369f939e0f809b097c7dd783771ea4379d1478b1e8f5c0c3da39a21ea9fd60
|
7
|
+
data.tar.gz: 3264b63300a777e1c60d234b8b723383b95df29a4053f5227a4f9c4bf00e753965bb1d1ce6b2b1e1d33f7c6f607681c06e159428613731be353794d3ebfe0e77
|
data/.travis.yml
ADDED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
disk_store (0.1.
|
4
|
+
disk_store (0.1.2)
|
5
5
|
rake
|
6
6
|
|
7
7
|
GEM
|
@@ -12,7 +12,7 @@ GEM
|
|
12
12
|
safe_yaml (~> 0.9.0)
|
13
13
|
diff-lcs (1.2.5)
|
14
14
|
multi_json (1.8.4)
|
15
|
-
rake (10.
|
15
|
+
rake (10.2.2)
|
16
16
|
rspec (2.14.1)
|
17
17
|
rspec-core (~> 2.14.0)
|
18
18
|
rspec-expectations (~> 2.14.0)
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# DiskStore
|
2
2
|
|
3
|
+
[![Travis CI](https://travis-ci.org/layervault/disk_store.png?branch=master)](https://travis-ci.org/layervault/disk_store)
|
4
|
+
|
3
5
|
DiskStore is a way of caching large files to disk in Ruby. Unlike ActiveSupport::Cache::Store,
|
4
6
|
which is designed primarily for storing values of strings, DiskStore is meant for
|
5
7
|
caching files to disk.
|
data/Rakefile
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require "rspec/core/rake_task"
|
3
|
+
|
4
|
+
RSpec::Core::RakeTask.new(:spec)
|
5
|
+
|
1
6
|
task :console do
|
2
7
|
require 'irb'
|
3
8
|
require 'irb/completion'
|
@@ -5,3 +10,5 @@ task :console do
|
|
5
10
|
ARGV.clear
|
6
11
|
IRB.start
|
7
12
|
end
|
13
|
+
|
14
|
+
task :default => :spec
|
data/lib/disk_store.rb
CHANGED
@@ -23,6 +23,9 @@ class DiskStore
|
|
23
23
|
f.flock File::LOCK_EX
|
24
24
|
IO::copy_stream(io, f)
|
25
25
|
ensure
|
26
|
+
# We need to make sure that any data written makes it to the disk.
|
27
|
+
# http://stackoverflow.com/questions/6701103/understanding-ruby-and-os-i-o-buffering
|
28
|
+
f.fsync
|
26
29
|
f.flock File::LOCK_UN
|
27
30
|
end
|
28
31
|
end
|
@@ -38,6 +41,7 @@ class DiskStore
|
|
38
41
|
File.delete(file_path)
|
39
42
|
delete_empty_directories(File.dirname(file_path))
|
40
43
|
end
|
44
|
+
true
|
41
45
|
end
|
42
46
|
|
43
47
|
def fetch(key)
|
data/lib/disk_store/version.rb
CHANGED
data/spec/disk_store_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kelly Sutton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -88,6 +88,7 @@ extensions: []
|
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
90
|
- .gitignore
|
91
|
+
- .travis.yml
|
91
92
|
- Gemfile
|
92
93
|
- Gemfile.lock
|
93
94
|
- README.md
|