Created
June 22, 2010 03:10
-
-
Save jrabbit/447879 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def search_gem(pac): | |
things = [] | |
raw = Popen(['gem', 'search','-b', pac], stdout=PIPE).communicate()[0] | |
for x in raw.split('\n'): | |
if x and x != '*** LOCAL GEMS ***' and x != '*** REMOTE GEMS ***': | |
things.append(x) | |
if not things: | |
return | |
else: | |
print 'found ' + len(things) + ' results for ' + pac\ | |
+ ' in your configured rubygems sources:' | |
print things | |
return things |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment