Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
/** * JRuby version, assumes the version to be of format major.minor.suffix */ private static class JRubyVersion { private final int major, minor, suffix; public JRubyVersion() { this(org.jruby.runtime.Constants.VERSION); } private JRubyVersion(String version) { int i = version.lastIndexOf('.'); if (i != -1) { suffix = Integer.parseInt(version.substring(i + 1, version.length())); int j = version.substring(0, i).lastIndexOf('.'); if (j != -1) { minor = Integer.parseInt(version.substring(j + 1, i)); if (j != 0) major = Integer.parseInt(version.substring(0, j)); else major = 0; } else { minor = 0; major = 1; } } else { major = minor = suffix = 0; } }
This paste will be private.
From the Design Piracy series on my blog: