I'd actually recommend checking out the heroku-api gem for programatic
access. You can cover your example then this way:
require "heroku-api"
api = Heroku::API.new(:api_key => XXX)
api.get_convig_vars("my-app").body
That said, I'm not sure what the best answer is on the default app front.
Could you describe how you intend to use this information? I think that
might help me narrow down a recommendation and/or fix it up to make it
easier to do what you need.
Thanks!
wes
On Tuesday, May 1, 2012 5:48:22 PM UTC-5, dB. wrote:
>
> I'm trying to replace some code in a Rake task that executes 'heroku
> config --long' and parses the output.
>
> I can do this:
>
> c = Heroku::Client.new(* Heroku::Auth.read_credentials)
> c.config_vars("my-app")
>
> Awesome, this returns the configuration variables for my-app as a Hash.
>
> The next problem is how to figure out the default app name - in
> development environments we often want to have our tasks run against our
> "default" development Heroku instance. The code I want to call is in
> lib/heroku/command/base.rb, extract_app_in_dir(Dir.pwd). There's quite a
> bit of logic underneath this, storing git remotes and what not.
>
> 1. Do you think this should be refactored so that one can call
> extract_app_in_dir without an instance of a class?
> 2. Is there a simple(r) way to get the default app name?
>
> Thanks,
> dB.
>
> --
>
> dB. | Moscow - Geneva - Seattle - New York
> dblock.org <http://www.dblock.org> -
> @dblockdotorg<http://twitter.com/#!/dblockdotorg>
>
>
--
You received this message because you are subscribed to the Google
Groups "Heroku" group.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/heroku?hl=en_US?hl=en