title: How to access the version of a gem from within Ruby?
body: <p>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:</p>
  
  <pre><code>`gem search passenger`.scan(/(?:\(|, *)([^,)]*)/).flatten.first
  =&gt; "2.2.9"
  </code></pre>
  
  <p>Can't I just get it somehow with:</p>
  
  <pre><code>Gem::Version
  </code></pre>
  
  <p>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.</p>