Skip to content

Commit

Permalink
Fix JRUBY-6551: Incorrect Ruby compatibility description displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
BanzaiMan committed Mar 17, 2012
1 parent 1a3976e commit 693da51
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/org/jruby/util/cli/OutputStrings.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,31 +106,29 @@ public static String getPropertyHelp() {
}

public static String getVersionString(CompatVersion compatVersion) {
String ver = null;
String ver;
String patchDelimeter = "-p";
int patchlevel = 0;
int patchlevel;
String versionString = "";
switch (compatVersion) {
case RUBY1_8:
ver = Constants.RUBY_VERSION;
patchlevel = Constants.RUBY_PATCHLEVEL;
versionString = String.format("ruby-%s%s%d", ver, patchDelimeter, patchlevel);
break;
case RUBY1_9:
ver = Constants.RUBY1_9_VERSION;
patchlevel = Constants.RUBY1_9_PATCHLEVEL;
versionString = String.format("ruby-%s%s%d", ver, patchDelimeter, patchlevel);
break;
case RUBY2_0:
return String.format(
"jruby %s (ruby-%s) (%s %s) (%s %s) [%s-%s-java]",
Constants.VERSION, Constants.RUBY2_0_VERSION,
Constants.COMPILE_DATE, Constants.REVISION,
System.getProperty("java.vm.name"), System.getProperty("java.version"),
Platform.getOSName(),
SafePropertyAccessor.getProperty("os.arch", "unknown")
);
versionString = String.format("ruby-%s", Constants.RUBY2_0_VERSION);
break;
}

String fullVersion = String.format(
"jruby %s (ruby-%s%s%d) (%s %s) (%s %s) [%s-%s-java]",
Constants.VERSION, ver, patchDelimeter, patchlevel,
"jruby %s (%s) (%s %s) (%s %s) [%s-%s-java]",
Constants.VERSION, versionString,
Constants.COMPILE_DATE, Constants.REVISION,
System.getProperty("java.vm.name"), System.getProperty("java.version"),
Platform.getOSName(),
Expand Down

0 comments on commit 693da51

Please sign in to comment.