protected RubyPlatform getPlatform() { RubyPlatform platform = RubyPlatform.platformFor(project); if (platform == null) { platform = RubyPlatformManager.getDefaultPlatform(); } return platform; }
public static RubyPlatform getPlatform(String id) { ensurePlatformsReady(); RubyPlatform platform = id == null ? RubyPlatformManager.getDefaultPlatform() : RubyPlatformManager.getPlatformByID(id); if (platform == null) { platform = RubyPlatformManager.getDefaultPlatform(); if (LOGGED_WARNINGS.get(id) == null) { LOGGER.info("Platform with id '" + id + "' does not exist. Using default platform."); LOGGED_WARNINGS.put(id, Boolean.TRUE); } } return platform; }
private static RubyPlatform[] getSortedPlatforms() { Set<? extends RubyPlatform> platforms = RubyPlatformManager.getSortedPlatforms(); return platforms.toArray(new RubyPlatform[platforms.size()]); } private RubyPlatform[] nbPlafs;
private static String computeID(final String kind) { String id = kind; for (int i = 0; getPlatformByID(id) != null; i++) { id = kind + '_' + i; } return id; }
for (String dir : candidateDirs) { for (String ruby : RUBY_EXECUTABLE_NAMES) { File f = findPlatform(dir, ruby); if (f != null) { rubies.add(f); RubyPlatform defaultPlatform = findDefaultPlatform(); if (defaultPlatform != null) { getPlatformsInternal().add(defaultPlatform); if (getPlatformByFile(ruby) == null) { addPlatform(ruby);
return null; RubyPlatform plaf = getPlatformByFile(interpreter); if (plaf != null) { return plaf; final Info info = computeInfo(interpreter); if (info == null) { return null; final String id = computeID(info.getKind()); try { ProjectManager.mutex().writeAccess(new Mutex.ExceptionAction<Void>() { getPlatformsInternal().add(plaf); firePlatformsChanged(); LOGGER.fine("RubyPlatform added: " + plaf); return plaf;
List<RubyServer> getRubyServers() { List<RubyServer> result = new ArrayList<RubyServer>(); for (RubyPlatform each : RubyPlatformManager.getPlatforms()) { result.addAll(RubyServerFactory.getInstance(each).getServers()); } return result; }
public void run() { for (String interpreter : skipped) { try { addPlatform(new File(interpreter)); } catch (IOException ex) { Exceptions.printStackTrace(ex); } } } });
public synchronized static ServerRegistry getDefault() { if (defaultRegistry == null) { defaultRegistry = new ServerRegistry(); RubyPlatformManager.addVetoableChangeListener(defaultRegistry); } return defaultRegistry; }
/** Typically bundled JRuby. */ public static RubyPlatform getDefaultPlatform() { RubyPlatform defaultPlatform = RubyPlatformManager.getPlatformByID(PLATFORM_ID_DEFAULT); if (defaultPlatform == null) { LOGGER.fine("Default platform is not installed"); } return defaultPlatform; }
public ClassPath findClassPath(FileObject file, String type) { if (type.equals(RubyLanguage.BOOT)) { // See if the file is under the Ruby libraries for (RubyPlatform platform : RubyPlatformManager.getPlatforms()) { if (!platform.isValid()) { continue; } FileObject systemRoot = platform.getSystemRoot(file); if (systemRoot != null) { return getRubyClassPaths(file, type, systemRoot); } } } return null; }
RubyPlatform addPlatform(final File interpreter) { try { RubyPlatform platform = RubyPlatformManager.addPlatform(interpreter); if (platform != null) { nbPlafs = getSortedPlatforms(); // refresh fireContentsChanged(this, 0, nbPlafs.length - 1); } return platform; } catch (IOException e) { // tell the user that something goes wrong LOGGER.log(Level.WARNING, e.getLocalizedMessage(), e); } return null; } }
static RubyPlatform platformFor(WizardDescriptor wizardDescriptor) { RubyPlatform platform = (RubyPlatform) wizardDescriptor.getProperty("platform"); if (platform == null) { platform = RubyPlatformManager.getDefaultPlatform(); } return platform; }
public static void preselectPlatform(final JComboBox platforms, final String preferencePlatformIDKey) { String lastPlatformID = RubyPreferences.getPreferences().get(preferencePlatformIDKey, null); if (lastPlatformID != null) { RubyPlatform platform = RubyPlatformManager.getPlatformByID(lastPlatformID); if (platform != null) { platforms.setSelectedItem(platform); } } }
private JMenuItem createMenu() { JMenu menu = new JMenu(getMessage("PlatformNode.Change")); for (final RubyPlatform platform : RubyPlatformManager.getSortedPlatforms()) { JMenuItem item = new JMenuItem(platform.getLabel()); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { project.changeAndStorePlatform(platform); } catch (IOException ex) { LOGGER.log(Level.SEVERE, "Unable to change the platform: " + ex.getLocalizedMessage(), ex); } } }); menu.add(item); } return menu; } }
public boolean isDefault() { RubyPlatform defaultPlatform = RubyPlatformManager.getDefaultPlatform(); return defaultPlatform != null && interpreter.equals(defaultPlatform.getInterpreter()); }
private void refreshPlatformList() { if (platformsList.getModel().getSize() > 0) { platformsList.setSelectedIndex(0); if (lastSelectedPlatformID != null) { RubyPlatform lastPlaf = RubyPlatformManager.getPlatformByID(lastSelectedPlatformID); if (lastPlaf != null) { platformsList.setSelectedValue(lastPlaf, true); } } } refreshPlatform(); }
RubyPlatform platform = RubyPlatformManager.getDefaultPlatform(); if (platform != null) { String s = getGemHomeURL(platform);
activePlatformID = def.get(RubyProjectProperties.PLATFORM_ACTIVE); platforms.setSelectedItem(RubyPlatformManager.getPlatformByID(activePlatformID));
if (TEST_RUBY_PROPS != null && !RubyPlatformManager.getDefaultPlatform().getInterpreterFile().equals(interpreter)) { // tests return new Info(TEST_RUBY_PROPS);