Exemple #1
0
 public bool ParseAndValidate(string version, Versioning.Version testVersion, Versioning.IParseVersions parser = null)
 {
     if (parser == null)
     {
         parser = new Versioning.JustVersionParser();
     }
     Versioning.Version v = parser.Parse(version);
     return(v.Major == testVersion.Major && v.Minor == testVersion.Minor && v.Build == testVersion.Build &&
            v.Description == testVersion.Description);
 }
Exemple #2
0
        public static SortedList <string, string> ResolveScriptsFromPathAndVersion(string path, string pattern, bool recurse, string workingDirectory, Versioning.Version source, Versioning.Version destination, Versioning.IParseVersions versionParser = null)
        {
            SortedList <string, string> files = new SortedList <string, string>();

            if (versionParser == null)
            {
                versionParser = new Versioning.VersionDateParser();
            }
            string usedPath = path;

            if (!System.IO.Directory.Exists(usedPath))
            {
                usedPath = System.IO.Path.Combine(workingDirectory, path);
            }
            if (!System.IO.Directory.Exists(usedPath))
            {
                throw new ArgumentOutOfRangeException("path");
            }
            foreach (var d in System.IO.Directory.GetDirectories(usedPath))
            {
                System.IO.DirectoryInfo dir        = new DirectoryInfo(d);
                Versioning.Version      dirVersion = versionParser.Parse(dir.Name);
                if (dirVersion >= source && dirVersion <= destination)
                {
                    var scripts = ResolveScriptsFromPath(dir.FullName, pattern, recurse, workingDirectory);
                    foreach (string key in scripts.Keys)
                    {
                        files.Add(key, scripts[key]);
                    }
                }
            }

            return(files);
        }
Exemple #3
0
        public SortedList <string, string> LoadScripts(string path, string pattern, bool recurse, string workingDirectory, Versioning.IParseVersions versionParser = null)
        {
            SortedList <string, string> s = ScriptRunner.ResolveScriptsFromPathAndVersion(path, pattern, recurse, workingDirectory, FromVersion,
                                                                                          ToVersion, versionParser);


            return(s);
        }