本文整理匯總了C#中ripple.Model.Dependency.DetermineStability方法的典型用法代碼示例。如果您正苦於以下問題:C# Dependency.DetermineStability方法的具體用法?C# Dependency.DetermineStability怎麽用?C# Dependency.DetermineStability使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ripple.Model.Dependency
的用法示例。
在下文中一共展示了Dependency.DetermineStability方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: find
protected override IRemoteNuget find(Dependency query)
{
SemanticVersion version;
if (!SemanticVersion.TryParse(query.Version, out version))
{
RippleLog.Debug("Could not find exact for " + query);
return null;
}
var versionSpec = new VersionSpec(version);
var package = _repository.FindPackages(query.Name, versionSpec, query.DetermineStability(_stability) == NugetStability.Anything, true).SingleOrDefault();
if (package == null)
{
return null;
}
return new RemoteNuget(package);
}
示例2: find
protected override IRemoteNuget find(Dependency query)
{
throwIfNeeded(query);
if (query.IsFloat() || query.Version.IsEmpty())
{
return Nugets
.OrderByDescending(x => x.Version)
.FirstOrDefault(x => query.MatchesName(x.Name));
}
var version = SemanticVersion.Parse(query.Version);
var matching = Nugets.Where(x => query.MatchesName(x.Name));
if (query.DetermineStability(_feed.Stability) == NugetStability.ReleasedOnly)
{
return matching.FirstOrDefault(x => x.Version.SpecialVersion.IsEmpty() && x.Version.Equals(version));
}
return matching.FirstOrDefault(x => x.Version.Version.Equals(version.Version));
}
示例3: findLatest
protected override IRemoteNuget findLatest(Dependency query)
{
RippleLog.Debug("Searching for {0} from {1}".ToFormat(query, _url));
var candidates = _repository.Search(query.Name, query.DetermineStability(_stability) == NugetStability.Anything)
.Where(x => query.Name == x.Id).OrderBy(x => x.Id).ToList();
var candidate = candidates.FirstOrDefault(x => x.IsAbsoluteLatestVersion)
?? candidates.FirstOrDefault(x => x.IsLatestVersion);
if (candidate == null)
{
// If both absolute and latest are false, then we order in descending order (by version) and take the top
candidate = candidates
.OrderByDescending(x => x.Version)
.FirstOrDefault();
if (candidate == null) return null;
}
return new RemoteNuget(candidate);
}
示例4: findLatest
protected override IRemoteNuget findLatest(Dependency query)
{
RippleLog.Debug("Searching for {0} from {1}".ToFormat(query, _url));
var candidates = repository.Search(query.Name, query.DetermineStability(Stability) == NugetStability.Anything)
.Where(x => query.Name == x.Id).OrderBy(x => x.Id).ToList();
return candidates.LatestNuget(query.VersionSpec);
}
示例5: findLatest
protected override IRemoteNuget findLatest(Dependency query)
{
RippleLog.Debug("Searching for latest of {0} in {1}".ToFormat(query, _directory));
var nugets = files
.Where(x => query.MatchesName(x.Name) && (!x.IsPreRelease || (x.IsPreRelease && query.DetermineStability(_stability) == NugetStability.Anything)))
.ToList();
var nuget = nugets
.OrderByDescending(x => x.Version)
.FirstOrDefault();
if (nuget == null)
{
return null;
}
return new FileSystemNuget(nuget);
}