redis-store 1.5.0 → 1.9.0

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
  SHA256:
3
- metadata.gz: 10e6007fb1a0708fe88d7627a23a2b5e8e0303e9ee81ec886d27a5c6fdb7ed07
4
- data.tar.gz: 9415f933dae0284fe8114cf6d350561bc23c58bcf9f1182d734f36fdf8436707
3
+ metadata.gz: 476790788b3d0462db696bc3773a72c18b3f57f04db394e238bc849b04f6b54a
4
+ data.tar.gz: 443eca0ff3f6acd16c696aadf4e8cb1c34edf213944d489d66fe6508a5ff2390
5
5
  SHA512:
6
- metadata.gz: 69a4d72561bf0b9da2c88cc7a32d37a7ca06bb758a60d338bc4c12added10c1549f818f6e0e68af3854e0911a92f591c3c3094455d731f7a48d1cb1b47a9a700
7
- data.tar.gz: da5fee4e7926a6032ca82fa7ee924c0a676124bffb55c84d5f553f066eb0ca47678cad583403ccc5979d04b7ddcdeb98652edf906472db364713baf483bc64e3
6
+ metadata.gz: 104215ff505c8dd84b0baac16c99a75e117b33dafbc0f654f6f87acbf0fba1b0a1c34ce3e63530566f65289ca725a98b1e0a640cfc878f33e27fb51857a243df
7
+ data.tar.gz: 49730d0bc9e9a1295aaa6b410cae27c58838f953a71fb6255c53e27dc4faa670b827effbe2d0f614d4d4dfbe5f91b333465c380db44475c466f261d534e2d91c
@@ -0,0 +1,6 @@
1
+ ---
2
+ plugins:
3
+ rubocop:
4
+ enabled: true
5
+ fixme:
6
+ enabled: true
@@ -0,0 +1,2 @@
1
+ assignees:
2
+ - tubbo
@@ -0,0 +1,138 @@
1
+ ---
2
+ AllCops:
3
+ TargetRubyVersion: 2.4
4
+ # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
5
+ # to ignore them, so only the ones explicitly set in this file are enabled.
6
+ DisabledByDefault: true
7
+ Exclude:
8
+ - '**/vendor/**/*'
9
+
10
+ # Prefer &&/|| over and/or.
11
+ Style/AndOr:
12
+ Enabled: true
13
+
14
+ # Do not use braces for hash literals when they are the last argument of a
15
+ # method call.
16
+ Style/BracesAroundHashParameters:
17
+ Enabled: true
18
+ EnforcedStyle: context_dependent
19
+
20
+ # Align comments with method definitions.
21
+ Layout/CommentIndentation:
22
+ Enabled: true
23
+
24
+ Layout/ElseAlignment:
25
+ Enabled: true
26
+
27
+ Layout/EmptyLineAfterMagicComment:
28
+ Enabled: true
29
+
30
+ # In a regular class definition, no empty lines around the body.
31
+ Layout/EmptyLinesAroundClassBody:
32
+ Enabled: true
33
+
34
+ # In a regular method definition, no empty lines around the body.
35
+ Layout/EmptyLinesAroundMethodBody:
36
+ Enabled: true
37
+
38
+ # In a regular module definition, no empty lines around the body.
39
+ Layout/EmptyLinesAroundModuleBody:
40
+ Enabled: true
41
+
42
+ Layout/FirstParameterIndentation:
43
+ Enabled: true
44
+
45
+ # Method definitions after `private` or `protected` isolated calls need one
46
+ # extra level of indentation.
47
+ Layout/IndentationConsistency:
48
+ Enabled: true
49
+ EnforcedStyle: rails
50
+
51
+ # Two spaces, no tabs (for indentation).
52
+ Layout/IndentationWidth:
53
+ Enabled: true
54
+
55
+ Layout/LeadingCommentSpace:
56
+ Enabled: true
57
+
58
+ Layout/SpaceAfterColon:
59
+ Enabled: true
60
+
61
+ Layout/SpaceAfterComma:
62
+ Enabled: true
63
+
64
+ Layout/SpaceAroundEqualsInParameterDefault:
65
+ Enabled: true
66
+
67
+ Layout/SpaceAroundKeyword:
68
+ Enabled: true
69
+
70
+ Layout/SpaceAroundOperators:
71
+ Enabled: true
72
+
73
+ Layout/SpaceBeforeComma:
74
+ Enabled: true
75
+
76
+ Layout/SpaceBeforeFirstArg:
77
+ Enabled: true
78
+
79
+ Style/DefWithParentheses:
80
+ Enabled: true
81
+
82
+ # Defining a method with parameters needs parentheses.
83
+ Style/MethodDefParentheses:
84
+ Enabled: true
85
+
86
+ # Use `foo {}` not `foo{}`.
87
+ Layout/SpaceBeforeBlockBraces:
88
+ Enabled: true
89
+
90
+ # Use `foo { bar }` not `foo {bar}`.
91
+ Layout/SpaceInsideBlockBraces:
92
+ Enabled: true
93
+
94
+ # Use `{ a: 1 }` not `{a:1}`.
95
+ Layout/SpaceInsideHashLiteralBraces:
96
+ Enabled: true
97
+
98
+ Layout/SpaceInsideParens:
99
+ Enabled: true
100
+
101
+ # Detect hard tabs, no hard tabs.
102
+ Layout/Tab:
103
+ Enabled: true
104
+
105
+ # Blank lines should not have any spaces.
106
+ Layout/TrailingBlankLines:
107
+ Enabled: true
108
+
109
+ # No trailing whitespace.
110
+ Layout/TrailingWhitespace:
111
+ Enabled: true
112
+
113
+ # Use quotes for string literals when they are enough.
114
+ Style/UnneededPercentQ:
115
+ Enabled: true
116
+
117
+ # Align `end` with the matching keyword or starting expression except for
118
+ # assignments, where it should be aligned with the LHS.
119
+ Layout/EndAlignment:
120
+ Enabled: true
121
+ EnforcedStyleAlignWith: variable
122
+ AutoCorrect: true
123
+
124
+ # Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
125
+ Lint/RequireParentheses:
126
+ Enabled: true
127
+
128
+ Style/RedundantReturn:
129
+ Enabled: true
130
+ AllowMultipleReturnValues: true
131
+
132
+ Style/Semicolon:
133
+ Enabled: true
134
+ AllowAsExpressionSeparator: true
135
+
136
+ # Prefer Foo.method over Foo::method
137
+ Style/ColonMethodCall:
138
+ Enabled: true
@@ -4,32 +4,36 @@ cache: bundler
4
4
  notifications:
5
5
  webhooks: https://www.travisbuddy.com
6
6
  on_success: never
7
-
8
- # 1.9.3 has Bundler 1.7.6 with the "undefined method `spec' for nil" bug
9
- before_install: gem install bundler
10
-
7
+ before_install:
8
+ - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
9
+ > ./cc-test-reporter
10
+ - chmod +x ./cc-test-reporter
11
11
  rvm:
12
- - 1.9.3
13
- - 2.0
14
- - 2.1
15
- - 2.2
16
12
  - 2.3
17
13
  - 2.4
14
+ - 2.5
15
+ - 2.6
16
+ - 2.7
18
17
  - ruby-head
19
18
  - jruby-head
20
-
21
19
  gemfile:
22
- - gemfiles/redis_3_x.gemfile
23
- - gemfiles/redis_4_x.gemfile
24
-
20
+ - gemfiles/redis_4_0_x.gemfile
21
+ - gemfiles/redis_4_1_x.gemfile
22
+ - gemfiles/redis_4_x.gemfile
23
+ before_script: "./cc-test-reporter before-build"
24
+ after_script:
25
+ - "./cc-test-reporter after-build --exit-code $EXIT_CODE"
26
+ - "./cc-test-reporter format-coverage -t simplecov -o coverage/codeclimate.json"
27
+ - if [[ "$TRAVIS_TEST_RESULT" == 0 ]]; then ./cc-test-reporter upload-coverage; fi
25
28
  matrix:
26
29
  allow_failures:
27
- - rvm: jruby-head
28
- - rvm: ruby-head
29
- exclude:
30
- - rvm: 1.9.3
31
- gemfile: gemfiles/redis_4_x.gemfile
32
- - rvm: 2.0
33
- gemfile: gemfiles/redis_4_x.gemfile
34
- - rvm: 2.1
35
- gemfile: gemfiles/redis_4_x.gemfile
30
+ - rvm: jruby-head
31
+ - rvm: ruby-head
32
+ deploy:
33
+ provider: rubygems
34
+ api_key:
35
+ secure: vhwP2VNfVYgppPNis7asqMnWuIcURr2e99uhYeHS4Sc+hIozu2QzAAekDrVpEDpeaEubtmTi19UcV4dZbDrQ0M+buE8LJEpItz73yK++J75Rzyh/bsGnWTy2FIvedLrH+jBNf28I9p8XNWkQxVaTc/r/v6BX3mmyV/jVoTBz9es=
36
+ gem: redis-store
37
+ on:
38
+ tags: true
39
+ repo: redis-store/redis-store
data/Appraisals CHANGED
@@ -1,6 +1,10 @@
1
1
 
2
- appraise "redis_3_x" do
3
- gem "redis", "~> 3.0"
2
+ appraise "redis_4_0_x" do
3
+ gem "redis", "~> 4.0.0"
4
+ end
5
+
6
+ appraise "redis_4_1_x" do
7
+ gem "redis", "~> 4.1.0"
4
8
  end
5
9
 
6
10
  appraise "redis_4_x" do
@@ -1,5 +1,78 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.9.0
4
+
5
+ Breaking Changes
6
+
7
+ * As a factor of updates for Redis v4.2.x, support for Ruby 2.1 and 2.2
8
+ has been dropped. These Ruby versions are end-of-life anyway.
9
+
10
+ Fixed
11
+
12
+ * [Compatibility with Redis client v4.2.x](https://github.com/redis-store/redis-store/pull/333)
13
+
14
+ Added
15
+
16
+ * [Support for edge Ruby's keyword arguments](https://github.com/redis-store/redis-store/pull/334)
17
+
18
+ ## 1.8.2
19
+
20
+ Breaking Changes
21
+
22
+ * None
23
+
24
+ Added
25
+
26
+ * [Add namespace to zincrby and zscore](https://github.com/redis-store/redis-store/pull/323)
27
+ * [Add namespace to zadd and zrem](https://github.com/redis-store/redis-store/pull/326)
28
+
29
+ Fixed
30
+
31
+ * None
32
+
33
+ ## 1.8.1
34
+
35
+ Breaking Changes
36
+
37
+ * None
38
+
39
+ Added
40
+
41
+ * None
42
+
43
+ Fixed
44
+
45
+ * [Add namespace to remaining hash methods](https://github.com/redis-store/redis-store/pull/321)
46
+
47
+ ## 1.8.0
48
+
49
+ Breaking Changes
50
+
51
+ * None
52
+
53
+ Added
54
+
55
+ * [Redis Cluster Support](https://github.com/redis-store/redis-store/pull/318)
56
+
57
+ Fixed
58
+
59
+ * None
60
+
61
+ ## 1.6.0
62
+
63
+ Breaking Changes
64
+
65
+ * None
66
+
67
+ Added
68
+
69
+ * [SSL/TLS Support with the rediss:// URI scheme](https://github.com/redis-store/redis-store/pull/306)
70
+ * [Use Code Style Guide For New Contributions](https://github.com/redis-store/redis-store/pull/309)
71
+
72
+ Fixed
73
+
74
+ * None
75
+
3
76
  ## 1.5.0
4
77
 
5
78
  Breaking Changes
@@ -44,7 +117,7 @@ Added
44
117
 
45
118
  Fixed
46
119
 
47
- * Conventional `Marshal.dump` usage allowing potential security vulnerability (CVE-2017-1000248)
120
+ * Conventional `Marshal.dump` usage allowing potential security vulnerability (CVE-2017-1000248)
48
121
 
49
122
  ## 1.3.0
50
123
 
@@ -0,0 +1 @@
1
+ * @tubbo
data/README.md CHANGED
@@ -23,7 +23,7 @@ Download and install Redis from [the download page](http://redis.io//download) a
23
23
  ```ruby
24
24
  git clone git://github.com/redis-store/redis-store.git
25
25
  cd redis-store
26
- gem install bundler
26
+ bundle install
27
27
  bundle exec rake
28
28
  ```
29
29
 
@@ -45,9 +45,9 @@ s.add_dependency 'redis-store', '>= 1.4', '< 2'
45
45
 
46
46
  ## Status
47
47
 
48
- [![Gem Version](https://badge.fury.io/rb/redis-store.png)](http://badge.fury.io/rb/redis-store)
49
- [![Build Status](https://secure.travis-ci.org/redis-store/redis-store.png?branch=master)](http://travis-ci.org/redis-store/redis-store?branch=master)
50
- [![Code Climate](https://codeclimate.com/github/redis-store/redis-store.png)](https://codeclimate.com/github/redis-store/redis-store)
48
+ [![Gem Version](https://badge.fury.io/rb/redis-store.svg)](http://badge.fury.io/rb/redis-store)
49
+ [![Build Status](https://secure.travis-ci.org/redis-store/redis-store.svg?branch=master)](http://travis-ci.org/redis-store/redis-store?branch=master)
50
+ [![Code Climate](https://codeclimate.com/github/redis-store/redis-store.svg)](https://codeclimate.com/github/redis-store/redis-store)
51
51
 
52
52
  ## Copyright
53
53
 
data/Rakefile CHANGED
@@ -3,7 +3,9 @@ require 'rake'
3
3
  require 'bundler/gem_tasks'
4
4
  require 'redis-store/testing/tasks'
5
5
  require 'appraisal'
6
+ require 'rubocop/rake_task'
6
7
 
8
+ RuboCop::RakeTask.new :lint
7
9
 
8
10
  if !ENV["APPRAISAL_INITIALIZED"] && !ENV["TRAVIS"]
9
11
  task :default do
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "redis", "~> 3.0"
5
+ gem "redis", "~> 4.0.0"
6
6
 
7
7
  gemspec path: "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "redis", "~> 4.1.0"
6
+
7
+ gemspec path: "../"
@@ -5,7 +5,7 @@ class Redis
5
5
  @@timeout = 5
6
6
  attr_reader :ring
7
7
 
8
- def initialize(addresses, options = { })
8
+ def initialize(addresses, options = {})
9
9
  _extend_namespace options
10
10
  @ring = options[:ring] || Redis::HashRing.new([], options[:replicas] || Redis::HashRing::POINTS_PER_SERVER)
11
11
 
@@ -19,7 +19,7 @@ class Redis
19
19
  end
20
20
 
21
21
  def reconnect
22
- nodes.each {|node| node.reconnect }
22
+ nodes.each { |node| node.reconnect }
23
23
  end
24
24
 
25
25
  def set(key, value, options = nil)
@@ -57,10 +57,10 @@ class Redis
57
57
  end
58
58
 
59
59
  def _merge_options(address, options)
60
- address.merge({
61
- :timeout => options[:timeout] || @@timeout,
60
+ address.merge(
61
+ :timeout => options[:timeout] || @@timeout,
62
62
  :namespace => options[:namespace]
63
- })
63
+ )
64
64
  end
65
65
  end
66
66
  end
@@ -13,7 +13,7 @@ class Redis
13
13
  class Store < self
14
14
  include Ttl, Interface, RedisVersion
15
15
 
16
- def initialize(options = { })
16
+ def initialize(options = {})
17
17
  super
18
18
 
19
19
  unless options[:marshalling].nil?
@@ -66,4 +66,3 @@ class Redis
66
66
  end
67
67
  end
68
68
  end
69
-
@@ -3,7 +3,6 @@ require 'uri'
3
3
  class Redis
4
4
  class Store < self
5
5
  class Factory
6
-
7
6
  DEFAULT_PORT = 6379
8
7
 
9
8
  def self.create(*options)
@@ -41,7 +40,7 @@ class Redis
41
40
  if host_options?(options)
42
41
  options
43
42
  else
44
- nil
43
+ nil
45
44
  end
46
45
  end
47
46
 
@@ -57,12 +56,12 @@ class Redis
57
56
  !options[:marshalling]
58
57
  else
59
58
  false
60
- end
59
+ end
61
60
  options
62
61
  end
63
62
 
64
63
  def self.host_options?(options)
65
- options.keys.any? {|n| [:host, :db, :port, :path].include?(n) }
64
+ options.keys.any? { |n| [:host, :db, :port, :path].include?(n) }
66
65
  end
67
66
 
68
67
  def self.extract_host_options_from_uri(uri)
@@ -71,13 +70,14 @@ class Redis
71
70
  options = { :path => uri.path }
72
71
  else
73
72
  _, db, namespace = if uri.path
74
- uri.path.split(/\//)
75
- end
73
+ uri.path.split(/\//)
74
+ end
76
75
 
77
76
  options = {
77
+ :scheme => uri.scheme,
78
78
  :host => uri.hostname,
79
79
  :port => uri.port || DEFAULT_PORT,
80
- :password => uri.password.nil? ? nil : CGI::unescape(uri.password.to_s)
80
+ :password => uri.password.nil? ? nil : CGI.unescape(uri.password.to_s)
81
81
  }
82
82
 
83
83
  options[:db] = db.to_i if db
@@ -95,16 +95,16 @@ class Redis
95
95
 
96
96
  private
97
97
 
98
- def extract_addresses_and_options(*options)
99
- options.flatten.compact.each do |token|
100
- resolved = self.class.resolve(token)
101
- if resolved
102
- @addresses << resolved
103
- else
104
- @options.merge!(self.class.normalize_key_names(token))
98
+ def extract_addresses_and_options(*options)
99
+ options.flatten.compact.each do |token|
100
+ resolved = self.class.resolve(token)
101
+ if resolved
102
+ @addresses << resolved
103
+ else
104
+ @options.merge!(self.class.normalize_key_names(token))
105
+ end
105
106
  end
106
107
  end
107
- end
108
108
  end
109
109
  end
110
110
  end