Пример #1
0
        public override object GetValue(MemberInfo member, object instance)
        {
            var endpoint = _repository.TrimStart("https").TrimStart("http").TrimStart("://").TrimEnd("/");
            var uri      = $"https://{endpoint}/m2/{_groupId.Replace(".", "/")}/{_artifactId ?? _groupId}/maven-metadata.xml";
            var content  = HttpTasks.HttpDownloadString(uri);

            return(XmlTasks.XmlPeekFromString(content, ".//version").Last());
        }
        public override object GetValue(MemberInfo member, object instance)
        {
            var content = HttpTasks.HttpDownloadString($"https://www.myget.org/RSS/{_feed}");

            return(XmlTasks.XmlPeekFromString(content, ".//title")
                   // TODO: regex?
                   .First(x => x.Contains($"/{_package} "))
                   .Split('(').Last()
                   .Split(')').First()
                   .TrimStart("version "));
        }