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_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());
}
}