From 684239979c4b4269e499decc744e9d6a6b06caad Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Fri, 24 Jan 2020 17:37:03 +0100 Subject: [PATCH] don't export Redis by default * use EXPORT_GLOBAL to control behaviour fix #68 --- src/redis.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/redis.lua b/src/redis.lua index 98b4710..fcd6da3 100644 --- a/src/redis.lua +++ b/src/redis.lua @@ -4,10 +4,12 @@ local redis = { _COPYRIGHT = 'Copyright (C) 2009-2012 Daniele Alessandri', } --- The following line is used for backwards compatibility in order to keep the `Redis` --- global module name. Using `Redis` is now deprecated so you should explicitly assign --- the module to a local variable when requiring it: `local redis = require('redis')`. -Redis = redis +if EXPORT_GLOBAL then + -- The following line is used for backwards compatibility in order to keep the `Redis` + -- global module name. Using `Redis` is now deprecated so you should explicitly assign + -- the module to a local variable when requiring it: `local redis = require('redis')`. + Redis = redis +end local unpack = _G.unpack or table.unpack local network, request, response = {}, {}, {}