cacchern 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/cacchern/sorted_set.rb +7 -0
- data/lib/cacchern/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 843be6e668774bc2790364ff3da87e796dfcd8b1a37ebe608cf30a4e44df8833
|
4
|
+
data.tar.gz: 17a33f5d158637a0dbf664ad5da4fae040203726617db8573aae3cffc8a6aeb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28219e58af3036d0dfcbc64bb04d5b759199427c1f40346c13d9a7eaf9b5709e8061c28be863357ee3f7a741dd9220a1777318c2e5ac7b260bca031fa8196095
|
7
|
+
data.tar.gz: a9cc677d64499ad9dd7cf7db35a7eae12ababa73da4aeb147cdf3f4924a583d401d014041d498121933b6465ed9fbb19a01a6cfbdd55692190a35bb2916bbd09
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cacchern (0.0.
|
4
|
+
cacchern (0.0.11)
|
5
5
|
activemodel (>= 5.2.2, < 6.0.0)
|
6
6
|
activesupport (>= 5.2.2, < 6.0.0)
|
7
7
|
redis (>= 4.0.0, < 4.2.0)
|
@@ -24,7 +24,7 @@ GEM
|
|
24
24
|
i18n (1.7.0)
|
25
25
|
concurrent-ruby (~> 1.0)
|
26
26
|
jaro_winkler (1.5.2)
|
27
|
-
minitest (5.
|
27
|
+
minitest (5.13.0)
|
28
28
|
parallel (1.17.0)
|
29
29
|
parser (2.6.3.0)
|
30
30
|
ast (~> 2.4.0)
|
data/lib/cacchern/sorted_set.rb
CHANGED
@@ -27,6 +27,13 @@ module Cacchern
|
|
27
27
|
self.class.value_class.new(id, score)
|
28
28
|
end
|
29
29
|
|
30
|
+
def where_by_score(min: '-inf', max: '+inf')
|
31
|
+
min = min.to_s if min.is_a? Numeric
|
32
|
+
max = max.to_s if max.is_a? Numeric
|
33
|
+
values = Redis.current.zrangebyscore @key, min, max, withscores: true
|
34
|
+
values.map { |value| self.class.value_class.new(value[0], value[1]) }
|
35
|
+
end
|
36
|
+
|
30
37
|
def order(direction = :asc)
|
31
38
|
values = case direction
|
32
39
|
when :asc
|
data/lib/cacchern/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cacchern
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shuhei TAKASUGI
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|