Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 16 additions and 7 deletions.
  1. +12 −1 init.rb
  2. +4 −6 lib/{ → heroku/command}/redis_console.rb
View
13 init.rb
@@ -1,4 +1,15 @@
-require File.dirname(__FILE__) + '/lib/redis_console.rb'
+require 'lib/heroku/command/redis_console'
+
+begin
+ require "heroku-api"
+rescue LoadError
+ puts <<-MSG
+ heroku-config - requires the heroku-api gem. Please install:
+
+ gem install heroku-api
+ MSG
+ exit
+end
Heroku::Command::Help.group('Redis Console') do |group|
group.command 'redis:cli [--db REDIS_URL] *args', 'Open a redis-cli shell to the database'
View
10 lib/redis_console.rb → lib/heroku/command/redis_console.rb
@@ -2,12 +2,10 @@
class Heroku::Command::Redis < Heroku::Command::Base
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
-
- redis_url = heroku.config_vars(app)[db]
- return puts "No such redis (#{db}), try setting --db REDIS_URL." unless redis_url
+ db_env_key = extract_option("--db") | 'REDIS_URL'
+ config_vars = heroku.get_config_vars
+ redis_url = config_vars(app)[db_env_key]
+ return puts "No such redis (#{db_env_key}), try setting --db REDIS_URL." unless redis_url
uri = URI.parse(redis_url)
cmd = ["redis-cli"]

No commit comments for this range

Something went wrong with that request. Please try again.