redcord 0.1.6 → 0.2.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: 91184713358e549897cc7d1a544a8f8244b2aa267b623a6af947711219983ce5
4
- data.tar.gz: d24d9e8f1f5cfa72afc6c4f2bfe64933f8f7278ed3dd7a3a53f4ae026168a732
3
+ metadata.gz: c343794236cfb0990142a2200625066bd176b3f57cdfbf4336e752a568796621
4
+ data.tar.gz: d4dff503e7bf52756ea884be7179a2b7a0b004ab5c93d8af24a8fa7bee953e76
5
5
  SHA512:
6
- metadata.gz: 828c660a25ea131fc013ba261cb3395fbbcc637170f5b8601f68e30f7095cda8f5e3ed5781bcbb0bf39fcec693438953b76b4a106b9fd9966e3c5f3ff6469145
7
- data.tar.gz: e3a6469ae8778ea5c110922c7324c43e394e273c0392a16524bbe489fd24df4bffca4cd83c7a225430b05ac134e346dad9de64e2514f87caddf249704209961d
6
+ metadata.gz: 78d24a7abea242512ad8943c19b50ad363ee320204c3e56d386f6b408e4d11c508dd35f724490963546817f87c53a2b38cb496035bd1b1a4e0c078b78503c1ff
7
+ data.tar.gz: a3660d9cb64af06ae210e1885be8de10e9285edea5671252204caea07eda43c0b7fc899a29f5d5975c1cc2c216abd61345b6211a9e83dffdc3920e45704d42d0
@@ -13,16 +13,16 @@ class Redcord::ConnectionPool
13
13
  # Avoid method_missing when possible for better performance
14
14
  methods = Set.new(Redcord::Redis.instance_methods(false) + Redis.instance_methods(false))
15
15
  methods.each do |method_name|
16
- define_method method_name do |*args, &blk|
16
+ define_method method_name do |*args, **kwargs, &blk|
17
17
  @connection_pool.with do |redis|
18
- redis.send(method_name, *args, &blk)
18
+ redis.send(method_name, *args, **kwargs, &blk)
19
19
  end
20
20
  end
21
21
  end
22
22
 
23
- def method_missing(method_name, *args, &blk)
23
+ def method_missing(method_name, *args, **kwargs, &blk)
24
24
  @connection_pool.with do |redis|
25
- redis.send(method_name, *args, &blk)
25
+ redis.send(method_name, *args, **kwargs, &blk)
26
26
  end
27
27
  end
28
28
  end
@@ -1,18 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Redcord
4
+ class RedcordError < StandardError; end
5
+
4
6
  # Raised by Model.find
5
- class RecordNotFound < StandardError; end
6
- class InvalidAction < StandardError; end
7
+ class RecordNotFound < RedcordError; end
8
+ class InvalidAction < RedcordError; end
7
9
 
8
10
  # Raised by Model.where
9
- class InvalidQuery < StandardError; end
10
- class AttributeNotIndexed < StandardError; end
11
+ class InvalidQuery < RedcordError; end
12
+ class AttributeNotIndexed < RedcordError; end
11
13
  class WrongAttributeType < TypeError; end
12
- class CustomIndexInvalidQuery < StandardError; end
13
- class CustomIndexInvalidDesign < StandardError; end
14
+ class CustomIndexInvalidQuery < RedcordError; end
15
+ class CustomIndexInvalidDesign < RedcordError; end
14
16
  class RedcordDeletedError < ::Redis::CommandError; end
15
17
 
16
18
  # Raised by shared_by_attribute
17
- class InvalidAttribute < StandardError; end
19
+ class InvalidAttribute < RedcordError; end
18
20
  end
@@ -48,7 +48,7 @@ module Redcord::Migration::Index
48
48
  sig { params(model: T.class_of(Redcord::Base), key: String).void }
49
49
  def _del_zset(model, key)
50
50
  # ZPOPMIN might not be avaliable on old redis servers
51
- model.redis.zscan_each(match: key) do |id, _|
51
+ model.redis.zscan_each(key) do |id, _|
52
52
  model.redis.zrem(key, id)
53
53
  end
54
54
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redcord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chan Zuckerberg Initiative
@@ -123,35 +123,35 @@ dependencies:
123
123
  - !ruby/object:Gem::Version
124
124
  version: 0.4.4704
125
125
  - !ruby/object:Gem::Dependency
126
- name: codecov
126
+ name: rspec
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ">="
129
+ - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '0'
131
+ version: '3.2'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ">="
136
+ - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '0'
138
+ version: '3.2'
139
139
  - !ruby/object:Gem::Dependency
140
- name: rspec
140
+ name: simplecov
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - "~>"
143
+ - - ">="
144
144
  - !ruby/object:Gem::Version
145
- version: '3.2'
145
+ version: '0'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - "~>"
150
+ - - ">="
151
151
  - !ruby/object:Gem::Version
152
- version: '3.2'
152
+ version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
- name: simplecov
154
+ name: simplecov-cobertura
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - ">="
@@ -214,7 +214,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
214
214
  requirements:
215
215
  - - ">="
216
216
  - !ruby/object:Gem::Version
217
- version: 2.5.0
217
+ version: 2.7.0
218
218
  required_rubygems_version: !ruby/object:Gem::Requirement
219
219
  requirements:
220
220
  - - ">="