Thanks for the great feedback and sharing code to help others who might be 
encountering this. Prioritization is always tricky and this is one of those 
things that has been on our radar but hasn't quite topped the list yet. 
Hopefully we'll be able to move toward a better solution from the server 
end to make this cleaner and provide for detached processes soon, but as 
per Keith no promises.

Kind of an aside, but a couple other things you might check out in case you 
were unaware of them:

For direct interactions I would probably recommend the heroku-api gem 
instead of Heroku::Client, see: https://github.com/heroku/heroku.rb. 
Although I think it may have the same credentials issue you mentioned. I 
think that can be gotten around using the netrc gem (which is what the 
toolbelt does internally also). Happy to provide details if you need them. 

>From there I think you can also use the rendezvous gem to connect to a 
process and stream stuff if needed (this mimics the attached behavior). 
There may be some pieces missing from one/both, but they may help fill in 
some gaps compared to the client as they were written for outside 
programmatic usage (whereas Client is mostly used by the toolbelt).

On Monday, February 4, 2013 9:05:29 AM UTC-6, dB. wrote:
>
> Thanks Keith. In the related realm, the exit code of a run:detached is 
> something one should be able to retrieve, as well as knowing whether that 
> process finished or not, in a reliable way.
>
> On Sat, Feb 2, 2013 at 11:04 PM, Keith Rarick <k...@heroku.com<javascript:>
> > wrote:
>
>> FWIW, I think exit code definitely belongs in the Heroku API.
>> That's a longstanding known deficiency. I hope we can fix it
>> soon, but can't make any promises.
>>
>> On Sat, Feb 2, 2013 at 9:35 PM, Daniel Doubrovkine 
>> <dbl...@dblock.org<javascript:>> 
>> wrote:
>> > I published heroku-commander (
>> https://github.com/dblock/heroku-commander)
>> > that wraps `heroku config -s` among other things. I still think this gem
>> > shouldn't exist and the functionality rolled into the heroku-client -
>> > @geemus, you might want to give this some thought. For the exit code 
>> part it
>> > would require cooperation from the server-side, but for the client-side
>> > credentials, not so much.
>> >
>> > cheers
>> > dB.
>> >
>> >
>> > On Thu, Dec 27, 2012 at 2:23 PM, Daniel Doubrovkine 
>> > <dbl...@dblock.org<javascript:>
>> >
>> > wrote:
>> >>
>> >> Indeed, maybe this does belong in a gem. Either way one wants to be 
>> able
>> >> to do programmatically everything that the `heroku` command does 
>> without
>> >> having to call it.
>> >>
>> >>
>> >> On Thu, Dec 27, 2012 at 1:53 PM, geemus <wes...@heroku.com<javascript:>> 
>> wrote:
>> >>>
>> >>> I think Daniels approach is the easiest currently (thanks dB!). 
>> Perhaps
>> >>> we should create a gem for doing looking up the implied app as I'm 
>> reticent
>> >>> to say it belong in heroku-api.
>> >>>
>> >>> As for config you should be able to use the netrc gem and read the
>> >>> credentials for 'api.heroku.com' in order to get them.
>> >>>
>> >>> Hope that helps.
>> >>>
>> >>>
>> >>> On Tuesday, December 25, 2012 8:12:01 AM UTC-6, dB. wrote:
>> >>>>
>> >>>> We've asked a similar question a while ago, and the best we could 
>> come
>> >>>> up with is a hack to run `heroku config -s`.
>> >>>>
>> >>>> config = {}
>> >>>> config_output = `heroku config -s#{app_param}`.chomp
>> >>>>
>> >>>>
>> >>>> if ($?.to_i != 0)
>> >>>>
>> >>>>
>> >>>>   raise "error running heroku config: #{$?}"
>> >>>>
>> >>>>
>> >>>>   $stderr.puts config_output
>> >>>>
>> >>>>
>> >>>> end
>> >>>> config_output.each_line do |line|
>> >>>>
>> >>>>
>> >>>>   parts = line.split("=", 2)
>> >>>>
>> >>>>
>> >>>>   raise "invalid line #{line}" if (parts.size != 2)
>> >>>>
>> >>>>
>> >>>>   config[parts[0].strip] = parts[1].strip
>> >>>>
>> >>>>
>> >>>> end
>> >>>> config
>> >>>>
>> >>>>
>> >>>> On Mon, Dec 24, 2012 at 9:42 PM, Francois <fha...@gmail.com> wrote:
>> >>>>>
>> >>>>> hi,
>> >>>>>  i wrote a gem a year or so ago that adds some rake tasks to a
>> >>>>> RefineryCMS rails project (
>> https://github.com/rounders/refinerycms-s3assets)
>> >>>>> . The rake tasks are meant to be run in development and they are 
>> for copying
>> >>>>> production s3 assets to development.
>> >>>>>
>> >>>>> Using the heroku gem, my gem reads the s3-related heroku config 
>> vars in
>> >>>>> order to determine which s3 bucket to fetch the assets from and 
>> which s3
>> >>>>> credentials to use. Specifically the config vars are obtained as 
>> follows:
>> >>>>>
>> >>>>>  base = Heroku::Command::BaseWithApp.new
>> >>>>>  config_vars = base.heroku.config_vars(base.app)
>> >>>>>
>> >>>>> It is my understanding that the heroku gem should no longer be used 
>> and
>> >>>>> that we should instead use the heroku-api gem. But as far as I can 
>> tell the
>> >>>>> heroku-api gem does not automatically handle figuring out the 
>> current heroku
>> >>>>> app as the heroku gem does. And there is also the issue of 
>> authentication,
>> >>>>> though that one isn't as much of an issue since I can ask users to 
>> set their
>> >>>>> HEROKU_API_KEY environment variable.
>> >>>>>
>> >>>>> Is there a recommended way to obtain the config vars of an app via a
>> >>>>> rake task without asking the user to hard code or specify the name 
>> of their
>> >>>>> heroku app without using the heroku gem?
>> >>>>>
>> >>>>> - Thanks,
>> >>>>> Francois
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> --
>> >>>>> You received this message because you are subscribed to the Google
>> >>>>> Groups "Heroku" group.
>> >>>>>
>> >>>>> To unsubscribe from this group, send email to
>> >>>>> heroku+un...@googlegroups.com
>> >>>>>
>> >>>>> For more options, visit this group at
>> >>>>> http://groups.google.com/group/heroku?hl=en_US?hl=en
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>> --
>> >>>>
>> >>>> dB. | Moscow - Geneva - Seattle - New York
>> >>>> dblock.org - @dblockdotorg
>> >>>
>> >>> --
>> >>> You received this message because you are subscribed to the Google
>> >>> Groups "Heroku" group.
>> >>>
>> >>> To unsubscribe from this group, send email to
>> >>> heroku+un...@googlegroups.com <javascript:>
>> >>> For more options, visit this group at
>> >>> http://groups.google.com/group/heroku?hl=en_US?hl=en
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >>
>> >> dB. | Moscow - Geneva - Seattle - New York
>> >> dblock.org - @dblockdotorg
>> >
>> >
>> >
>> >
>> > --
>> >
>> > dB. | Moscow - Geneva - Seattle - New York
>> > dblock.org - @dblockdotorg
>> >
>> > --
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Heroku" group.
>> >
>> > To unsubscribe from this group, send email to
>> > heroku+un...@googlegroups.com <javascript:>
>> > For more options, visit this group at
>> > http://groups.google.com/group/heroku?hl=en_US?hl=en
>> >
>> > ---
>> > You received this message because you are subscribed to the Google 
>> Groups
>> > "Heroku Community" group.
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> an
>> > email to heroku+un...@googlegroups.com <javascript:>.
>> > For more options, visit https://groups.google.com/groups/opt_out.
>> >
>> >
>>
>> --
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Heroku" group.
>>
>> To unsubscribe from this group, send email to
>> heroku+un...@googlegroups.com <javascript:>
>> For more options, visit this group at
>> http://groups.google.com/group/heroku?hl=en_US?hl=en
>>
>> ---
>> You received this message because you are subscribed to the Google Groups 
>> "Heroku Community" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to heroku+un...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
> -- 
>
> 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
heroku+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/heroku?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"Heroku Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to heroku+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to