title: Verify version of a gem with bundler from inside Ruby
body: <p>Is there a way to verify that I have the latest version of a gem from inside a Ruby program? That is, is there a way to do <code>bundle outdated #{gemname}</code> programmatically?</p>
  
  <p>I tried looking at bundler's source code but I couldn't find a straight-forward way. Currently I'm doing this, which is fragile, slow and so inelegant:</p>
  
  <pre><code>IO.popen(%w{/usr/bin/env bundle outdated gemname}) do |proc|
    output = proc.readlines.join("\n")
    return output.include?("Your bundle is up to date!")
  end
  </code></pre>