/** * Helper method delegating to {@link RubyPlatform#platformFor(Project)}. * * @return platform for this project; might be <tt>null</tt> */ public RubyPlatform getPlatform() { return RubyPlatform.platformFor(this); }
private RubyPlatform getPlatform() { return RubyPlatform.platformFor(project); }
public static GemChildrenFactory create(RubyBaseProject project) { RubyPlatform platform = RubyPlatform.platformFor(project); GemChildrenFactory result = new GemChildrenFactory(platform); return result; }
protected RubyPlatform getPlatform() { RubyPlatform platform = RubyPlatform.platformFor(project); if (platform == null) { platform = RubyPlatformManager.getDefaultPlatform(); } return platform; }
private void installGeneratorsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_installGeneratorsButtonActionPerformed // Bring up remote gem installer with a "generator" filter boolean changed = GemAction.showGemManager(RubyPlatform.platformFor(project), "generator$"); // NOI18N if (changed) { run(); } }//GEN-LAST:event_installGeneratorsButtonActionPerformed
public static boolean isInstalled(final Project project, TestRunner.TestType type) { RubyPlatform platform = RubyPlatform.platformFor(project); if (platform == null) { return false; } if (type == TestRunner.TestType.AUTOTEST) { return platform.hasValidAutoTest(false); } else if (type == TestRunner.TestType.AUTOSPEC) { return platform.hasValidAutoSpec(false); } return false; }
/** * Tries to find a {@link GemManager gem manager} for a given project, or * strictly speaking, for its {@link RubyPlatform platform}. Might return * <tt>null</tt>. */ @CheckForNull public static GemManager gemManagerFor(final Project project) { RubyPlatform platform = RubyPlatform.platformFor(project); return platform == null ? null : platform.getGemManager(); }
/** * Checks whether project has a valid platform and in turn whether the * platform has a valid Rake installed. * * @param warn whether to show warning message to the user if ther is no * valid Rake installed */ public static boolean hasValidRake(final Project project, final boolean warn) { RubyPlatform platform = RubyPlatform.platformFor(project); if (platform == null) { if (warn) { showWarning(project); } return false; } return platform.hasValidRake(warn); }
public void editConfig(RailsProject project) { RubyPlatform platform = RubyPlatform.platformFor(project); if (platform.isJRuby()) { // only need extra config when using JRuby uncommentTcpIpConfig(project.getProjectDirectory()); } }
public void editConfig(RailsProject project) { RubyPlatform platform = RubyPlatform.platformFor(project); if (platform.isJRuby()) { // as of 1.1 RC2 JRuby apparently supports socket, but commenting it // out still using 127.0.0.1 rather than localhost for the reasons // described in issue #131024 RailsAdapters.commentOutSocket(project.getProjectDirectory(), "127.0.0.1"); //NOI18N } }
@CheckForNull public static String platformDescriptionFor(Project project) { RubyPlatform platform = platformFor(project); return platform == null ? null : platform.getInfo().getLongDescription(); }
public void editConfig(RailsProject project) { RubyPlatform platform = RubyPlatform.platformFor(project); if (platform.isJRuby()) { // JRuby doesn't support socket RailsAdapters.commentOutSocket(project.getProjectDirectory(), "localhost"); //NOI18N } }
RubyPlatform platform = RubyPlatform.platformFor(project); if (railsInstall == null && !platform.hasValidRails(true)) { LOGGER.warning("No valid Rails installation found, platform is:" + RubyPlatform.platformFor(project)); return;
public void run() { // Refresh generator list RubyPlatform.platformFor(project).recomputeRoots(); typeCombo.setModel(getTypeModel()); typeCombo.invalidate(); typeCombo.repaint(); Generator generator = getSelectedGenerator(); if (generator != Generator.NONE) { showGenerator(generator); } }
private void initProjectInfo() { FileObject fo = element.getFileObject(); if (fo != null) { File f = FileUtil.toFile(fo); Project p = FileOwnerQuery.getOwner(fo); if (p != null) { RubyPlatform platform = RubyPlatform.platformFor(p); if (platform != null) { String lib = platform.getLibDir(); if (lib != null && f.getPath().startsWith(lib)) { projectName = "Ruby Library"; isLibrary = true; } } else { // TODO - check to see if we're a library - and if so include the language icon ProjectInformation pi = ProjectUtils.getInformation(p); projectName = pi.getDisplayName(); projectIcon = pi.getIcon(); } } } else { isLibrary = true; Logger.getLogger(RubyTypeSearcher.class.getName()).fine("No fileobject for " + element.toString() + " with fileurl=" + element.getFileUrl()); } if (projectName == null) { projectName = ""; } }
Project p = lookup.lookup(Project.class); if (!RubyPlatform.platformFor(p).showWarningIfInvalid()) { return;
/** * Runs 'rake -D' and returns the output. * * @param project project for which tasks are read * @return rake output; might be <tt>null</tt> when underlying rake command fails. */ private static String readRakeTasksOutput(final Project project, boolean warn) { File pwd; FileObject rakeFile = RakeSupport.findRakeFile(project); if (rakeFile == null) { pwd = FileUtil.toFile(project.getProjectDirectory()); } else { pwd = FileUtil.toFile(rakeFile.getParent()); } // Install the given gem RubyPlatform platform = RubyPlatform.platformFor(project); return dumpRakeTasksInfo(platform, pwd, warn); // TODO: we are not able to parse complex Rakefile (e.g. rails'), using -P argument, yet // sb.append(hiddenRakeRunner(cmd, rakeCmd, pwd, "-P")); }
public void performAction() { RubyBaseProject project = Util.inferRubyProject(); if (project == null) { return; } RubyPlatform platform = RubyPlatform.platformFor(project); if (platform == null) { org.netbeans.modules.ruby.platform.Util.notifyLocalized( RakeRunnerAction.class, "RakeRunnerAction.no.platform.for.project", // NOI18N ProjectUtils.getInformation(project).getDisplayName(), NotifyDescriptor.WARNING_MESSAGE); return; } if (!platform.showWarningIfInvalid()) { return; } TaskDescriptor taskDesc = RakeTaskChooser.select(project); if (taskDesc != null && taskDesc.getRakeTask() != null) { RakeRunner.runTask(project, taskDesc.getRakeTask(), taskDesc.getTaskParams(), taskDesc.isDebug()); } }
return new Ruby18Parser(); RubyPlatform platform = RubyPlatform.platformFor(owner); if (platform == null) { return new Ruby18Parser();
RubyPlatform platform = RubyPlatform.platformFor(project); if (!platform.hasValidAutoTest(true)) { return;