Skip to content

Instantly share code, notes, and snippets.

@qmx
Created April 14, 2011 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qmx/920308 to your computer and use it in GitHub Desktop.
Save qmx/920308 to your computer and use it in GitHub Desktop.
// 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment