[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

John Joyce

1/29/2008 1:38:00 AM

I'm curious is there a flag or an easy way to extend gem when calling
it from the command line to do the following:
remove lines such as:

\n*** LOCAL GEMS ***\n\n
and
\n*** REMOTE GEMS ***\n\n

and to control the output formatting of
gem list
or of
gem list -d
?

I'd like to get that output in a more manageable format, but without
permanently altering gem.
I just want the easiest way to alter those methods when calling gem
or calling gem via ruby at the command line...
I don't want to break any body's gem tool, but I do want to use gem's
output for list.

I suppose I'll need to include a file to use as an argument...
ruby -rubygems filename.rb

What I am doing is building a gui wrapper in Cocoa on OS X for common
gem commands.
I want to later add gem install and gem uninstall, but I'm not sure
what the best way would be to handle gems that have more involved
install/uninstall processes, such as when the user is prompted for [y/
n]? input on whether to include a dependency or something in that
install/uninstall process.
Is there a consistent thing I should look for in this or some API I
can dig into?
Same goes for gems that on install ask for such things as platform
choice (the mysql gem is an example of this).

4 Answers

Eric Hodel

1/30/2008 11:12:00 PM

0

On Jan 28, 2008, at 17:37 PM, John Joyce wrote:

> What I am doing is building a gui wrapper in Cocoa on OS X for
> common gem commands.
> I want to later add gem install and gem uninstall, but I'm not sure
> what the best way would be to handle gems that have more involved
> install/uninstall processes, such as when the user is prompted for
> [y/n]? input on whether to include a dependency or something in that
> install/uninstall process.

Talk to Chad Wooley. He's writing a gem installer tool.

John Joyce

1/31/2008 4:26:00 AM

0


On Jan 30, 2008, at 5:12 PM, Eric Hodel wrote:

> On Jan 28, 2008, at 17:37 PM, John Joyce wrote:
>
>> What I am doing is building a gui wrapper in Cocoa on OS X for
>> common gem commands.
>> I want to later add gem install and gem uninstall, but I'm not
>> sure what the best way would be to handle gems that have more
>> involved install/uninstall processes, such as when the user is
>> prompted for [y/n]? input on whether to include a dependency or
>> something in that install/uninstall process.
>
> Talk to Chad Wooley. He's writing a gem installer tool.
>
Ok, thanks,
one other thing,
I'd rather not go hacking gem, but If possible, as a feature request,
can we have a flag that turns off the headings?
From digging through gem's code it certainly looks reasonably possible.
things such as
\n*** LOCAL GEMS ***\n\n

and
Updating metadata for 13 gems.........

It would be convenient as heck to have those easily turned off by a
command line flag so that parsing the output is cleaner.
How can I contact Chad Wooly?

Eric Hodel

1/31/2008 9:25:00 AM

0

On Jan 30, 2008, at 20:26 PM, John Joyce wrote:
> On Jan 30, 2008, at 5:12 PM, Eric Hodel wrote:
>> On Jan 28, 2008, at 17:37 PM, John Joyce wrote:
>>> What I am doing is building a gui wrapper in Cocoa on OS X for
>>> common gem commands.
>>> I want to later add gem install and gem uninstall, but I'm not
>>> sure what the best way would be to handle gems that have more
>>> involved install/uninstall processes, such as when the user is
>>> prompted for [y/n]? input on whether to include a dependency or
>>> something in that install/uninstall process.
>>
>> Talk to Chad Wooley. He's writing a gem installer tool.
>>
> Ok, thanks,
> one other thing,
> I'd rather not go hacking gem, but If possible, as a feature request,
> can we have a flag that turns off the headings?

No. If you're going to be writing a tool, use the API the
QueryCommand uses. If you find yourself duplicating too much, propose
a patch to refactor into something more usable.

> From digging through gem's code it certainly looks reasonably
> possible.
> things such as
> \n*** LOCAL GEMS ***\n\n
>
> and
> Updating metadata for 13 gems.........
>
> It would be convenient as heck to have those easily turned off by a
> command line flag so that parsing the output is cleaner.

The RubyGems API provides for this, investigate rubygems/
user_interaction.rb (I think)

> How can I contact Chad Wooly?

Check the archives of the rubygems-developers list for details.

John Joyce

1/31/2008 1:09:00 PM

0


On Jan 31, 2008, at 3:24 AM, Eric Hodel wrote:

> On Jan 30, 2008, at 20:26 PM, John Joyce wrote:
>> On Jan 30, 2008, at 5:12 PM, Eric Hodel wrote:
>>> On Jan 28, 2008, at 17:37 PM, John Joyce wrote:
>>>> What I am doing is building a gui wrapper in Cocoa on OS X for
>>>> common gem commands.
>>>> I want to later add gem install and gem uninstall, but I'm not
>>>> sure what the best way would be to handle gems that have more
>>>> involved install/uninstall processes, such as when the user is
>>>> prompted for [y/n]? input on whether to include a dependency or
>>>> something in that install/uninstall process.
>>>
>>> Talk to Chad Wooley. He's writing a gem installer tool.
>>>
>> Ok, thanks,
>> one other thing,
>> I'd rather not go hacking gem, but If possible, as a feature request,
>> can we have a flag that turns off the headings?
>
> No. If you're going to be writing a tool, use the API the
> QueryCommand uses. If you find yourself duplicating too much,
> propose a patch to refactor into something more usable.
>
>> From digging through gem's code it certainly looks reasonably
>> possible.
>> things such as
>> \n*** LOCAL GEMS ***\n\n
>>
>> and
>> Updating metadata for 13 gems.........
>>
>> It would be convenient as heck to have those easily turned off by
>> a command line flag so that parsing the output is cleaner.
>
> The RubyGems API provides for this, investigate rubygems/
> user_interaction.rb (I think)
>
>> How can I contact Chad Wooly?
>
> Check the archives of the rubygems-developers list for details.
>
Many thanks!
I will look into these things! (as time permits... )