Info info = new Info("User-specified Ruby", "0.1"); // NOI18N props.setProperty(Info.GEM_VERSION, "1.0.1 (1.0.1)"); // NOI18N props.setProperty(Info.RUBY_LIB_DIR, new File(new File(hardcodedRuby).getParentFile().getParentFile(), "lib" + File.separator + "ruby" + File.separator + "1.8").getPath()); // NOI18N info = new Info(props); props.put(Info.GEM_VERSION, p.get(PLATFORM_PREFIX + idDot + Info.GEM_VERSION)); Info info = new Info(props); platforms.add(new RubyPlatform(id, interpreterPath, info)); foundDefault |= id.equals(PLATFORM_ID_DEFAULT);
assert !EventQueue.isDispatchThread() : "computeInfo should not be run from EDT"; if (TEST_RUBY_PROPS != null && !RubyPlatformManager.getDefaultPlatform().getInterpreterFile().equals(interpreter)) { // tests return new Info(TEST_RUBY_PROPS); props.load(proc.getInputStream()); info = new Info(props); } else { LOGGER.severe(interpreter.getAbsolutePath() + " does not seems to be a valid interpreter"); // TODO localize me
static Info forDefaultPlatform() { // NbBundle.getMessage(RubyPlatformManager.class, "CTL_BundledJRubyLabel") Info info = new Info("JRuby", "1.8.7"); // NOI18N info.jversion = "1.5.1"; // NOI18N info.patchlevel = "249"; // NOI18N // XXX this is dynamically generated during JRuby build, should be // fixed by not hardcoding the default platform info, but rather // computing as for other platforms info.releaseDate = "2010-05-12"; // NOI18N info.platform = "java"; // NOI18N File jrubyHome = InstalledFileLocator.getDefault().locate( "jruby-1.5.1", "org.netbeans.modules.ruby.platform", false); // NOI18N // XXX handle valid case when it is not available, see #124534 assert (jrubyHome != null && jrubyHome.isDirectory()) : "Default platform available"; FileObject libDirFO = FileUtil.toFileObject(jrubyHome).getFileObject("/lib/ruby"); // NOI18N info.libDir = FileUtil.toFile(libDirFO.getFileObject("/1.8")).getAbsolutePath(); // NOI18N info.gemHome = FileUtil.toFile(libDirFO.getFileObject("/gems/1.8")).getAbsolutePath(); // NOI18N info.gemPath = info.gemHome; info.gemVersion = "1.3.6"; // NOI18N return info; }