examples/redis/namespaced.rb in flipper-redis-0.20.4 vs examples/redis/namespaced.rb in flipper-redis-0.21.0.rc1
- old
+ new
@@ -1,19 +1,8 @@
-require 'pp'
-require 'pathname'
-require 'logger'
-begin
- require 'redis-namespace'
-rescue LoadError
- puts 'you must have redis-namespace gem installed'
- exit 1
-end
-
-root_path = Pathname(__FILE__).dirname.join('..').expand_path
-lib_path = root_path.join('lib')
-$:.unshift(lib_path)
-
+require 'bundler/setup'
+require 'redis-namespace'
require 'flipper/adapters/redis'
+
options = {url: 'redis://127.0.0.1:6379'}
if ENV['REDIS_URL']
options[:url] = ENV['REDIS_URL']
end
client = Redis.new(options)