redis_object 1.4.5 → 1.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/redis_object/base.rb +15 -2
- data/lib/redis_object/version.rb +1 -1
- data/spec/base_spec.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjUwNzhkOGUyMjk3Njc5MTA4OGI2MmJmYmM2YjZiNmUwNGYyNTAwYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OWQzMGVkOTRiNmIxMzMyNGVmYTEwYTcyNTNiYzNkZjE4ZTYyZWU4NA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZmY1OTNkNjc0YTZkYzVlNTdhNGU3YTE2ZmE0MTIwOTVlMjdjNWYxMjQ4YTZh
|
10
|
+
NTc3ZmVkNmRjMDkwYTgyYTI5NTFkNGY4YTNlYmVlZjAyYzg5ZjdkNmRiZWY5
|
11
|
+
ZWIxMmI2ODgwZTRkOTMwNWQxY2M4NGRiYTJlYWFmZjlhODEzZTU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NGViMjUzNWIxZjYxZWUzYjU3NGY0MzEwNjkyMmRmNWU5NWI3ZGUwZWFjY2Mw
|
14
|
+
YWEyZjAzZGU3MjExNGY2ZDBjNDUxZDY2ZmYxYWY4MmVhNTFjYjA5NjMxMzgy
|
15
|
+
OTQ2ZGUwODZhNDYxNDliMzM3MmI5ZDhhYjY0ZDk2N2JmNWJiZmY=
|
data/lib/redis_object/base.rb
CHANGED
@@ -289,7 +289,12 @@ module Seabright
|
|
289
289
|
if val then
|
290
290
|
if ARGV[2]:find('^pattern:') then
|
291
291
|
pattern = ARGV[2]:gsub('^pattern:','')
|
292
|
-
if val:match(pattern)
|
292
|
+
if val:match(pattern) then
|
293
|
+
table.insert(out,itms[i])
|
294
|
+
end
|
295
|
+
elseif ARGV[2]:find('^ipattern:') then
|
296
|
+
pattern = ARGV[2]:gsub('^ipattern:',''):lower()
|
297
|
+
if val:lower():match(pattern) then
|
293
298
|
table.insert(out,itms[i])
|
294
299
|
end
|
295
300
|
else
|
@@ -336,6 +341,14 @@ module Seabright
|
|
336
341
|
good = false
|
337
342
|
break
|
338
343
|
end
|
344
|
+
elseif matchers[n][2]:find('^ipattern:') then
|
345
|
+
pattern = matchers[n][2]:gsub('^ipattern:',''):lower()
|
346
|
+
if val:lower():match(pattern) then
|
347
|
+
good = good
|
348
|
+
else
|
349
|
+
good = false
|
350
|
+
break
|
351
|
+
end
|
339
352
|
else
|
340
353
|
if val ~= matchers[n][2] then
|
341
354
|
good = false
|
@@ -378,7 +391,7 @@ module Seabright
|
|
378
391
|
end
|
379
392
|
|
380
393
|
def convert_regex_to_lua(reg)
|
381
|
-
"pattern:#{reg.source.gsub("\\","")}"
|
394
|
+
"#{reg.casefold? ? "i" : ""}pattern:#{reg.source.gsub("\\","")}"
|
382
395
|
end
|
383
396
|
|
384
397
|
def grab(ident)
|
data/lib/redis_object/version.rb
CHANGED
data/spec/base_spec.rb
CHANGED
@@ -48,6 +48,14 @@ describe RedisObject do
|
|
48
48
|
obj.first.should_not be_nil
|
49
49
|
obj = ObjectTests::User.find(user_id: /test/)
|
50
50
|
obj.first.should_not be_nil
|
51
|
+
obj = ObjectTests::User.find(user_id: /Test/i)
|
52
|
+
obj.first.should_not be_nil
|
53
|
+
obj = ObjectTests::User.find(user_id: /Test/)
|
54
|
+
obj.first.should be_nil
|
55
|
+
obj = ObjectTests::User.find(user_id: /Test/i, blah: nil)
|
56
|
+
obj.first.should_not be_nil
|
57
|
+
obj = ObjectTests::User.find(user_id: /Test/, blah: nil)
|
58
|
+
obj.first.should be_nil
|
51
59
|
end
|
52
60
|
|
53
61
|
it "should be found by nil matchers" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redis_object
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Bragg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: utf8_utils
|