Created
          April 3, 2011 19:04 
        
      - 
      
- 
        Save agladysh/900681 to your computer and use it in GitHub Desktop. 
    Redis keys are not escaped
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | pcall(require, 'luarocks.require') | |
| local sidereal = require 'sidereal' -- sudo luarocks install sidereal --from=http://luarocks.org/repositories/rocks-cvs | |
| -------------------------------------------------------------------------------- | |
| -- Some value printing code | |
| -------------------------------------------------------------------------------- | |
| require 'lua-nucleo.module' -- sudo luarocks install lua-nucleo | |
| require 'lua-nucleo.strict' | |
| local tstr = import 'lua-nucleo/tstr.lua' { 'tstr' } -- Lua value to string | |
| local N = 1 | |
| local P = function(...) print(N .. ":", tstr(assert(...))); N = N + 1 end | |
| -------------------------------------------------------------------------------- | |
| -- Connect to Redis | |
| -------------------------------------------------------------------------------- | |
| local R = assert(sidereal.connect("localhost", 6379)) | |
| -------------------------------------------------------------------------------- | |
| -- This should not fail | |
| -------------------------------------------------------------------------------- | |
| P (R:exists("yada yada")) | |
| --[[ | |
| lua: check_keys_escaped.lua:15: wrong number of arguments for 'exists' command | |
| stack traceback: | |
| [C]: in function 'assert' | |
| check_keys_escaped.lua:15: in function 'P' | |
| check_keys_escaped.lua:27: in main chunk | |
| [C]: ? | |
| --]] | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment