Permalink
Browse files

Prefer REDIS_URL, get rid of deprecation warnings.

  • Loading branch information...
1 parent 2cefd35 commit 3acc1bccea298f290161781d600c1179e23302d7 Felix Holmgren committed Nov 21, 2013
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/heroku/command/redis_console.rb
@@ -1,13 +1,13 @@
require 'uri'
-class Heroku::Command::Redis < Heroku::Command::Base
+class Heroku::Command::Redis < Heroku::Command::BaseWithApp
def cli(*queries)
- # Must remember to extract these so they don't get passed to redis-cli
- db = extract_option("--db") || 'REDISTOGO_URL'
- app = extract_app
+ db_env_key = extract_option("--db") || 'REDIS_URL'
+ config_vars = api.get_config_vars(app).body
+
+ redis_url = config_vars[db_env_key]
+ return puts "No such redis (#{db_env_key}), try setting --db REDIS_URL." unless redis_url
- redis_url = heroku.config_vars(app)[db]
- return puts "No such redis (#{db}), try setting --db REDIS_URL." unless redis_url
uri = URI.parse(redis_url)
cmd = ["redis-cli"]

0 comments on commit 3acc1bc

Please sign in to comment.