public
Created

  • Download Gist
gistfile1.java
Java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
// first iteration: simple guard by version string
if(isRubyVersion("1.9.2-p136")){
// ....
}
 
// second iteration: Version object with semantic versioning, etc
RubyVersion v = version("1.9.2-p136");
 
v.major() // 1.9
v.minor() // 2
v.patchlevel() // 136
 
v.is1_9() // true (for compat)
 
v1 = version("1.9.2-p137");
 
v > v1 // false

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.