confused query descriptions
For some reason beyond my current understanding, the result of some queries are completely wrong and confused. In the example that follows the description of hermes is confused with heredoc_unindent, which are two completely unrelated gems.
$ gem query -r --source 'http://rubygems.org' -d -n '^hermes$'
*** REMOTE GEMS ***
hermes (0.2.1)
Author: Adriano Mitre
Rubyforge: http://rubyforge.org/projects/heredoc_unindent
Homepage: https://github.com/adrianomitre/heredoc_unindent
Removes common margin from indented strings such as the ones
produced by heredocs, i.e., strips out leading whitespace chars at
the beggining of each line (but only as much as the line with the
smallest margin).
Another example, that shows heredoc_unindent being confused with hercules
$ gem query -r --source 'http://rubygems.org' -d -n '^heredoc_unindent$'
*** REMOTE GEMS ***
heredoc_unindent (1.0.0)
Author: Diogo Biazus
Homepage: http://github.com/diogob/hercules
Simple deploy solution for ruby applications (using github+bundler).
Support Staff 2 Posted by Nick Quaranto on 29 Jan, 2011 07:26 PM
Not sure what's up with this. Any ideas, Eric? Also, if you run
gem sources -cand try these commands again does it work?3 Posted by Adriano on 30 Jan, 2011 01:55 AM
Hmm, I guess it were just invalid caches:
gem sources -cfixed it.$ gem sources -c *** Removed specs cache *** *** Removed user source cache *** *** Removed latest user source cache *** *** Removed system source cache *** *** Removed latest system source cache *** $ gem query -r --source 'http://rubygems.org' -d -n '^hermes$' *** REMOTE GEMS *** hermes (0.2.1) Authors: José Valim, Carlos Antônio da Silva Rubyforge: http://rubyforge.org/projects/hermes Homepage: http://github.com/plataformatec/hermes A few testing facilities built on top of Capybara and ActiveSupport::TestCase $ gem query -r --source 'http://rubygems.org' -d -n '^heredoc_unindent$' *** REMOTE GEMS *** heredoc_unindent (1.1.1) Author: Adriano Mitre Rubyforge: http://rubyforge.org/projects/heredoc_unindent Homepage: https://github.com/adrianomitre/heredoc_unindent This gem removes common margin from indented strings, such as the ones produced by indented heredocsThank you, Nick!
4 Posted by Adriano on 31 Jan, 2011 06:11 PM
Unfortunately, not everyhing is quite right.
I am attaching a Ruby script that I made to fetch the descriptions of all gems (it requires trollop and timeout). If I try to fetch all the descriptions in a single run with
./fetch.rb -f list.txt -v -i 0 -n 25000, the aforementioned "confusions" arise, even though I am forcinggem sources -cbetween queries. (Run./fetch -hfor parameters description; list.txt is simply the result ofgem query -r --source 'http://rubygems.org' > list.txt)The only way I found to get reliable results was to limit the number of queries per invokation to 100 queries, using
for j in (seq 0 100 20000) ; ./fetch.rb -f list.txt -v -i $j -n 100 ; end. (I use fish shell, but it should be straightforward to translate the loop.)Any ideas? Should I open an issue at https://github.com/rubygems?
Support Staff 5 Posted by Eric Hodel on 01 Feb, 2011 09:48 PM
Can you run with -V to see which file was downloaded that's causing the problem?
6 Posted by Adriano on 01 Feb, 2011 09:51 PM
Run what with -V? The roblem was not limited to a single file. And it was not an exception, but silent and wrong/confused results.
Support Staff 7 Posted by Eric Hodel on 01 Feb, 2011 10:34 PM
Add -V to qc.handle_options so when you find a mismatch you can see which files were downloaded.