private void refreshDebugger() { RubyPlatform platform = getSelectedPlatform(); boolean supportFastDebuggerInstallation = !platform.isRubinius(); boolean fdInstalled = platform.hasFastDebuggerInstalled(); installFastDebugger.setEnabled(supportFastDebuggerInstallation && platform.hasRubyGemsInstalled()); installFastDebugger.setVisible(supportFastDebuggerInstallation && !fdInstalled); String key = platform.isRubinius() ? "RubyPlatformCustomizer.noFastDebuggerForRubiniusYet.text" // NOI18N : (platform.hasFastDebuggerInstalled() ? "RubyPlatformCustomizer.rubyDebugEngine.text" // NOI18N : "RubyPlatformCustomizer.classicDebuggerEngine.text"); // NOI18N engineType.setText(getMessage(key)); }
/** * @return whether everything needed for fast debugging is installed */ public boolean hasFastDebuggerInstalled() { // no usable version of Fast Debugger for Rubinius is available yet return getGemManager() != null && !isRubinius() && getFastDebuggerProblemsInHTML() == null; }
/** * Return the lib directory for this interprerter. Usually parent of {@link * #getVersionLibDir()}. */ public String getLibDir() { if (isRubinius()) { return getRubiniusLibDir(); } String lib = info.getLibDir(); if (lib == null) { LOGGER.log(Level.WARNING, "rubylibdir not found for {0}, was: {1}", new String[]{interpreter, lib}); return null; } File libDir = new File(lib); if (!libDir.isDirectory()) { LOGGER.log(Level.WARNING, "rubylibdir not found for {0}, was: {1}", new String[]{interpreter, lib}); return null; } // info.getVersionLibDir() return e.g. .../lib/ruby/1.8 libDir = libDir.getParentFile(); if (libDir == null) { return null; } libDir = libDir.getParentFile(); if (libDir == null) { return null; } return libDir.getAbsolutePath(); }
public FileObject getSystemRoot(FileObject file) { // See if the file is under the Ruby libraries FileObject rubyLibFo = isRubinius() ? null : getLibDirFO(); FileObject rubyStubs = getRubyStubs(); FileObject gemHome = getGemHome(); while (file != null) { if (file.equals(rubyLibFo) || file.equals(rubyStubs) || isGemRoot(file) || file.equals(gemHome)) { return file; } file = file.getParent(); } return null; }