ssdb-attr 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/lib/ssdb-attr.rb +7 -0
- data/lib/ssdb-attr/version.rb +1 -1
- data/lib/ssdb/attr.rb +13 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2a68a5814ca537bb67770f14fb335ecb2fd8ab9
|
4
|
+
data.tar.gz: e42026f5032a122f2546d1c3da070203d9e12b97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43fe05c73f91bd48dbdaf0c16113268561cee70e00e59460ed47d78626bc71637fb5978bbfbad5f0695f9ddf109c6b42d24fa5acebdf1759d30f6cde90cd47c6
|
7
|
+
data.tar.gz: 5470f3d596b29718a97dc3c83b4924ec9a5c238498943be5e8807aafae21f810643f984685e90a4201ec7f1438dfb6efe634c58114a09f7dda1f7b82f96cec1a
|
data/README.md
CHANGED
data/lib/ssdb-attr.rb
CHANGED
@@ -23,6 +23,13 @@ module SSDBAttr
|
|
23
23
|
# `pool`: Pool size of the connection pool. Default to 1.
|
24
24
|
# `timeout`: Timeout of the connection pool, in second, Default to 2.
|
25
25
|
#
|
26
|
+
# Examples:
|
27
|
+
#
|
28
|
+
# `SSDBAttr.setup({ :url => "redis://localhost:8888" })`: will setup a single pool to the SSDB instance `url` points to.
|
29
|
+
# `SSDBAttr.setup({ :url => "redis://localhost:8888", :name => :main })`: will setup a named single pool.
|
30
|
+
# `SSDBAttr.setup([ { :url => "redis://localhost:8888", :name => :pool1 }, { :url => "redis://localhost:6379", :name => :pool2 } ])`: will setup two named pools.
|
31
|
+
#
|
32
|
+
#
|
26
33
|
# @param [Hash] options
|
27
34
|
#
|
28
35
|
# @return [void]
|
data/lib/ssdb-attr/version.rb
CHANGED
data/lib/ssdb/attr.rb
CHANGED
@@ -26,6 +26,13 @@ module SSDB
|
|
26
26
|
@ssdb_attr_id_field = field_name
|
27
27
|
end
|
28
28
|
|
29
|
+
#
|
30
|
+
# Specify which SSDB ConnectionPool current class should use, by name specified in `SSDBAttr.setup`
|
31
|
+
#
|
32
|
+
# @param [String/Symbol] pool_name
|
33
|
+
#
|
34
|
+
# @return [String/Symbol]
|
35
|
+
#
|
29
36
|
def ssdb_attr_pool(pool_name)
|
30
37
|
@ssdb_attr_pool_name = pool_name
|
31
38
|
end
|
@@ -86,6 +93,12 @@ module SSDB
|
|
86
93
|
|
87
94
|
private
|
88
95
|
|
96
|
+
#
|
97
|
+
# Return the ConnectionPool used by current Class.
|
98
|
+
#
|
99
|
+
#
|
100
|
+
# @return [ConnectionPool]
|
101
|
+
#
|
89
102
|
def ssdb_attr_pool
|
90
103
|
SSDBAttr.pool(self.class.ssdb_attr_pool_name)
|
91
104
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ssdb-attr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Larry Zhao
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|
@@ -192,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
192
192
|
version: '0'
|
193
193
|
requirements: []
|
194
194
|
rubyforge_project:
|
195
|
-
rubygems_version: 2.
|
195
|
+
rubygems_version: 2.5.1
|
196
196
|
signing_key:
|
197
197
|
specification_version: 4
|
198
198
|
summary: Provide simple helpers on persist values in redis for performance. Works
|