Permalink
Browse files

Upgrade to use the Heroku API

* This eliminates the various 'DEPRECATED' notices caused by using the Heroku::Client with recent versions of the Heroku gem
* Fixes issue #3
  • Loading branch information...
1 parent 63cfc78 commit 83a53f342542adb048970dd923208773668b381a @nicholasjhenry nicholasjhenry committed Sep 28, 2012
Showing with 14 additions and 4 deletions.
  1. +12 −0 init.rb
  2. +2 −4 lib/config/heroku/command/config.rb
View
12 init.rb
@@ -1 +1,13 @@
require "config/heroku/command/config"
+
+begin
+ require "heroku-api"
+rescue LoadError
+ puts <<-MSG
+ This plugin is not compatiable with the version of Heroku CLI installed. If
+ you have installed the Heroku gem, please upgrade with the following command:
+
+ gem update heroku
+ MSG
+ exit
+end
@@ -52,7 +52,7 @@ def local_config
end
def remote_config
- heroku.config_vars(app)
+ api.get_config_vars(app).body
end
def write_local_config(config)
@@ -64,14 +64,12 @@ def write_local_config(config)
end
def write_remote_config(config)
- remote_config = heroku.config_vars(app)
-
add_config_vars = config.inject({}) do |hash, (key,val)|
hash[key] = val unless remote_config[key] == val
hash
end
- heroku.add_config_vars(app, add_config_vars)
+ api.put_config_vars(app, add_config_vars)
end
def merge_config(source, target, interactive=false, overwrite=false)

0 comments on commit 83a53f3

Please sign in to comment.