Accept full dotted version schema

Issue #22 resolved
Luis Lavena created an issue

At this time, uru only recognizes TAG as a way to switch version. Other ruby version managers recognize dotted one like 2.0.0-p0 to switch:

C:\Users\Luis\Tools\Ruby>uru 2.0.0-p0
[ERROR] I don't understand the `2.0.0-p0` command
C:\Users\Luis\Tools\Ruby>uru ls
 =>     187: ruby 1.8.7 (2012-10-12 patchlevel 371) [i386-mingw32]
    192p290: ruby 1.9.2p290 (2011-07-09) [i386-mingw32]
    193p392: ruby 1.9.3p392 (2013-02-22) [i386-mingw32]
      200p0: ruby 2.0.0p0 (2013-02-24) [i386-mingw32]

It will be great if this can be consistent with the other Ruby version managers.

Thank you

Comments (7)

  1. Jon repo owner

    Currently, most everything is done via a simple "tag" value that keys the env.RubyRegistry like here

    I need to think how this should grow without becoming too complex or requiring too much runtime work. In general, I want uru to have a no-lag cli and will likely make tradeoffs in that direction.

    Btw, uru currently does fuzzy matching on the tag value (currently must start with 2 digits), so uru 39 and uru 93 should both select your 193p392 tagged ruby.

  2. Jon repo owner

    The newly released 0.4.0 fuzzy matches on TagLabel in rubies.json. Would you try 0.4.0 out to see if you think uru should also match on ID?

    If you think it should also match on ID, do you think it should be an absolute match or a fuzzy match?

  3. Luis Lavena reporter

    I think fuzzy matching on TagLabel is OK, but I think 10 characters max labels is a bit limiting:

    C:\Users\Luis\Tools\Ruby>uru admin add %CD%\ruby-2.0.0-p195-x64-mingw32\bin --tag 200p195-x64
    ---> Registered ruby at `C:\Users\Luis\Tools\Ruby\ruby-2.0.0-p195-x64-mingw32\bin` as `200p195-x64`
    
    C:\Users\Luis\Tools\Ruby>uru ls
           200p195: ruby 2.0.0p195 (2013-05-14) [i386-mingw32]
           192p290: ruby 1.9.2p290 (2011-07-09) [i386-mingw32]
        200p195-x6: ruby 2.0.0p195 (2013-05-14) [x64-mingw32]
           193p429: ruby 1.9.3p429 (2013-05-15) [i386-mingw32]
               187: ruby 1.8.7 (2012-10-12 patchlevel 371) [i386-mingw32]
    

    Notice that 200p195-x64 got truncated, at least visually.

    Fuzzy matching also works great:

    C:\Users\Luis\Tools\Ruby>uru 200
    ---> these rubies match your `200` tag:
    
     [1]    200p195: ruby 2.0.0p195 (2013-05-14) [i386-mingw32]
     [2] 200p195-x6: ruby 2.0.0p195 (2013-05-14) [x64-mingw32]
    
    select [1]-[2] to use that specific ruby (0 to exit) [0]: 2
    ---> Now using ruby 2.0.0-p195 tagged as `200p195-x64`
    

    I think if a full dotted version is provided (e.g. 2.0.0-p0) it should look into ID but not applying fuzzy matching.

    At least I think that will be useful, so I could uru 1.9.3-p429 do not attempt to find rubies with 1.9.3 in it.

    Of course, just my thoughts :-D

    Thank you!

  4. Jon repo owner

    Agreed;10 chars max for TagLabel is too small. Changing to max of 12.

    For full full dotted version support, I agree full, not fuzzy, match on ID is best especially since I've changed the persisted ID string to be more compatible with other version managers.

    Working on the the changes...thanks for the continued testing and feedback :)

  5. Log in to comment