redis_object
Advanced tools
@@ -292,5 +292,10 @@ module Seabright | ||
| pattern = ARGV[2]:gsub('^pattern:','') | ||
| if val:match(pattern) ~= nil then | ||
| if val:match(pattern) then | ||
| table.insert(out,itms[i]) | ||
| end | ||
| elseif ARGV[2]:find('^ipattern:') then | ||
| pattern = ARGV[2]:gsub('^ipattern:',''):lower() | ||
| if val:lower():match(pattern) then | ||
| table.insert(out,itms[i]) | ||
| end | ||
| else | ||
@@ -340,2 +345,10 @@ if val == ARGV[2] then | ||
| end | ||
| elseif matchers[n][2]:find('^ipattern:') then | ||
| pattern = matchers[n][2]:gsub('^ipattern:',''):lower() | ||
| if val:lower():match(pattern) then | ||
| good = good | ||
| else | ||
| good = false | ||
| break | ||
| end | ||
| else | ||
@@ -383,3 +396,3 @@ if val ~= matchers[n][2] then | ||
| def convert_regex_to_lua(reg) | ||
| "pattern:#{reg.source.gsub("\\","")}" | ||
| "#{reg.casefold? ? "i" : ""}pattern:#{reg.source.gsub("\\","")}" | ||
| end | ||
@@ -386,0 +399,0 @@ |
| module Seabright | ||
| class RedisObject | ||
| VERSION = "1.4.5" | ||
| VERSION = "1.4.6" | ||
| end | ||
| end |
@@ -51,2 +51,10 @@ require File.dirname(__FILE__) + '/spec_helper' | ||
| obj.first.should_not be_nil | ||
| obj = ObjectTests::User.find(user_id: /Test/i) | ||
| obj.first.should_not be_nil | ||
| obj = ObjectTests::User.find(user_id: /Test/) | ||
| obj.first.should be_nil | ||
| obj = ObjectTests::User.find(user_id: /Test/i, blah: nil) | ||
| obj.first.should_not be_nil | ||
| obj = ObjectTests::User.find(user_id: /Test/, blah: nil) | ||
| obj.first.should be_nil | ||
| end | ||
@@ -53,0 +61,0 @@ |