private static void putPlatformProperties(final String id, final File interpreter, final Info info, final EditableProperties props) throws FileNotFoundException { String interpreterKey = PLATFORM_PREFIX + id + PLATFORM_INTEPRETER; props.setProperty(interpreterKey, interpreter.getAbsolutePath()); if (!interpreter.isFile()) { throw new FileNotFoundException(interpreter.getAbsolutePath()); } String idDot = id + '.'; props.setProperty(PLATFORM_PREFIX + idDot + Info.RUBY_KIND, info.getKind()); props.setProperty(PLATFORM_PREFIX + idDot + Info.RUBY_VERSION, info.getVersion()); if (info.getJVersion() != null) { props.setProperty(PLATFORM_PREFIX + idDot + Info.JRUBY_VERSION, info.getJVersion()); } if (info.getPatchlevel() != null) { props.setProperty(PLATFORM_PREFIX + idDot + Info.RUBY_PATCHLEVEL, info.getPatchlevel()); } props.setProperty(PLATFORM_PREFIX + idDot + Info.RUBY_RELEASE_DATE, info.getReleaseDate()); // props.setProperty(PLATFORM_PREFIX + idDot + Info.RUBY_EXECUTABLE, info.getExecutable()); props.setProperty(PLATFORM_PREFIX + idDot + Info.RUBY_PLATFORM, info.getPlatform()); if (!info.isRubinius()) { props.setProperty(PLATFORM_PREFIX + idDot + Info.RUBY_LIB_DIR, info.getLibDir()); } if (info.getGemHome() != null) { props.setProperty(PLATFORM_PREFIX + idDot + Info.GEM_HOME, info.getGemHome()); props.setProperty(PLATFORM_PREFIX + idDot + Info.GEM_PATH, info.getGemPath()); props.setProperty(PLATFORM_PREFIX + idDot + Info.GEM_VERSION, info.getGemVersion()); } }
public String getVersion() { return info.getVersion(); }
/** * 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(); }