switch the list method to index method for new heroku cli, This resolves #4 #6

Open
wants to merge 1 commit into
from

Projects

None yet

5 participants

@jwang
jwang commented May 19, 2011

The newer version of heroku's gem 2.x moved the :list method to :index and is now called via heroku plugins instead of heroku plugins:list

When attempting to install herocutter, we get an error message of:
Could not initialize heroku_herocutter: undefined method list' for classHeroku::Command::Plugins'

This patch resolves that issue, which is currently documented as #4.

@develop7

@hone any plans to merge this?

@studgeek

Yes, please merge. Took me a while to find this....

@studgeek

I'll add, even though I now have jwang's herocutter installed I can't install plugins like the following
$ heroku plugins:install colorize_console ! Could not install colorize_console. Please check the URL and try again

@aseemk
aseemk commented Apr 20, 2012

+1...

@steakknife

+1

@steakknife

Almost works with the current production heroku gem:

~ ᐅ rm -rf ~/.heroku
~ ᐅ gem uninstall -Iax heroku heroku-api netrc excon addressable >/dev/null
~ ᐅ /usr/bin/which -s heroku || echo heroku uninstalled
heroku uninstalled
~ ᐅ gem install heroku >/dev/null && gem list | grep 'heroku ' && /usr/bin/which heroku | sed "s%${GEM_HOME}%\$GEM_HOME%;s%$% (heroku is installed)%"
heroku (2.31.2)
$GEM_HOME/bin/heroku (heroku is installed)
~ ᐅ heroku plugins:install git://github.com/jwang/heroku_herocutter.git                 
Installing heroku_herocutter... done
~cd ~/.heroku/plugins/heroku_herocutter
~/.heroku/plugins/heroku_herocutter (master ✔) ᐅ git remote add jwang git://github.com/jwang/heroku_herocutter.git
~/.heroku/plugins/heroku_herocutter (master ✔) ᐅ git pull jwang fix_list_command:fix_list_command 
~/.heroku/plugins/heroku_herocutter (master ✔) ᐅ git checkout fix_list_command
~/.heroku/plugins/heroku_herocutter (fix_list_command ✔) ᐅ git diff head~1 | grep '+.*alias'
+    alias_method :list_without_herocutter, :index
+    alias_method :index, :list_with_herocutter
~/.heroku/plugins/heroku_herocutter (fix_list_command ✔) ᐅ cd
~ ᐅ heroku plugins:install heroku-accounts 
Installing heroku-accounts... failed
 !    Could not install heroku-accounts. Please check the URL and try again
~ ᐅ heroku plugins:install_with_herocutter heroku-accounts
Installing heroku-accounts... failed
 !    Could not install heroku-accounts. Please check the URL and try again
~ ᐅ heroku plugins:install git://github.com/ddollar/heroku-accounts.git
Installing heroku-accounts... done
~

Same behavior with heroku_herocutter jwang fork @ master at present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment