hudson.plugins.rake
Class Util

java.lang.Object
  extended by hudson.plugins.rake.Util

public class Util
extends Object

Ruby utility class. It's used to detect ruby local installations among other features.

Author:
David Calavera

Constructor Summary
Util()
           
 
Method Summary
static String bundleExecName()
           
static String execName()
           
static String findInPath(String executable, String path, String pathSeparator)
          Works kind of like the "which" program; the method won't try to apply PATHEXT to executable when searching the PATH.
static File getBundleExecutable(String path)
           
static File getBundleExecutable(String path, String gemHome, String gemPath)
           
static RubyInstallation[] getCanonicalRubies(RubyInstallation[] currentInstallations)
           
protected static RubyInstallation[] getCanonicalRubies(RubyInstallation[] currentInstallations, Collection<File> candidates)
           
static File[] getDefaultGemPaths(String path)
           
static File getExecutable(String path)
           
static File getExecutable(String path, String gemHome, String gemPath)
           
static File[] getGemsDir(String path)
           
static Collection<File> getRubyInstallations()
           
protected static Collection<File> getRubyInstallations(String systemPath)
           
static boolean hasGemsInstalled(String path)
           
static boolean isAlreadyInstalled(RubyInstallation[] current, String path)
           
static boolean isCustom(String path, String execName)
           
static boolean isJruby(String path)
           
static boolean isLinux()
           
static boolean isMac()
           
static boolean isRakeInstalled(File... gemsDirArray)
           
static boolean isWindows()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

getExecutable

public static File getExecutable(String path)

getExecutable

public static File getExecutable(String path,
                                 String gemHome,
                                 String gemPath)

getBundleExecutable

public static File getBundleExecutable(String path)

getBundleExecutable

public static File getBundleExecutable(String path,
                                       String gemHome,
                                       String gemPath)

execName

public static String execName()

bundleExecName

public static String bundleExecName()

isWindows

public static boolean isWindows()

isLinux

public static boolean isLinux()

isMac

public static boolean isMac()

isJruby

public static boolean isJruby(String path)

isCustom

public static boolean isCustom(String path,
                               String execName)

hasGemsInstalled

public static boolean hasGemsInstalled(String path)

getGemsDir

public static File[] getGemsDir(String path)

getDefaultGemPaths

public static File[] getDefaultGemPaths(String path)

isRakeInstalled

public static boolean isRakeInstalled(File... gemsDirArray)

getRubyInstallations

public static Collection<File> getRubyInstallations()
                                             throws IOException
Throws:
IOException

findInPath

public static String findInPath(String executable,
                                String path,
                                String pathSeparator)
Works kind of like the "which" program; the method won't try to apply PATHEXT to executable when searching the PATH.

Parameters:
executable - The full name of the program to find in the path.
path - The value of the PATH environment variable.
pathSeparator - The path separation character for the agent's OS.
Returns:
The absolute path to the executable if it was found in the path; the original value of executable otherwise.

getRubyInstallations

protected static Collection<File> getRubyInstallations(String systemPath)
                                                throws IOException
Throws:
IOException

getCanonicalRubies

public static RubyInstallation[] getCanonicalRubies(RubyInstallation[] currentInstallations)

getCanonicalRubies

protected static RubyInstallation[] getCanonicalRubies(RubyInstallation[] currentInstallations,
                                                       Collection<File> candidates)

isAlreadyInstalled

public static boolean isAlreadyInstalled(RubyInstallation[] current,
                                         String path)


Copyright © 2004-2014. All Rights Reserved.