How can I get the version of a gem using just Ruby? I’d rather not use a system call and grep it the shells output like:
`gem search passenger`.scan(/(?:\(|, *)([^,)]*)/).flatten.first
=> "2.2.9"
Can’t I just get it somehow with:
Gem::Version
I just don’t know how to specify the gem I want, like in this case I want to get the Passenger gem’s newest version.
This should help get you on your way. This searches the remote index for the latest version of a specific gem.