public void SetUp()
        {
            theSolution = new Solution();
            theSolution.ClearFeeds();

            theSolution.AddFeed(Feed.Fubu);
            theSolution.AddFeed(Feed.NuGetV2);

            theSolution.AddDependency(fubucore = new Dependency("FubuCore", "1.0.1.201"));

            var theProject = new Project("Test.csproj");
            theSolution.AddProject(theProject);

            theProject.AddDependency(bottles = new Dependency("Bottles"));
            theProject.AddDependency(rhinomocks = new Dependency("RhinoMocks", "3.6.1", UpdateMode.Fixed));
            theProject.AddDependency(structuremap = new Dependency("StructureMap", "2.6.3", UpdateMode.Fixed));

            theFubuFeed = MockRepository.GenerateStub<IFloatingFeed>();
            theFubuFeed.Stub(x => x.GetLatest()).Return(new IRemoteNuget[]
            {
                new StubNuget("Bottles", "1.0.2.2"),
                new StubNuget("FubuCore", "1.0.2.232"),
                new StubNuget("StructureMap", "2.6.4.71"),
            });

            theNugetFeed = MockRepository.GenerateStub<INugetFeed>();
            theNugetFeed.Stub(x => x.Find(rhinomocks)).Return(new StubNuget("RhinoMocks", "3.6.1"));
            theNugetFeed.Stub(x => x.Find(structuremap)).Return(new StubNuget("StructureMap", "2.6.3"));

            theFeedProvider = MockRepository.GenerateStub<IFeedProvider>();
            theFeedProvider.Stub(x => x.For(Feed.Fubu)).Return(theFubuFeed);
            theFeedProvider.Stub(x => x.For(Feed.NuGetV2)).Return(theNugetFeed);

            FeedRegistry.Stub(theFeedProvider);
        }
        public void SetUp()
        {
            theSolution = new Solution();
            theSolution.ClearFeeds();

            theSolution.AddFeed(Feed.Fubu);
            theSolution.AddFeed(Feed.NuGetV2);

            theSolution.AddDependency(bottles      = new Dependency("Bottles"));
            theSolution.AddDependency(fubucore     = new Dependency("FubuCore", "1.0.1.201"));
            theSolution.AddDependency(rhinomocks   = new Dependency("RhinoMocks", "3.6.1", UpdateMode.Fixed));
            theSolution.AddDependency(structuremap = new Dependency("StructureMap", "2.6.3", UpdateMode.Fixed));

            RippleEnvironment.StubConnection(true);

            theFubuFeed = MockRepository.GenerateStub <IFloatingFeed>();
            theFubuFeed.Stub(x => x.GetLatest()).Return(new IRemoteNuget[]
            {
                new StubNuget("Bottles", "1.0.2.2"),
                new StubNuget("FubuCore", "1.0.2.232"),
                new StubNuget("StructureMap", "2.6.4.71"),
            });
            theFubuFeed.Stub(x => x.IsOnline()).Return(true);

            theNugetFeed = MockRepository.GenerateStub <INugetFeed>();
            theNugetFeed.Stub(x => x.Find(rhinomocks)).Return(new StubNuget("RhinoMocks", "3.6.1"));
            theNugetFeed.Stub(x => x.Find(structuremap)).Return(new StubNuget("StructureMap", "2.6.3"));
            theNugetFeed.Stub(x => x.IsOnline()).Return(true);

            theFeedProvider = MockRepository.GenerateStub <IFeedProvider>();
            theFeedProvider.Stub(x => x.For(Feed.Fubu)).Return(theFubuFeed);
            theFeedProvider.Stub(x => x.For(Feed.NuGetV2)).Return(theNugetFeed);

            FeedRegistry.Stub(theFeedProvider);
        }
예제 #3
0
        public RemoteNuget(string name, string version, string url, INugetFeed feed)
        {
            Name        = name;
            Version     = SemanticVersion.Parse(version);
            _downloader = new UrlNugetDownloader(url);

            _dependencies = new Lazy <IEnumerable <Dependency> >(() => feed.Repository.FindPackage(Name, Version).ImmediateDependencies());
        }
예제 #4
0
        public RemoteNuget(string name, string version, string url, INugetFeed feed)
        {
            Name = name;
            Version = SemanticVersion.Parse(version);
            _downloader = new UrlNugetDownloader(url);

            _dependencies = new Lazy<IEnumerable<Dependency>>(() => feed.Repository.FindPackage(Name, Version).ImmediateDependencies());
        }
예제 #5
0
        private bool isOffline(INugetFeed feed)
        {
            if (!_checked.Contains(feed))
            {
                if (!feed.IsOnline())
                {
                    _offline.Add(feed);
                }

                _checked.Add(feed);
            }

            return _offline.Contains(feed);
        }
예제 #6
0
        private bool isOffline(INugetFeed feed)
        {
            if (!_checked.Contains(feed))
            {
                if (!feed.IsOnline())
                {
                    _offline.Add(feed);
                }

                _checked.Add(feed);
            }

            return(_offline.Contains(feed));
        }
예제 #7
0
        public IEnumerable<IRemoteNuget> ReadAll(INugetFeed feed)
        {
            var nodes = _document.DocumentElement.SelectNodes("atom:entry", _manager);
            foreach (XmlElement element in nodes)
            {
                var url = element.SelectSingleNode("atom:content/@src", _manager).InnerText;
                var name = element.SelectSingleNode("atom:title", _manager).InnerText;

                var properties = element.SelectSingleNode("m:properties", _manager);

                var version = properties.SelectSingleNode("d:Version", _manager).InnerText;

                yield return new RemoteNuget(name, version, url, feed);
            }
        }
예제 #8
0
        public IEnumerable <IRemoteNuget> ReadAll(INugetFeed feed)
        {
            var nodes = _document.DocumentElement.SelectNodes("atom:entry", _manager);

            foreach (XmlElement element in nodes)
            {
                var url  = element.SelectSingleNode("atom:content/@src", _manager).InnerText;
                var name = element.SelectSingleNode("atom:title", _manager).InnerText;

                var properties = element.SelectSingleNode("m:properties", _manager);

                var version = properties.SelectSingleNode("d:Version", _manager).InnerText;


                yield return(new RemoteNuget(name, version, url, feed));
            }
        }
예제 #9
0
        private IRemoteNuget getLatestFromFloatingFeed(INugetFeed feed, Dependency dependency)
        {
            var floatingFeed = feed as IFloatingFeed;

            if (floatingFeed == null)
            {
                return(null);
            }

            var floatedResult = floatingFeed.GetLatest().SingleOrDefault(x => dependency.MatchesName(x.Name));

            if (floatedResult != null && dependency.Mode == UpdateMode.Fixed && floatedResult.IsUpdateFor(dependency))
            {
                return(null);
            }

            return(floatedResult);
        }
예제 #10
0
        public void IfOnline(INugetFeed feed, Action<INugetFeed> continuation)
        {
            try
            {
                if (isOffline(feed))
                {
                    RippleLog.Debug("Feed offline. Ignoring " + feed);
                    return;
                }

                continuation(feed);
            }
            catch (Exception exc)
            {
                markOffline(feed);
                RippleLog.Info("Feed unavailable: " + feed);
                RippleLog.Debug(exc.ToString());
            }
        }
예제 #11
0
        public void IfOnline(INugetFeed feed, Action <INugetFeed> continuation)
        {
            try
            {
                if (isOffline(feed))
                {
                    RippleLog.Debug("Feed offline. Ignoring " + feed);
                    return;
                }

                continuation(feed);
            }
            catch (Exception exc)
            {
                MarkOffline(feed);
                RippleLog.Info("Feed unavailable: " + feed);
                RippleLog.Debug(exc.ToString());
            }
        }
예제 #12
0
파일: FeedService.cs 프로젝트: 4lexm/ripple
        private IRemoteNuget getLatestFromFloatingFeed(INugetFeed feed, Dependency dependency)
        {
            var floatingFeed = feed as IFloatingFeed;
            if (floatingFeed == null) return null;

            var floatedResult = floatingFeed.GetLatest().SingleOrDefault(x => dependency.MatchesName(x.Name));
            if (floatedResult != null && dependency.Mode == UpdateMode.Fixed && floatedResult.IsUpdateFor(dependency))
            {
                return null;
            }

            return floatedResult;
        }
예제 #13
0
 private void markOffline(INugetFeed feed)
 {
     _offline.Fill(feed);
 }
예제 #14
0
 public void MarkOffline(INugetFeed feed)
 {
     _offline.Fill(feed);
 }
예제 #15
0
 public void MarkOffline(INugetFeed feed)
 {
     _offline.Fill(feed);
 }
예제 #16
0
 private void markOffline(INugetFeed feed)
 {
     _offline.Fill(feed);
 }