redis_cluster 0.1.6 → 0.1.7

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: 3a14207e035c4ed8c3ca40d247a0fd966f01bb01
4
- data.tar.gz: 1de7c4b10fc4b48ca75e32857679b997c84b02c0
3
+ metadata.gz: c54c99a524bcd4562da35cacbf34aebf94233328
4
+ data.tar.gz: a8551e253aa66076ce77b6b2c734a6ed2a35cbb5
5
5
  SHA512:
6
- metadata.gz: 1ac77627825033b1f00f0154854ac68d8ebbd2b4bbbdb692eee2012ba2173f09f92233571e2e3069dad13720bf37184691aa27108c6de3404b95b74c21a345ab
7
- data.tar.gz: 6b2a77c7391682071c667978eca9222403fbbe6ac525bf94ea81aeaa16085a37d92bbe9f3c1fb2fad4ce762d03046551efa2250a8aa66e8922b71d64b694d5c7
6
+ metadata.gz: f84bc375e7a74c4f9535588072eb2fd173bd3d4a61b73963ae146ccbbab2ff149771bb6f77f38df3030875af9e3d73b16254c2969156b9f0a62c730c6add9fea
7
+ data.tar.gz: aa14e6c5c909563293f1e7bffcb0f028830b1b9b35fca70547758ebe3de1793fe08ef0d40f680944b6344a32e49d78ca606a12a38eefff625ca6e8b806454b9c
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # RedisCluster
2
2
 
3
- RedisCluster is rewrited from [https://github.com/antirez/redis-rb-cluster](https://github.com/antirez/redis-rb-cluster)
3
+ RedisCluster for ruby is rewrited from [https://github.com/antirez/redis-rb-cluster](https://github.com/antirez/redis-rb-cluster)
4
4
 
5
5
  Now is developing, and not use in any production environments. Welcome to test and contribute codes!
6
6
 
@@ -23,7 +23,7 @@ module RedisCluster
23
23
  sleep 0.1 if ttl < Configuration::REQUEST_TTL/2
24
24
  rescue => e
25
25
  err_code = e.to_s.split.first
26
- raise e if !%w(MOVED ASK).include?(err_code)
26
+ raise e unless %w(MOVED ASK).include?(err_code)
27
27
 
28
28
  if err_code == "ASK"
29
29
  asking = true
@@ -39,7 +39,7 @@ module RedisCluster
39
39
  end
40
40
 
41
41
  def self.redis(options)
42
- Redis.new(options)
42
+ ::Redis.new(options)
43
43
  end
44
44
 
45
45
  end # end Node
@@ -7,15 +7,16 @@ module RedisCluster
7
7
  @nodes = []
8
8
  end
9
9
 
10
- def add_node!(options, slots)
11
- new_node = Node.new(options)
10
+ # TODO: type check
11
+ def add_node!(node_options, slots)
12
+ new_node = Node.new(node_options)
12
13
  node = @nodes.find {|n| n.name == new_node.name } || new_node
13
14
  node.slots = slots
14
15
  @nodes.push(node).uniq!
15
16
  end
16
17
 
17
- def delete_except!(new_hosts)
18
- names = new_hosts.map {|host, port| "#{host}:#{port}" }
18
+ def delete_except!(master_hosts)
19
+ names = master_hosts.map {|host, port| "#{host}:#{port}" }
19
20
  @nodes.delete_if {|n| !names.include?(n.name) }
20
21
  end
21
22
 
@@ -1,3 +1,3 @@
1
1
  module RedisCluster
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis_cluster
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - wangzc
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-01 00:00:00.000000000 Z
11
+ date: 2016-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis