lite-redis 1.1.2 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +5 -2
- data/CHANGELOG.md +11 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +73 -72
- data/README.md +12 -19
- data/Rakefile +2 -2
- data/bin/console +3 -3
- data/docs/CONNECTION.md +8 -4
- data/docs/GEO.md +8 -4
- data/docs/HASH.md +8 -4
- data/docs/HYPER_LOG_LOG.md +7 -3
- data/docs/KEY.md +7 -3
- data/docs/LIST.md +7 -3
- data/docs/PUB_SUB.md +6 -2
- data/docs/SCRIPT.md +7 -3
- data/docs/SET.md +7 -3
- data/docs/SORTED_SET.md +8 -4
- data/docs/STRING.md +7 -3
- data/docs/TRANSACTION.md +8 -4
- data/lib/generators/lite/redis/install_generator.rb +2 -2
- data/lib/lite/redis/base.rb +53 -2
- data/lib/lite/redis/configuration.rb +2 -2
- data/lib/lite/redis/connection.rb +96 -3
- data/lib/lite/redis/geo.rb +24 -3
- data/lib/lite/redis/hash.rb +60 -3
- data/lib/lite/redis/hyper_log_log.rb +12 -3
- data/lib/lite/redis/key.rb +86 -3
- data/lib/lite/redis/list.rb +124 -3
- data/lib/lite/redis/pub_sub.rb +36 -3
- data/lib/lite/redis/railtie.rb +1 -1
- data/lib/lite/redis/script.rb +12 -3
- data/lib/lite/redis/set.rb +60 -3
- data/lib/lite/redis/sorted_set.rb +127 -3
- data/lib/lite/redis/string.rb +87 -3
- data/lib/lite/redis/transaction.rb +20 -3
- data/lib/lite/redis/version.rb +1 -1
- data/lib/lite/redis.rb +17 -32
- data/lib/tasks/redis.rake +10 -10
- data/lite-redis.gemspec +27 -33
- metadata +9 -17
- data/lib/lite/redis/helpers/base_helper.rb +0 -41
- data/lib/lite/redis/helpers/connection_helper.rb +0 -105
- data/lib/lite/redis/helpers/geo_helper.rb +0 -33
- data/lib/lite/redis/helpers/hash_helper.rb +0 -69
- data/lib/lite/redis/helpers/hyper_log_log_helper.rb +0 -21
- data/lib/lite/redis/helpers/key_helper.rb +0 -95
- data/lib/lite/redis/helpers/list_helper.rb +0 -133
- data/lib/lite/redis/helpers/pub_sub_helper.rb +0 -45
- data/lib/lite/redis/helpers/script_helper.rb +0 -21
- data/lib/lite/redis/helpers/set_helper.rb +0 -69
- data/lib/lite/redis/helpers/sorted_set_helper.rb +0 -136
- data/lib/lite/redis/helpers/string_helper.rb +0 -96
- data/lib/lite/redis/helpers/transaction_helper.rb +0 -29
data/lib/lite/redis/set.rb
CHANGED
@@ -2,10 +2,67 @@
|
|
2
2
|
|
3
3
|
module Lite
|
4
4
|
module Redis
|
5
|
-
class Set <
|
5
|
+
class Set < Base
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
def find(key)
|
8
|
+
client.smembers(key.to_s)
|
9
|
+
end
|
10
|
+
|
11
|
+
def combine(*args)
|
12
|
+
client.sunion(*args)
|
13
|
+
end
|
14
|
+
|
15
|
+
def difference(*args)
|
16
|
+
client.sdiff(*args)
|
17
|
+
end
|
18
|
+
|
19
|
+
def intersection(key, *args)
|
20
|
+
client.sinter(key.to_s, *args)
|
21
|
+
end
|
22
|
+
|
23
|
+
def sample(key, value = 1)
|
24
|
+
client.srandmember(key.to_s, value)
|
25
|
+
end
|
26
|
+
|
27
|
+
def value?(key, value)
|
28
|
+
client.sismember(key.to_s, value)
|
29
|
+
end
|
30
|
+
|
31
|
+
def count(key)
|
32
|
+
client.scard(key.to_s)
|
33
|
+
end
|
34
|
+
|
35
|
+
def create(key, args)
|
36
|
+
client.sadd?(key.to_s, args)
|
37
|
+
end
|
38
|
+
|
39
|
+
def create_combination(key, *args)
|
40
|
+
client.sunionstore(key.to_s, *args)
|
41
|
+
end
|
42
|
+
|
43
|
+
def create_difference(key, *args)
|
44
|
+
client.sdiffstore(key.to_s, *args)
|
45
|
+
end
|
46
|
+
|
47
|
+
def create_intersection(key, *args)
|
48
|
+
client.sinterstore(key.to_s, *args)
|
49
|
+
end
|
50
|
+
|
51
|
+
def move(key, destination, value)
|
52
|
+
client.smove(key.to_s, destination.to_s, value)
|
53
|
+
end
|
54
|
+
|
55
|
+
def destroy(key, args)
|
56
|
+
client.srem?(key.to_s, args)
|
57
|
+
end
|
58
|
+
|
59
|
+
def destroy_random(key)
|
60
|
+
client.spop(key.to_s)
|
61
|
+
end
|
62
|
+
|
63
|
+
def scan(key, cursor, opts = {})
|
64
|
+
client.sscan(key.to_s, cursor, **opts)
|
65
|
+
end
|
9
66
|
|
10
67
|
end
|
11
68
|
end
|
@@ -2,10 +2,134 @@
|
|
2
2
|
|
3
3
|
module Lite
|
4
4
|
module Redis
|
5
|
-
class SortedSet <
|
5
|
+
class SortedSet < Base
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
def find(key, position, opts = {})
|
8
|
+
position -= 1
|
9
|
+
value = client.zrange(key.to_s, position, position, **opts)
|
10
|
+
value.first
|
11
|
+
end
|
12
|
+
|
13
|
+
def find_score(key, position, opts = {})
|
14
|
+
value = client.zrangebyscore(key.to_s, position, position, **opts)
|
15
|
+
value.first
|
16
|
+
end
|
17
|
+
|
18
|
+
def first(key, opts = {})
|
19
|
+
value = client.zrange(key.to_s, 0, 0, **opts)
|
20
|
+
value.first
|
21
|
+
end
|
22
|
+
|
23
|
+
def first_score(key, opts = {})
|
24
|
+
value = client.zrangebyscore(key.to_s, 1, 1, **opts)
|
25
|
+
value.first
|
26
|
+
end
|
27
|
+
|
28
|
+
def last(key, opts = {})
|
29
|
+
value = client.zrevrange(key.to_s, 0, 0, **opts)
|
30
|
+
value.first
|
31
|
+
end
|
32
|
+
|
33
|
+
def last_score(key, opts = {})
|
34
|
+
value = client.zrevrangebyscore(key.to_s, 1, 1, **opts)
|
35
|
+
value.first
|
36
|
+
end
|
37
|
+
|
38
|
+
def between(key, start, finish, opts = {})
|
39
|
+
client.zrange(key.to_s, start - 1, finish - 1, **opts)
|
40
|
+
end
|
41
|
+
|
42
|
+
def between_reverse(key, start, finish, opts = {})
|
43
|
+
client.zrevrange(key.to_s, start - 1, finish - 1, **opts)
|
44
|
+
end
|
45
|
+
|
46
|
+
def between_scores(key, min, max, opts = {})
|
47
|
+
client.zrangebyscore(key.to_s, min, max, **opts)
|
48
|
+
end
|
49
|
+
|
50
|
+
def between_scores_reverse(key, min, max, opts = {})
|
51
|
+
client.zrevrangebyscore(key.to_s, min, max, **opts)
|
52
|
+
end
|
53
|
+
|
54
|
+
def between_lex(key, min, max, opts = {})
|
55
|
+
client.zrangebylex(key.to_s, min, max, **opts)
|
56
|
+
end
|
57
|
+
|
58
|
+
def between_lex_reverse(key, min, max, opts = {})
|
59
|
+
client.zrevrangebylex(key.to_s, min, max, **opts)
|
60
|
+
end
|
61
|
+
|
62
|
+
def all(key, opts = {})
|
63
|
+
client.zrange(key.to_s, 0, -1, **opts)
|
64
|
+
end
|
65
|
+
|
66
|
+
def all_reverse(key, opts = {})
|
67
|
+
client.zrevrange(key.to_s, 0, -1, **opts)
|
68
|
+
end
|
69
|
+
|
70
|
+
def position(key, value)
|
71
|
+
value = client.zrank(key.to_s, value)
|
72
|
+
value += 1 unless value.nil?
|
73
|
+
value
|
74
|
+
end
|
75
|
+
|
76
|
+
def position_reverse(key, value)
|
77
|
+
value = client.zrevrank(key.to_s, value)
|
78
|
+
value += 1 unless value.nil?
|
79
|
+
value
|
80
|
+
end
|
81
|
+
|
82
|
+
def score(key, value)
|
83
|
+
client.zscore(key.to_s, value)
|
84
|
+
end
|
85
|
+
|
86
|
+
def count(key)
|
87
|
+
client.zcard(key.to_s)
|
88
|
+
end
|
89
|
+
|
90
|
+
def count_between(key, min, max)
|
91
|
+
client.zcount(key.to_s, min, max)
|
92
|
+
end
|
93
|
+
|
94
|
+
def create(key, *args)
|
95
|
+
client.zadd(key.to_s, args)
|
96
|
+
end
|
97
|
+
|
98
|
+
def create_intersection(key, keys, opts = {})
|
99
|
+
client.zinterstore(key.to_s, keys, **opts)
|
100
|
+
end
|
101
|
+
|
102
|
+
def create_combination(key, keys, opts = {})
|
103
|
+
client.zunionstore(key.to_s, keys, **opts)
|
104
|
+
end
|
105
|
+
|
106
|
+
def increment(key, value, count)
|
107
|
+
client.zincrby(key.to_s, count, value)
|
108
|
+
end
|
109
|
+
|
110
|
+
def decrement(key, value, count)
|
111
|
+
client.zincrby(key.to_s, -count.abs, value)
|
112
|
+
end
|
113
|
+
|
114
|
+
def destroy(key, at)
|
115
|
+
client.zrem(key.to_s, at)
|
116
|
+
end
|
117
|
+
|
118
|
+
def destroy_between(key, start, finish)
|
119
|
+
client.zremrangebyrank(key.to_s, start - 1, finish - 1)
|
120
|
+
end
|
121
|
+
|
122
|
+
def destroy_scores(key, min, max)
|
123
|
+
client.zremrangebyscore(key.to_s, min, max)
|
124
|
+
end
|
125
|
+
|
126
|
+
def destroy_lex(key, min, max, opts = {})
|
127
|
+
client.zrevrangebylex(key.to_s, max, min, **opts)
|
128
|
+
end
|
129
|
+
|
130
|
+
def scan(key, cursor, opts = {})
|
131
|
+
client.zscan(key.to_s, cursor, **opts)
|
132
|
+
end
|
9
133
|
|
10
134
|
end
|
11
135
|
end
|
data/lib/lite/redis/string.rb
CHANGED
@@ -2,10 +2,94 @@
|
|
2
2
|
|
3
3
|
module Lite
|
4
4
|
module Redis
|
5
|
-
class String <
|
5
|
+
class String < Base
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
def find(key)
|
8
|
+
client.get(key.to_s)
|
9
|
+
end
|
10
|
+
|
11
|
+
def find_each(*args)
|
12
|
+
args = stringify_keys(*args)
|
13
|
+
client.mget(args)
|
14
|
+
end
|
15
|
+
|
16
|
+
def length(key)
|
17
|
+
client.strlen(key.to_s)
|
18
|
+
end
|
19
|
+
|
20
|
+
def split(key, start, finish)
|
21
|
+
client.getrange(key.to_s, start, finish)
|
22
|
+
end
|
23
|
+
|
24
|
+
def create(key, value, opts = {})
|
25
|
+
client.set(key.to_s, value, **opts)
|
26
|
+
end
|
27
|
+
|
28
|
+
def create!(key, value)
|
29
|
+
client.setnx(key.to_s, value)
|
30
|
+
end
|
31
|
+
|
32
|
+
def create_each(*args)
|
33
|
+
args = stringify_keys(*args)
|
34
|
+
client.mset(args)
|
35
|
+
end
|
36
|
+
|
37
|
+
def create_each!(*args)
|
38
|
+
args = stringify_keys(*args)
|
39
|
+
client.msetnx(args)
|
40
|
+
end
|
41
|
+
|
42
|
+
def create_until(key, value, seconds, format = :seconds)
|
43
|
+
if seconds?(format)
|
44
|
+
client.setex(key.to_s, seconds, value)
|
45
|
+
else
|
46
|
+
client.psetex(key.to_s, seconds, value)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def append(key, value)
|
51
|
+
client.append(key.to_s, value)
|
52
|
+
end
|
53
|
+
|
54
|
+
def replace(key, value, offset)
|
55
|
+
client.setrange(key.to_s, offset, value)
|
56
|
+
end
|
57
|
+
|
58
|
+
def decrement(key, value = 1)
|
59
|
+
if value == 1
|
60
|
+
client.decr(key.to_s)
|
61
|
+
else
|
62
|
+
client.decrby(key.to_s, value)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
def increment(key, value = 1)
|
67
|
+
case value
|
68
|
+
when Float then client.incrbyfloat(key.to_s, value)
|
69
|
+
when 1 then client.incr(key.to_s)
|
70
|
+
else client.incrby(key.to_s, value)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def reset(key, value = 0)
|
75
|
+
client.getset(key.to_s, value)
|
76
|
+
end
|
77
|
+
|
78
|
+
def bit_count(key, start = 0, finish = -1)
|
79
|
+
client.bitcount(key.to_s, start, finish)
|
80
|
+
end
|
81
|
+
|
82
|
+
def bit_where(operation, key, *keys)
|
83
|
+
client.bitop(operation, key, *keys)
|
84
|
+
end
|
85
|
+
|
86
|
+
def get_bit(key, offset)
|
87
|
+
client.getbit(key.to_s, offset)
|
88
|
+
end
|
89
|
+
|
90
|
+
def set_bit(key, offset, bit)
|
91
|
+
client.setbit(key.to_s, offset, bit)
|
92
|
+
end
|
9
93
|
|
10
94
|
end
|
11
95
|
end
|
@@ -2,10 +2,27 @@
|
|
2
2
|
|
3
3
|
module Lite
|
4
4
|
module Redis
|
5
|
-
class Transaction <
|
5
|
+
class Transaction < Base
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
def discard
|
8
|
+
client.discard
|
9
|
+
end
|
10
|
+
|
11
|
+
def exec
|
12
|
+
client.exec
|
13
|
+
end
|
14
|
+
|
15
|
+
def multi(&block)
|
16
|
+
client.multi(&block)
|
17
|
+
end
|
18
|
+
|
19
|
+
def watch(*args)
|
20
|
+
client.watch(*args)
|
21
|
+
end
|
22
|
+
|
23
|
+
def unwatch
|
24
|
+
client.unwatch
|
25
|
+
end
|
9
26
|
|
10
27
|
end
|
11
28
|
end
|
data/lib/lite/redis/version.rb
CHANGED
data/lib/lite/redis.rb
CHANGED
@@ -1,35 +1,20 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "generators/lite/redis/install_generator" if defined?(Rails::Generators)
|
4
4
|
|
5
|
-
require
|
6
|
-
|
7
|
-
require
|
8
|
-
require
|
9
|
-
require
|
10
|
-
require
|
11
|
-
require
|
12
|
-
require
|
13
|
-
require
|
14
|
-
require
|
15
|
-
require
|
16
|
-
require
|
17
|
-
require
|
18
|
-
require
|
19
|
-
require
|
20
|
-
require
|
21
|
-
require 'lite/redis/helpers/string_helper'
|
22
|
-
require 'lite/redis/helpers/transaction_helper'
|
23
|
-
require 'lite/redis/base'
|
24
|
-
require 'lite/redis/connection'
|
25
|
-
require 'lite/redis/geo'
|
26
|
-
require 'lite/redis/hash'
|
27
|
-
require 'lite/redis/hyper_log_log'
|
28
|
-
require 'lite/redis/key'
|
29
|
-
require 'lite/redis/list'
|
30
|
-
require 'lite/redis/pub_sub'
|
31
|
-
require 'lite/redis/script'
|
32
|
-
require 'lite/redis/set'
|
33
|
-
require 'lite/redis/sorted_set'
|
34
|
-
require 'lite/redis/string'
|
35
|
-
require 'lite/redis/transaction'
|
5
|
+
require "lite/redis/railtie" if defined?(Rails::Railtie)
|
6
|
+
require "lite/redis/version"
|
7
|
+
require "lite/redis/configuration"
|
8
|
+
require "lite/redis/base"
|
9
|
+
require "lite/redis/connection"
|
10
|
+
require "lite/redis/geo"
|
11
|
+
require "lite/redis/hash"
|
12
|
+
require "lite/redis/hyper_log_log"
|
13
|
+
require "lite/redis/key"
|
14
|
+
require "lite/redis/list"
|
15
|
+
require "lite/redis/pub_sub"
|
16
|
+
require "lite/redis/script"
|
17
|
+
require "lite/redis/set"
|
18
|
+
require "lite/redis/sorted_set"
|
19
|
+
require "lite/redis/string"
|
20
|
+
require "lite/redis/transaction"
|
data/lib/tasks/redis.rake
CHANGED
@@ -2,30 +2,30 @@
|
|
2
2
|
|
3
3
|
namespace :db do
|
4
4
|
namespace :redis do
|
5
|
-
desc
|
5
|
+
desc "Reset Redis database"
|
6
6
|
task reset: :environment do
|
7
|
-
puts
|
7
|
+
puts "== Reset: reseting Redis ".ljust(80, "=")
|
8
8
|
total_task_start_time = Time.current
|
9
9
|
|
10
|
-
puts
|
10
|
+
puts " -> Resetting"
|
11
11
|
Lite::Redis::Connection.flush
|
12
12
|
|
13
13
|
total_task_elapsed_time = (Time.current - total_task_start_time).round(5)
|
14
|
-
puts "== Reset: reset Redis (#{total_task_elapsed_time}s) ".ljust(80,
|
15
|
-
puts
|
14
|
+
puts "== Reset: reset Redis (#{total_task_elapsed_time}s) ".ljust(80, "=")
|
15
|
+
puts ""
|
16
16
|
end
|
17
17
|
|
18
|
-
desc
|
18
|
+
desc "Reset all Redis databases"
|
19
19
|
task reset_all: :environment do
|
20
|
-
puts
|
20
|
+
puts "== Reset: reseting all Redis ".ljust(80, "=")
|
21
21
|
total_task_start_time = Time.current
|
22
22
|
|
23
|
-
puts
|
23
|
+
puts " -> Resetting"
|
24
24
|
Lite::Redis::Connection.flush_all
|
25
25
|
|
26
26
|
total_task_elapsed_time = (Time.current - total_task_start_time).round(5)
|
27
|
-
puts "== Reset: reset all Redis (#{total_task_elapsed_time}s) ".ljust(80,
|
28
|
-
puts
|
27
|
+
puts "== Reset: reset all Redis (#{total_task_elapsed_time}s) ".ljust(80, "=")
|
28
|
+
puts ""
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
data/lite-redis.gemspec
CHANGED
@@ -1,54 +1,48 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
lib = File.expand_path(
|
3
|
+
lib = File.expand_path("../lib", __FILE__)
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
require
|
5
|
+
require "lite/redis/version"
|
6
6
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
|
-
spec.name =
|
8
|
+
spec.name = "lite-redis"
|
9
9
|
spec.version = Lite::Redis::VERSION
|
10
|
-
spec.authors = [
|
10
|
+
spec.authors = ["Juan Gomez"]
|
11
11
|
spec.email = %w[j.gomez@drexed.com]
|
12
12
|
|
13
|
-
spec.summary =
|
14
|
-
spec.homepage =
|
15
|
-
spec.license =
|
13
|
+
spec.summary = "Access Redis with an ActiveRecord like ORM interface"
|
14
|
+
spec.homepage = "http://drexed.github.io/lite-redis"
|
15
|
+
spec.license = "MIT"
|
16
16
|
|
17
17
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
18
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
'source_code_uri' => 'https://github.com/drexed/lite-redis'
|
25
|
-
)
|
26
|
-
else
|
27
|
-
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
28
|
-
'public gem pushes.'
|
29
|
-
end
|
19
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
20
|
+
spec.metadata["changelog_uri"] = "https://github.com/drexed/lite-redis/blob/master/CHANGELOG.md"
|
21
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
22
|
+
spec.metadata["rubygems_mfa_required"] = "true"
|
23
|
+
spec.metadata["source_code_uri"] = "https://github.com/drexed/lite-redis"
|
30
24
|
|
31
25
|
# Specify which files should be added to the gem when it is released.
|
32
26
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
33
|
-
spec.files = Dir.chdir(File.expand_path(
|
27
|
+
spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
|
34
28
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
35
29
|
end
|
36
|
-
spec.bindir =
|
30
|
+
spec.bindir = "exe"
|
37
31
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
38
32
|
spec.require_paths = %w[lib]
|
39
33
|
|
40
|
-
spec.add_runtime_dependency
|
34
|
+
spec.add_runtime_dependency "redis"
|
41
35
|
|
42
|
-
spec.add_development_dependency
|
43
|
-
spec.add_development_dependency
|
44
|
-
spec.add_development_dependency
|
45
|
-
spec.add_development_dependency
|
46
|
-
spec.add_development_dependency
|
47
|
-
spec.add_development_dependency
|
48
|
-
spec.add_development_dependency
|
49
|
-
spec.add_development_dependency
|
50
|
-
spec.add_development_dependency
|
51
|
-
spec.add_development_dependency
|
52
|
-
spec.add_development_dependency
|
53
|
-
spec.add_development_dependency
|
36
|
+
spec.add_development_dependency "bundler"
|
37
|
+
spec.add_development_dependency "connection_pool"
|
38
|
+
spec.add_development_dependency "fakeredis"
|
39
|
+
spec.add_development_dependency "fasterer"
|
40
|
+
spec.add_development_dependency "generator_spec"
|
41
|
+
spec.add_development_dependency "rake"
|
42
|
+
spec.add_development_dependency "rspec"
|
43
|
+
spec.add_development_dependency "rspec-rails"
|
44
|
+
spec.add_development_dependency "rubocop"
|
45
|
+
spec.add_development_dependency "rubocop-performance"
|
46
|
+
spec.add_development_dependency "rubocop-rake"
|
47
|
+
spec.add_development_dependency "rubocop-rspec"
|
54
48
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lite-redis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Gomez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|
@@ -234,19 +234,6 @@ files:
|
|
234
234
|
- lib/lite/redis/connection.rb
|
235
235
|
- lib/lite/redis/geo.rb
|
236
236
|
- lib/lite/redis/hash.rb
|
237
|
-
- lib/lite/redis/helpers/base_helper.rb
|
238
|
-
- lib/lite/redis/helpers/connection_helper.rb
|
239
|
-
- lib/lite/redis/helpers/geo_helper.rb
|
240
|
-
- lib/lite/redis/helpers/hash_helper.rb
|
241
|
-
- lib/lite/redis/helpers/hyper_log_log_helper.rb
|
242
|
-
- lib/lite/redis/helpers/key_helper.rb
|
243
|
-
- lib/lite/redis/helpers/list_helper.rb
|
244
|
-
- lib/lite/redis/helpers/pub_sub_helper.rb
|
245
|
-
- lib/lite/redis/helpers/script_helper.rb
|
246
|
-
- lib/lite/redis/helpers/set_helper.rb
|
247
|
-
- lib/lite/redis/helpers/sorted_set_helper.rb
|
248
|
-
- lib/lite/redis/helpers/string_helper.rb
|
249
|
-
- lib/lite/redis/helpers/transaction_helper.rb
|
250
237
|
- lib/lite/redis/hyper_log_log.rb
|
251
238
|
- lib/lite/redis/key.rb
|
252
239
|
- lib/lite/redis/list.rb
|
@@ -263,7 +250,12 @@ files:
|
|
263
250
|
homepage: http://drexed.github.io/lite-redis
|
264
251
|
licenses:
|
265
252
|
- MIT
|
266
|
-
metadata:
|
253
|
+
metadata:
|
254
|
+
allowed_push_host: https://rubygems.org
|
255
|
+
changelog_uri: https://github.com/drexed/lite-redis/blob/master/CHANGELOG.md
|
256
|
+
homepage_uri: http://drexed.github.io/lite-redis
|
257
|
+
rubygems_mfa_required: 'true'
|
258
|
+
source_code_uri: https://github.com/drexed/lite-redis
|
267
259
|
post_install_message:
|
268
260
|
rdoc_options: []
|
269
261
|
require_paths:
|
@@ -279,7 +271,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
279
271
|
- !ruby/object:Gem::Version
|
280
272
|
version: '0'
|
281
273
|
requirements: []
|
282
|
-
rubygems_version: 3.
|
274
|
+
rubygems_version: 3.3.26
|
283
275
|
signing_key:
|
284
276
|
specification_version: 4
|
285
277
|
summary: Access Redis with an ActiveRecord like ORM interface
|
@@ -1,41 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Lite
|
4
|
-
module Redis
|
5
|
-
module BaseHelper
|
6
|
-
|
7
|
-
attr_writer :client
|
8
|
-
|
9
|
-
def initialize(redis = nil)
|
10
|
-
@client = redis
|
11
|
-
end
|
12
|
-
|
13
|
-
def client
|
14
|
-
@client ||= Lite::Redis.configuration.client
|
15
|
-
end
|
16
|
-
|
17
|
-
private
|
18
|
-
|
19
|
-
def append?(order)
|
20
|
-
order.to_s == 'append'
|
21
|
-
end
|
22
|
-
|
23
|
-
def milliseconds?(format)
|
24
|
-
format.to_s == 'milliseconds'
|
25
|
-
end
|
26
|
-
|
27
|
-
def prepend?(order)
|
28
|
-
order.to_s == 'prepend'
|
29
|
-
end
|
30
|
-
|
31
|
-
def seconds?(format)
|
32
|
-
format.to_s == 'seconds'
|
33
|
-
end
|
34
|
-
|
35
|
-
def stringify_keys(*keys)
|
36
|
-
keys.map { |key, _| key.to_s }
|
37
|
-
end
|
38
|
-
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|