try-redis.rb
#see the logging for development mode
see the logging for development mode
see the logging for development mode
def execute_redis(argv)
    argv = namespace_input(namespace, *argv)
    raise "I'm sorry, I don't recognize that command.  #{help}" unless argv.kind_of? Array
    redis = Redis.new(:logger => Logger.new(File.join(File.dirname(__FILE__),'log','redis.log')))
    if result = bypass(redis, argv)
      result
    else
      result = redis.send(*argv)
      denamespace_output namespace, argv.first, result
    end
  ensure
    begin
      redis.quit
    rescue Exception => e
      STDERR.puts e.message
      e.backtrace.each {|bt| STDERR.puts bt}
    end
  end
def execute_redis ( argv ) argv = namespace_input ( namespace , * argv ) raise "I'm sorry, I don't recognize that command.  #{help}" unless argv . kind_of? Array redis = Redis . new ( :logger => Logger . new ( File . join ( File . dirname ( __FILE__ ) , 'log' , 'redis.log' ) ) ) if result = bypass ( redis , argv ) result else result = redis . send ( * argv ) denamespace_output namespace , argv . first , result end ensure begin redis . quit rescue Exception => e STDERR . puts e . message e . backtrace . each { | bt | STDERR . puts bt } end end
see the logging for development mode
see the logging for development mode
# Apply the current namespace to any fields that need it. # Issue the default help text if the command was not recognized. # Connect to the Redis server. # Send the command to Redis. # Remove the namespace from any commands that return a key. # Disconnect from the server.
argv