shhh 1.6.4 → 1.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/shhh/app/cache.rb +19 -7
- data/lib/shhh/app/commands/command.rb +2 -0
- data/lib/shhh/version.rb +1 -1
- 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: f0dbd7d3e5bcbeafe77c1b0c1bc9b65a43cd1e5e
|
4
|
+
data.tar.gz: 0826054665ac7542bf8fb8db7c2c6266e04723e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f726a8afd274a478fd3c439a5758c810db1ca28aeef380d9961ee670a822284f72b7b836c5e0b743a9be83f871d3c281f276e71157f8b0ec636f30dd00bd34cc
|
7
|
+
data.tar.gz: 417a3995ac55bc82a00d3398d37be3202c85a41c19dfcffbf5c3801c094db74e02a09bc3052f8a9f293371e23d2abae24f5b3729e2cc47e00eef05f068427364
|
data/lib/shhh/app/cache.rb
CHANGED
@@ -1,27 +1,32 @@
|
|
1
1
|
require 'coin'
|
2
2
|
require 'digest'
|
3
3
|
require 'singleton'
|
4
|
-
# # configure the URI that the DRb server runs on (defaults to druby://localhost:PORT)
|
5
|
-
|
6
4
|
|
7
5
|
module Shhh
|
8
6
|
module App
|
7
|
+
#
|
8
|
+
# +Cache+ looks like a hash, but is a singleton, and provides
|
9
|
+
# access to the shared across processes Cache.
|
10
|
+
#
|
11
|
+
# The current implementation is based on DRb, which creates a
|
12
|
+
# server process that then manages the data structure.
|
13
|
+
#
|
9
14
|
class Cache
|
10
|
-
|
11
15
|
include Singleton
|
12
16
|
|
13
17
|
class << self
|
18
|
+
def cache
|
19
|
+
self.instance
|
20
|
+
end
|
21
|
+
|
14
22
|
def configure
|
23
|
+
# configure the URI that the DRb server runs on
|
15
24
|
Coin.uri = 'druby://127.0.0.1:24924'
|
16
25
|
end
|
17
26
|
end
|
18
27
|
|
19
28
|
self.configure
|
20
29
|
|
21
|
-
def md5(string)
|
22
|
-
Digest::MD5.base64digest(string)
|
23
|
-
end
|
24
|
-
|
25
30
|
def [] (key)
|
26
31
|
Coin.read(md5(key))
|
27
32
|
end
|
@@ -29,6 +34,13 @@ module Shhh
|
|
29
34
|
def []=(key, value)
|
30
35
|
Coin.write(md5(key), value)
|
31
36
|
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def md5(string)
|
41
|
+
Digest::MD5.base64digest(string)
|
42
|
+
end
|
43
|
+
|
32
44
|
end
|
33
45
|
end
|
34
46
|
end
|
data/lib/shhh/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shhh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konstantin Gredeskoul
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: require_dir
|