private static String initOperatingSystem() { String osname = getProperty("os.name", "unknown").toLowerCase(); switch (osname) { case "mac os x" /* "Mac OS X" */ : return DARWIN; } if (osname.startsWith("windows")) { return WINDOWS; } if (osname.startsWith("sunos")) { return SOLARIS; } return osname; }
@JRubyMethod(name = "groups", module = true, visibility = PRIVATE) public static IRubyObject groups(IRubyObject recv) { long[] groups = Platform.getPlatform().getGroups(recv); RubyArray ary = RubyArray.newArray(recv.getRuntime(), groups.length); for(int i = 0; i < groups.length; i++) { ary.push(RubyFixnum.newFixnum(recv.getRuntime(), groups[i])); } return ary; }
@JRubyMethod(name = "groups", module = true, visibility = PRIVATE) public static IRubyObject groups(IRubyObject recv) { long[] groups = Platform.getPlatform().getGroups(recv); RubyArray ary = RubyArray.newArray(recv.getRuntime(), groups.length); for(int i = 0; i < groups.length; i++) { ary.push(RubyFixnum.newFixnum(recv.getRuntime(), groups[i])); } return ary; }
private static String initOperatingSystem() { String osname = getProperty("os.name", "unknown").toLowerCase(); switch (osname) { case "mac os x" /* "Mac OS X" */ : return DARWIN; } if (osname.startsWith("windows")) { return WINDOWS; } if (osname.startsWith("sunos")) { return SOLARIS; } return osname; }
private static String initOperatingSystem() { String osname = getProperty("os.name", "unknown").toLowerCase(); for (String s : OS_NAMES.keySet()) { if (s.equalsIgnoreCase(osname)) { return OS_NAMES.get(s); } } if (osname.startsWith("windows")) { return WINDOWS; } return osname; } private static String initArchitecture() {
private static String initOperatingSystem() { String osname = getProperty("os.name", "unknown").toLowerCase(); for (String s : OS_NAMES.keySet()) { if (s.equalsIgnoreCase(osname)) { return OS_NAMES.get(s); } } if (osname.startsWith("windows")) { return WINDOWS; } return osname; } private static String initArchitecture() {
private static String initArchitecture() { String arch = getProperty("os.arch", "unknown").toLowerCase(); switch (arch) { case "x86" : return "i386"; case "universal" : // OS X OpenJDK7 builds used to report "universal" String bits = SafePropertyAccessor.getProperty("sun.arch.data.model"); if ("32".equals(bits)) { System.setProperty("os.arch", "i386"); arch = "i386"; } else if ("64".equals(bits)) { System.setProperty("os.arch", "x86_64"); arch = "x86_64"; } } return arch; }
private static String initArchitecture() { String arch = getProperty("os.arch", "unknown").toLowerCase(); switch (arch) { case "x86" : return "i386"; case "universal" : // OS X OpenJDK7 builds used to report "universal" String bits = SafePropertyAccessor.getProperty("sun.arch.data.model"); if ("32".equals(bits)) { System.setProperty("os.arch", "i386"); arch = "i386"; } else if ("64".equals(bits)) { System.setProperty("os.arch", "x86_64"); arch = "x86_64"; } } return arch; }
private static String initArchitecture() { String arch = getProperty("os.arch", "unknown").toLowerCase(); for (String s : ARCH_NAMES.keySet()) { if (s.equalsIgnoreCase(arch)) { return ARCH_NAMES.get(s); } } if ("universal".equals(arch)) { // OS X OpenJDK7 builds report "universal" right now String bits = SafePropertyAccessor.getProperty("sun.arch.data.model"); if ("32".equals(bits)) { System.setProperty("os.arch", "i386"); arch = "i386"; } else if ("64".equals(bits)) { System.setProperty("os.arch", "x86_64"); arch = "x86_64"; } } return arch; } public static final String ARCH = initArchitecture();
private static String initArchitecture() { String arch = getProperty("os.arch", "unknown").toLowerCase(); for (String s : ARCH_NAMES.keySet()) { if (s.equalsIgnoreCase(arch)) { return ARCH_NAMES.get(s); } } if ("universal".equals(arch)) { // OS X OpenJDK7 builds report "universal" right now String bits = SafePropertyAccessor.getProperty("sun.arch.data.model"); if ("32".equals(bits)) { System.setProperty("os.arch", "i386"); arch = "i386"; } else if ("64".equals(bits)) { System.setProperty("os.arch", "x86_64"); arch = "x86_64"; } } return arch; } public static final String ARCH = initArchitecture();