Hugh Sasse wrote:
On Fri, 14 Nov 2008, Vassilis Rizopoulos wrote:
_why wrote:
On Fri, Nov 14, 2008 at 07:49:51PM +0100, Vassilis Rizopoulos
wrote:
It needs a bit more activity - it is stuck to "looking for
rutema" while installing all the dependent gems. It would be a
lot better
[...]
That really would be better. Hopefully we can get our hooks into
RubyGems a bit more in the future to let us show progress in
greater detail. I even
[...]
Well, just resurfaced from tracking the setup code :) I guess at
the present time there is not much we can do. The gem step in the
setup launches Gem::DependencyInstaller and there is not much we
can do past that point as everything is done by this class. Maybe a
patch to make DependencyInstaller observable?
But that includes Gem::UserInteraction
http://rubygems.rubyforge.org/svn/trunk/lib/rubygems/user_interaction.rb
which gives you self.ui, and self.ui= from DefaultUserInteraction, so
that you get
module UserInteraction
include DefaultUserInteraction
[:alert, :alert_error, :alert_warning, :ask, :ask_yes_no,
:choose_from_list, :say, :terminate_interaction ].each do |methname|
class_eval %{ def #{methname}(*args) ui.#{methname}(*args) end },
__FILE__, __LINE__ end end
So, my quick reading of this is that it will self.ui.send(:ask,...)
[and so forth] to you, so you can intercept all this stuff. Or am I
reading this way too quickly?
I've not looked in the code for a while, so could be talking utter
piffle. :-)
No, you are absolutely write. Gem::DependencyInstaller does a couple of
say() calls (actually one, when starting an install), so yeah that
should work very nicely. Will see what comes up.
I kinda need this to work, or at least fail gracefully as I want to
distribute a mini editor in my team and don't want to run around
troubleshooting this.
Cheers,
V.-
--
http://www.braveworld.net/riva