redis-store 1.1.5 → 1.1.6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of redis-store might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6b416841fd9dc89e5b45429f265b58c2f96f3564
4
- data.tar.gz: 4d3db7c5541a0fb20c286796ef0252ed37225e3e
3
+ metadata.gz: 58dbe54f1d5825384c5def102f10898a6b9b2e49
4
+ data.tar.gz: c527c3db592454bbd8a950790debe970ee6a59ba
5
5
  SHA512:
6
- metadata.gz: aca6857bfe152b68ba3f9076d0be04a1b0cf55c02034f519e7f32eacee63f6cb98e5ed9e1d089e381b02a74cab3e97ee4e1d7f7c8ecbb7003b51b5469683d3ac
7
- data.tar.gz: 08d158b75835bf6fb70aae57be335761e8c4e175e7e131336dce9fd26492a14479b5375b7a55e220c17734abebc1227e3c3346c3cb4cf36873f1cccbca87b9c9
6
+ metadata.gz: 3ea158585055db1bffbe1add2fca655c69eeeaebd0e0017a6fee71b029a0dfacaec915f06187d9a68bd92f218c25fffafa6cfd756bc312be5f39979e65a5f7fe
7
+ data.tar.gz: dd0f84f52e02aa72a5434b22966edc442ba84febea9478fb8c8861e8515678c718cd5c0b1c315d16d34fcbd4f6749ac3c11eadbb331ad0e5b7de03e4d8077b95
@@ -4,6 +4,8 @@ script: 'bundle exec rake'
4
4
  rvm:
5
5
  - 1.9.3
6
6
  - 2.0.0
7
+ - 2.1
8
+ - 2.2
7
9
  - ruby-head
8
10
  - rbx-19mode
9
11
  - jruby-19mode
@@ -16,7 +16,8 @@ class Redis
16
16
  end
17
17
 
18
18
  def to_s
19
- "Redis Client connected to #{@client.host}:#{@client.port} against DB #{@client.db}"
19
+ h = @client.host
20
+ "Redis Client connected to #{/:/ =~ h ? '['+h+']' : h}:#{@client.port} against DB #{@client.db}"
20
21
  end
21
22
 
22
23
  private
@@ -68,7 +68,7 @@ class Redis
68
68
  end
69
69
 
70
70
  options = {
71
- :host => uri.host,
71
+ :host => uri.hostname,
72
72
  :port => uri.port || DEFAULT_PORT,
73
73
  :password => uri.password
74
74
  }
@@ -1,5 +1,5 @@
1
1
  class Redis
2
2
  class Store < self
3
- VERSION = '1.1.5'
3
+ VERSION = '1.1.6'
4
4
  end
5
5
  end
@@ -85,6 +85,12 @@ describe "Redis::Store::Factory" do
85
85
  store.instance_variable_get(:@client).password.must_equal("secret")
86
86
  end
87
87
 
88
+ it "correctly uses specified ipv6 host" do
89
+ store = Redis::Store::Factory.create "redis://[::1]:6380"
90
+ store.to_s.must_equal("Redis Client connected to [::1]:6380 against DB 0")
91
+ store.client.host.must_equal("::1")
92
+ end
93
+
88
94
  it "instantiates Redis::DistributedStore" do
89
95
  store = Redis::Store::Factory.create "redis://127.0.0.1:6379", "redis://127.0.0.1:6380"
90
96
  store.must_be_kind_of(Redis::DistributedStore)
@@ -58,22 +58,22 @@ end
58
58
 
59
59
  describe MockTtlStore do
60
60
  let(:key) { 'hello' }
61
- let(:value) { 'value' }
61
+ let(:mock_value) { 'value' }
62
62
  let(:options) { { :expire_after => 3600 } }
63
63
  let(:redis) { MockTtlStore.new }
64
64
 
65
65
  describe '#set' do
66
66
  describe 'without options' do
67
67
  it 'must call super with key and value' do
68
- redis.set(key, value)
69
- redis.has_set?(key, value).must_equal true
68
+ redis.set(key, mock_value)
69
+ redis.has_set?(key, mock_value).must_equal true
70
70
  end
71
71
  end
72
72
 
73
73
  describe 'with options' do
74
74
  it 'must call setex with proper expiry and set raw to true' do
75
- redis.set(key, value, options)
76
- redis.has_setex?(key, options[:expire_after], value, :raw => true).must_equal true
75
+ redis.set(key, mock_value, options)
76
+ redis.has_setex?(key, options[:expire_after], mock_value, :raw => true).must_equal true
77
77
  end
78
78
  end
79
79
  end
@@ -81,25 +81,25 @@ describe MockTtlStore do
81
81
  describe '#setnx' do
82
82
  describe 'without expiry' do
83
83
  it 'must call super with key and value' do
84
- redis.setnx(key, value)
85
- redis.has_setnx?(key, value)
84
+ redis.setnx(key, mock_value)
85
+ redis.has_setnx?(key, mock_value)
86
86
  end
87
87
 
88
88
  it 'must not call expire' do
89
89
  MockTtlStore.any_instance.expects(:expire).never
90
90
 
91
- redis.setnx(key, value)
91
+ redis.setnx(key, mock_value)
92
92
  end
93
93
  end
94
94
 
95
95
  describe 'with expiry' do
96
96
  it 'must call setnx with key and value and set raw to true' do
97
- redis.setnx(key, value, options)
98
- redis.has_setnx?(key, value, :raw => true).must_equal true
97
+ redis.setnx(key, mock_value, options)
98
+ redis.has_setnx?(key, mock_value, :raw => true).must_equal true
99
99
  end
100
100
 
101
101
  it 'must call expire' do
102
- redis.setnx(key, value, options)
102
+ redis.setnx(key, mock_value, options)
103
103
  redis.has_expire?(key, options[:expire_after]).must_equal true
104
104
  end
105
105
  end
@@ -2,6 +2,6 @@ require 'test_helper'
2
2
 
3
3
  describe Redis::Store::VERSION do
4
4
  it 'returns current version' do
5
- Redis::Store::VERSION.must_equal '1.1.4'
5
+ Redis::Store::VERSION.must_equal '1.1.6'
6
6
  end
7
7
  end
@@ -22,28 +22,24 @@ describe Redis::Store do
22
22
 
23
23
  describe '#set' do
24
24
  describe 'with expiry' do
25
- let(:key) { 'key' }
26
- let(:value) { 'value' }
27
25
  let(:options) { { :expire_after => 3600 } }
28
26
 
29
27
  it 'must not double marshall' do
30
28
  Marshal.expects(:dump).once
31
29
 
32
- @store.set(key, value, options)
30
+ @store.set('key', 'value', options)
33
31
  end
34
32
  end
35
33
  end
36
34
 
37
35
  describe '#setnx' do
38
36
  describe 'with expiry' do
39
- let(:key) { 'key' }
40
- let(:value) { 'value' }
41
37
  let(:options) { { :expire_after => 3600 } }
42
38
 
43
39
  it 'must not double marshall' do
44
40
  Marshal.expects(:dump).once
45
41
 
46
- @store.setnx(key, value, options)
42
+ @store.setnx('key', 'value', options)
47
43
  end
48
44
  end
49
45
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-store
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Guidi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-08 00:00:00.000000000 Z
11
+ date: 2015-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -162,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
162
  version: '0'
163
163
  requirements: []
164
164
  rubyforge_project: redis-store
165
- rubygems_version: 2.4.6
165
+ rubygems_version: 2.4.8
166
166
  signing_key:
167
167
  specification_version: 4
168
168
  summary: Redis stores for Ruby frameworks