ruboty-redis 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1bebf7d8bad9f6ae6250d06cc02a4412d92e639f
4
- data.tar.gz: 6171eac82d8fbf9b2570d183473da60198f1b2f4
3
+ metadata.gz: 8bb9ed5d1f9bb24d7cb997a620c3e9b4a2ff03a9
4
+ data.tar.gz: d54ddedbb6e65824b86ac98d60a321b09e422119
5
5
  SHA512:
6
- metadata.gz: 48b880f22d418cae86fed94956c7a56118156cf02077ba779958b4f0e86b56cad7a362a9795fbf52756c626887ad9a6896233f6eded08ad6142793d8fa58f52d
7
- data.tar.gz: 31c5723b5d0b64e3a410116a457b02670959853716bf29682be8314de40a55737dad258629aaa538ee15e4e748b1e155c8faad76b21fe927577519d47f5d1bfe
6
+ metadata.gz: b0ec7f2b4f69d91db94c61125f5a81947d799b87a0e00ea94cfbc808071091e59f5ca83a2cb33d3c5dd1232b3eb34db16f70e46c463b0dfbc74165792c0b51d2
7
+ data.tar.gz: effb82c79e626f973d19a65620b8d1e52cf71f07bc9f337fbd55e72fd54e2a4d7620f8e35d166d6afcc9c8da75e8e0842b63fabe7384f1d8b0cf7010d1f09b24
@@ -1,3 +1,6 @@
1
+ ## 0.0.6
2
+ * Support REDIS_NAMESPACE env
3
+
1
4
  ## 0.0.5
2
5
  * Support REDISTOGO_URL
3
6
 
data/README.md CHANGED
@@ -12,6 +12,7 @@ gem "ruboty-redis"
12
12
  REDIS_SAVE_INTERVAL - Interval sec to push data to Redis (default: 5)
13
13
  REDIS_URL - Redis URL (e.g. redis://foo:bar@example.com:6379/)
14
14
  REDISTOGO_URL - Another Redis URL (At least one Redis URL is required)
15
+ REDIS_NAMESPACE - Redis name space (default: ruboty)
15
16
  ```
16
17
 
17
18
  ## Screenshot
@@ -4,8 +4,6 @@ require "redis/namespace"
4
4
  module Ruboty
5
5
  module Brains
6
6
  class Redis < Base
7
- NAMESPACE = "ruboty"
8
-
9
7
  KEY = "brain"
10
8
 
11
9
  attr_reader :thread
@@ -13,6 +11,7 @@ module Ruboty
13
11
  env :REDIS_SAVE_INTERVAL, "Interval sec to push data to Redis (default: 5)", optional: true
14
12
  env :REDIS_URL, "Redis URL (e.g. redis://foo:bar@example.com:6379/)", optional: true
15
13
  env :REDISTOGO_URL, "Another Redis URL (At least one Redis URL is required)", optional: true
14
+ env :REDIS_NAMESPACE, "Redis name space (default: ruboty)", optional: true
16
15
 
17
16
  def initialize
18
17
  super
@@ -55,7 +54,11 @@ module Ruboty
55
54
  end
56
55
 
57
56
  def client
58
- @client ||= ::Redis::Namespace.new(NAMESPACE, redis: redis)
57
+ @client ||= ::Redis::Namespace.new(namespace, redis: redis)
58
+ end
59
+
60
+ def namespace
61
+ ENV["REDIS_NAMESPACE"] || "ruboty"
59
62
  end
60
63
 
61
64
  def redis
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module Redis
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty-redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
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-10-23 00:00:00.000000000 Z
11
+ date: 2015-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruboty
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  version: '0'
119
119
  requirements: []
120
120
  rubyforge_project:
121
- rubygems_version: 2.2.2
121
+ rubygems_version: 2.4.5
122
122
  signing_key:
123
123
  specification_version: 4
124
124
  summary: Store Ruboty's memory in Redis.