gem API

J

John Joyce

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).
 
E

Eric Hodel

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.
 
J

John Joyce

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?
 
E

Eric Hodel

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.
 
J

John Joyce

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... )
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,271
Latest member
BuyAtenaLabsCBD

Latest Threads

Top