ellen-redis 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +10 -1
- data/ellen-redis.gemspec +1 -1
- data/images/screenshot.png +0 -0
- data/lib/ellen/brains/redis.rb +4 -8
- data/lib/ellen/redis/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ed69006182ba29d441b262a9b7c9aa0cc605fab
|
4
|
+
data.tar.gz: 20538d095e8cd3eedfef7bcedcaf1299d084ee95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a2865c08f090caffbd01eb9ddde68fa5da1850bb9f2eca208a10499bad087d34e40c02d247bdcea79c19646d6ab4b8dff8f89092f4b8a528587165fa52d0a34
|
7
|
+
data.tar.gz: edd764b61aa6323c7eeaf3fc2475592374e48a0dbd0bd08017561c8df379b01b5d9ac82ad8260c8f9ff3345375317297452091f65b1ccb8ccf84c8f5fa852d8c
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,17 @@
|
|
1
1
|
# Ellen::Redis
|
2
|
-
Store Ellen's memory in Redis.
|
2
|
+
Store [Ellen](https://github.com/r7kamura/ellen/)'s memory in Redis.
|
3
|
+
|
4
|
+
## Usage
|
5
|
+
```ruby
|
6
|
+
# Gemfile
|
7
|
+
gem "ellen-redis"
|
8
|
+
```
|
3
9
|
|
4
10
|
## ENV
|
5
11
|
```
|
6
12
|
REDIS_URL - Redis URL (e.g. redis://foo:bar@example.com:6379/)
|
7
13
|
REDIS_SAVE_INTERVAL - Interval sec to push data to Redis (default: 5)
|
8
14
|
```
|
15
|
+
|
16
|
+
## Screenshot
|
17
|
+
![](https://raw.githubusercontent.com/r7kamura/ellen-redis/master/images/screenshot.png)
|
data/ellen-redis.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
17
17
|
spec.require_paths = ["lib"]
|
18
18
|
|
19
|
-
spec.add_dependency "ellen", "0.1.1"
|
19
|
+
spec.add_dependency "ellen", ">= 0.1.1"
|
20
20
|
spec.add_dependency "redis"
|
21
21
|
spec.add_dependency "redis-namespace"
|
22
22
|
spec.add_development_dependency "bundler", "~> 1.6"
|
Binary file
|
data/lib/ellen/brains/redis.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require "json"
|
2
1
|
require "redis"
|
3
2
|
require "redis/namespace"
|
4
3
|
|
@@ -27,13 +26,14 @@ module Ellen
|
|
27
26
|
private
|
28
27
|
|
29
28
|
def push
|
30
|
-
client.set(KEY, data
|
29
|
+
client.set(KEY, Marshal.dump(data))
|
31
30
|
end
|
32
31
|
|
33
32
|
def pull
|
34
|
-
if
|
35
|
-
|
33
|
+
if str = client.get(KEY)
|
34
|
+
Marshal.load(str)
|
36
35
|
end
|
36
|
+
rescue TypeError
|
37
37
|
end
|
38
38
|
|
39
39
|
def sync
|
@@ -62,10 +62,6 @@ module Ellen
|
|
62
62
|
def interval
|
63
63
|
(ENV["REDIS_SAVE_INTERVAL"] || 5).to_i
|
64
64
|
end
|
65
|
-
|
66
|
-
def encoded_value
|
67
|
-
data.to_json
|
68
|
-
end
|
69
65
|
end
|
70
66
|
end
|
71
67
|
end
|
data/lib/ellen/redis/version.rb
CHANGED
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ellen-redis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ellen
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.1.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.1.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -94,6 +94,7 @@ files:
|
|
94
94
|
- README.md
|
95
95
|
- Rakefile
|
96
96
|
- ellen-redis.gemspec
|
97
|
+
- images/screenshot.png
|
97
98
|
- lib/ellen/brains/redis.rb
|
98
99
|
- lib/ellen/redis.rb
|
99
100
|
- lib/ellen/redis/version.rb
|