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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZmEzMTFmMmU3MTcyZDllYzYwYjQ0YzM5ZGE1ZGQ4NjI5MDI2MjVmYw==
4
+ YjUwNzhkOGUyMjk3Njc5MTA4OGI2MmJmYmM2YjZiNmUwNGYyNTAwYQ==
5
5
  data.tar.gz: !binary |-
6
- YTMzYTdjZDg4ZWIzNDE1ODliYTY0N2I5YTYwYTQ5ZGUyNjY5MjFhOQ==
6
+ OWQzMGVkOTRiNmIxMzMyNGVmYTEwYTcyNTNiYzNkZjE4ZTYyZWU4NA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NzdkNzFlNjc4OWM3ZWVhMmI2YzBjMWZiMDhhMmZjNjliOWI2NzhhNDZiOThl
10
- NWYzYzhiMzJiYzE4MTdlMjZiZWU3MDBhMzk4NDBiOTdlM2Y4MTgzMmI1Mzk5
11
- Njk0YjRhZmJiMWEzYjk3YWNmYjQwYmJhNTUyNzdmOWI1ZDdhYmI=
9
+ ZmY1OTNkNjc0YTZkYzVlNTdhNGU3YTE2ZmE0MTIwOTVlMjdjNWYxMjQ4YTZh
10
+ NTc3ZmVkNmRjMDkwYTgyYTI5NTFkNGY4YTNlYmVlZjAyYzg5ZjdkNmRiZWY5
11
+ ZWIxMmI2ODgwZTRkOTMwNWQxY2M4NGRiYTJlYWFmZjlhODEzZTU=
12
12
  data.tar.gz: !binary |-
13
- MzViYzViZDBjOTFlOTVkZmVkZjg2ZTFmNWJkM2ZmY2I2NjUwMzhmNjI3MzYz
14
- M2Q2OTllODgwZGUwZWM1ZTFmYTc3Yjg5ZWRmNTJjYzQ4MjA2ZTJmOTk1ZjI3
15
- ZWVkNDk0NmMxYmE4YWYwM2VjY2ZlYjhlOTMxMGJlZmY4NjAzYTI=
13
+ NGViMjUzNWIxZjYxZWUzYjU3NGY0MzEwNjkyMmRmNWU5NWI3ZGUwZWFjY2Mw
14
+ YWEyZjAzZGU3MjExNGY2ZDBjNDUxZDY2ZmYxYWY4MmVhNTFjYjA5NjMxMzgy
15
+ OTQ2ZGUwODZhNDYxNDliMzM3MmI5ZDhhYjY0ZDk2N2JmNWJiZmY=
@@ -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) ~= nil then
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)
@@ -1,5 +1,5 @@
1
1
  module Seabright
2
2
  class RedisObject
3
- VERSION = "1.4.5"
3
+ VERSION = "1.4.6"
4
4
  end
5
5
  end
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.5
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-20 00:00:00.000000000 Z
11
+ date: 2013-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: utf8_utils