Ejemplo n.º 1
0
        public static string GetRubyPath(params string[] versions)
        {
            // Check whether running OS is Unix/Linux
            var paths = ParaibaEnvironment.OnUnixLike()
                    ? FindOnUnixLike("ruby", versions) : FindOnWindows("ruby", versions, "bin");

            return(paths.OrderByDescending(path => GetVersion(path, "-v"))
                   .FirstOrDefault());
        }
Ejemplo n.º 2
0
        public static string GetPythonPath(params string[] versions)
        {
            var paths = Enumerable.Empty <string>();

            // Check whether running OS is Unix/Linux
            if (!ParaibaEnvironment.OnUnixLike())
            {
                paths = paths.Concat(TryGetPythonPathFromRegistry(versions));
                paths = paths.Concat(FindOnWindows("python", versions));
            }
            else
            {
                paths = paths.Concat(FindOnUnixLike("python", versions));
            }
            return(paths.Select(path => Tuple.Create(path, GetVersion(path, "-V")))
                   .Where(
                       t => versions.Any(
                           version => t.Item2.Replace(".", "").StartsWith(version)))
                   .OrderByDescending(t => t.Item2)
                   .Select(t => t.Item1)
                   .FirstOrDefault());
        }