gemmyrb 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/lib/gemmy/components/cache.rb +8 -5
- data/lib/gemmy/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2e8b98d32d322e6d51bed3e6d7fe795e61eb2ea
|
4
|
+
data.tar.gz: 4cbcb9bc58eb5353d1d92eb2f0e24bbe91a316b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acfad1fbbea670260ff7facce87015063e43ed46eb5a17dd5bc794e03c624d4d93b8a262c201fb9e8c6d773e730294181d4b5b70e9462d19732f05b3257863b0
|
7
|
+
data.tar.gz: 78d7cbd03c70f10e9afdb10c174010e840935260e87b18cd792728cb0af5c82a0808a557afefd0c7a3629dd06fe897f57900cb63ea2d4380e7d1ef1d2342c16f
|
@@ -5,14 +5,17 @@ class Gemmy::Components::Cache < Hash
|
|
5
5
|
using Gemmy.patch("object/i/home")
|
6
6
|
using Gemmy.patch("object/i/m")
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
def self.setup_cache_folder
|
9
|
+
cache_path = ENV["GEMMY_CACHE_PATH"] || "#{home}/gemmy/caches"
|
10
|
+
unless Dir.exists?(cache_path)
|
11
|
+
`mkdir -p #{cache_path}`
|
12
|
+
end
|
13
|
+
cache_path
|
12
14
|
end
|
13
15
|
|
14
16
|
def initialize(db_name, hash={})
|
15
|
-
|
17
|
+
cache_path = self.class.setup_cache_folder
|
18
|
+
@db = hash.persisted "#{cache_path}/#{db_name}.yaml"
|
16
19
|
@db.set_state hash
|
17
20
|
end
|
18
21
|
|
data/lib/gemmy/version.rb
CHANGED