Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centralize CURI search logic #1120

Closed
wants to merge 4 commits into from
Closed

Centralize CURI search logic #1120

wants to merge 4 commits into from

Commits on Jul 22, 2017

  1. Centralize CURI search logic

    * Use !matching-dist to do any dist searches to remove duplicated
    search logic.
    
    * !matching-dist returns a list of matching dists so that it
    can serve a wider range of functions. A thin wrapper method
    could use this to provide a list of "candidate" distributions
    from a specific CUR.
    
    * Take $api into account when searching dists.
    
    * Set all meta<files>.values to absolute paths, not just the one
    being searched for.
    ugexe committed Jul 22, 2017
    Copy the full SHA
    e2dacf5 View commit details
    Browse the repository at this point in the history
  2. Restore .script fast-lookup

    ugexe committed Jul 22, 2017
    Copy the full SHA
    5214bb1 View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2017

  1. Cache spec string during lookup

    ugexe committed Jul 26, 2017
    Copy the full SHA
    1341a29 View commit details
    Browse the repository at this point in the history

Commits on Jul 28, 2017

  1. Add candidates method as recommendation manager

    Add `method candidates` - All distribution searching/resolving go through this new method. This gives developers insight into how a CURI resolves a module request, which was not possible with .resolve (since it would chain to the next CUR, and only returned a single result). Many NYI s22 features will require something like this, and .candidates is indeed mentioned in s22 https://design.perl6.org/S22.html#candidates
    
    !matching-dist is now backed by .candidates, but also caches a single 'best match' so it acts similar to before.
    #1121 (comment)
    
    .candidates (i.e. !matching-dist) now returns a Distribution object and not ($dist-id, $dist-data). This is possible because of a new LazyMetaReader role that allows our lazy distribution to avoid costly IO calls to obtain meta data. Previously this was done by passing around a hash internally, but now we dogfood our Distribution interface throughout CURI.
    
    Avoid io after setting up various directories once.
    ugexe committed Jul 28, 2017
    Copy the full SHA
    a492cf2 View commit details
    Browse the repository at this point in the history