public void Precompile(IAssetPipeline pipeline, IAssetRegistration registration)
        {
            var allFiles = pipeline.AllFiles().Where(x => x.Extension() == ".js");
            allFiles.Each(x =>
            {
                var name = x.LibraryName();
                var content = _fileSystem.ReadStringFromFile(x.FullPath);
                var match = _regex.Match(content);
                if (!match.Success) { return; }

                var tag = match.Groups[1].Value;
                var dependencies = match.Groups[3].Value;
                dependencies = _replacements
                    .Aggregate(dependencies, (current, value) => current.Replace(value, ""));
                var assets = dependencies.Split(',');
                //register all requirejs depedencies into asset graph
                foreach (var asset in assets)
                {
                    registration.Dependency(name, "{0}.js".ToFormat(asset));
                }

                if (tag == "require")
                {
                    _registry.Register(x);
                }
            });
        }
Exemple #2
0
        public void SetUp()
        {
            theRegistration = MockRepository.GenerateMock <IAssetRegistration>();
            theRegistry     = new FubuRegistry();

            theExpression = new AssetsExpression(theRegistry, theRegistration);
        }
        public void SetUp()
        {
            theRegistration = MockRepository.GenerateMock<IAssetRegistration>();
            theRegistry = new FubuRegistry();

            theExpression = new AssetsExpression(theRegistry, theRegistration);
        }
Exemple #4
0
 public void Replay(IAssetRegistration registration)
 {
     _registrations.Each(x => x(registration));
 }
Exemple #5
0
 public AssetsExpression(FubuRegistry registry, IAssetRegistration registration)
 {
     _registry     = registry;
     _registration = new Lazy <IAssetRegistration>(() => registration);
 }
Exemple #6
0
 public AssetFileExpression(AssetsExpression parent, string assetName)
 {
     _parent       = parent;
     _assetName    = assetName;
     _registration = _parent._registration.Value;
 }
 public AssetDslReader(IAssetRegistration registration)
 {
     _registration = registration;
 }
Exemple #8
0
 public AssetDslReader(IAssetRegistration registration)
 {
     _registration = registration;
 }
 public void Replay(IAssetRegistration registration)
 {
     _registrations.Each(x => x(registration));
 }
 public void SetUp()
 {
     theUnderlyingRegistration = MockRepository.GenerateMock<IAssetRegistration>();
 }
 public void SetUp()
 {
     theUnderlyingRegistration = MockRepository.GenerateMock <IAssetRegistration>();
 }
Exemple #12
0
 public AssetRegistrationDiagnostics(IAssetRegistration inner, AssetLogsCache logs)
 {
     _inner = inner;
     _logs  = logs;
 }
 public AssetRegistrationDiagnostics(IAssetRegistration inner, AssetLogsCache logs)
 {
     _inner = inner;
     _logs = logs;
 }