confused query descriptions

query bug's Avatar

query bug

26 Jan, 2011 05:16 PM

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).
  1. Support Staff 1 Posted by Nick Quaranto on 29 Jan, 2011 07:26 PM

    Nick Quaranto's Avatar

    Not sure what's up with this. Any ideas, Eric? Also, if you run gem sources -c and try these commands again does it work?

  2. 2 Posted by Adriano on 30 Jan, 2011 01:55 AM

    Adriano's Avatar

    Hmm, I guess it were just invalid caches: gem sources -c fixed 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 heredocs
    

    Thank you, Nick!

  3. 3 Posted by Adriano on 31 Jan, 2011 06:11 PM

    Adriano's Avatar

    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 forcing gem sources -c between queries. (Run ./fetch -h for parameters description; list.txt is simply the result of gem 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?

  4. Support Staff 4 Posted by Eric Hodel on 01 Feb, 2011 09:48 PM

    Eric Hodel's Avatar

    Can you run with -V to see which file was downloaded that's causing the problem?

  5. 5 Posted by Adriano on 01 Feb, 2011 09:51 PM

    Adriano's Avatar

    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.

  6. Support Staff 6 Posted by Eric Hodel on 01 Feb, 2011 10:34 PM

    Eric Hodel's Avatar

    Add -V to qc.handle_options so when you find a mismatch you can see which files were downloaded.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

30 Oct, 2014 04:34 PM
30 Oct, 2014 02:46 PM
28 Oct, 2014 09:51 AM
23 Oct, 2014 05:37 PM
21 Oct, 2014 10:47 AM