private static RubyPlatform findDefaultPlatform() { String path = RubyInstallation.getInstance().getJRuby(); return path == null ? null : new RubyPlatform(PLATFORM_ID_DEFAULT, path, Info.forDefaultPlatform()); }
protected RubyPlatform getPlatform() { RubyPlatform platform = RubyPlatform.platformFor(project); if (platform == null) { platform = RubyPlatformManager.getDefaultPlatform(); } return platform; }
/** Returns main Gem repository path. */ public String getGemHome() { return platform.getInfo().getGemHome(); }
private GemManager getGemManager() { // TODO: cache it(?) return new RubyPlatformProvider(evaluator).getPlatform().getGemManager(); }
public synchronized String getIRB() { if (irb == null) { irb = findExecutable(isJRuby() ? "jirb" : "irb", false, true); // NOI18N } return irb; }
String getRubyGemsVersion() { return platform.getInfo().getGemVersion(); }
/** * Checks whether the platform has a valid autotest installed. * * @param warn whether to show warning message to the user if ther is no * valid autotest installed */ public boolean hasValidAutoTest(boolean warn) { boolean validBinary = isValidFile(getAutoTest()); possiblyNotifyUser(warn, validBinary, "autotest"); // NOI18N return validBinary && hasZenTest(); }
/** * Checks whether the platform has a valid autotest installed. * * @param warn whether to show warning message to the user if ther is no * valid autotest installed */ public boolean hasValidAutoSpec(boolean warn) { boolean validBinary = isValidFile(getAutoSpec()); possiblyNotifyUser(warn, validBinary, "autospec"); // NOI18N return validBinary && hasZenTest(); }
/** * Calls {@link #hasRubyGemsInstalled(boolean)} with <tt>false</tt> for warn * parameter. */ public boolean hasRubyGemsInstalled() { return hasRubyGemsInstalled(false); }
public synchronized String getAutoSpec() { if (autospec == null) { autospec = findExecutable("autospec"); // NOI18N } return autospec; }
private static String computeID(final String kind) { String id = kind; for (int i = 0; getPlatformByID(id) != null; i++) { id = kind + '_' + i; } return id; }
/** * Get version specific for the platform. E.g. in the case of JRuby it * returns e.g. 1.1.4 instead of 1.8.6. * * @return platform specific version */ public String getPlatformVersion() { return isJRuby() ? getJVersion() : getVersion(); }
/** * Calls {@link #isValid(boolean)} with <code>false</code>. */ public boolean isValid() { return isValid(false); }
boolean checkAndReportRubyGemsProblems() { String problems = getRubyGemsProblems(); if (problems != null) { reportRubyGemsProblem(); } return problems == null; }
@Override public void run() { RubyPlatformManager.performPlatformDetection(); } });
/** * Check whether RubyGems are correctly installed for this platform. * * @param warn whether to show warning if RubyGems are not installed or * installation is broken * @return whether the RubyGems are correctly installed for this platform */ public boolean hasRubyGemsInstalled(boolean warn) { return validator.hasRubyGemsInstalled(warn); }
/** * Return path to the <em>gem</em> tool if it does exist. * * @return path to the <em>gem</em> tool; might be <tt>null</tt> if not * found. */ public synchronized String getGemTool() { if (gemTool == null) { gemTool = findExecutable("gem", false, true); // NOI18N } return gemTool; }
public synchronized String getRDoc() { if (rdoc == null) { rdoc = findExecutable("rdoc", false, true); // NOI18N } return rdoc; }
/** * Try to find a path to the <tt>toFind</tt> executable in the "Ruby * specific" manner. * * @param toFind executable to be find, e.g. rails, rake, rdoc, irb ... * @return path to the found executable; might be <tt>null</tt> if not * found. */ public String findExecutable(final String toFind) { return findExecutable(toFind, true); }