Closed waj closed 4 years ago
I just changed Package#spec
so it reads the shard.yml
from filesystem when the package is installed. This brings back functionality similar to Resolver#installed_spec
. Otherwise, when running spec check
or spec list
it would "fetch" the source repositories.
This is the first part of a refactor I'm working on to better separate responsibilities between internal entities in Shards. I split these changes in two so it can be reviewed more easily. With this PR the
Resolver
still represents a source to obtain different versions of a shard, but the installation is delegated completely to thePackage
class.This will make more sense with the second part, where locks and installed packages (
Shards.info.installed
) will return instances ofPackage
instead ofDependency
. In other words, finally theDependency
will represent just the intention with some more or less precise definition of which version is desired, while aPackage
represents a specific version that must be or is already installed.There is a small change in behaviour after this refactor, but I think in the good direction. Now the only source of truth to determine if a shard is already installed is the
.shard.info
file. So the contents of the shard could be manually changed, or the symlink created for apath
resolver modified but Shards still would assume the dependency is already there and nothing must be done to fix it. Only in the case of a complete removal of the directory or symlink it will reinstall the dependency ignoring what was recorded in the info file.