<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -14,6 +14,12 @@ module Sprinkle
         
         @commands &lt;&lt; &quot;ruby -e \&quot;#{files.join(';')}\&quot;&quot;
       end
+      
+      # Checks if a gem exists by calling &quot;sudo gem list&quot; and grepping against it.
+      def has_gem(name, version=nil)
+        version = version.nil? ? '' : version.gsub('.', '\.')
+        @commands &lt;&lt; &quot;sudo gem list | grep -e '^#{name} (.*#{version}.*)$'&quot;
+      end
     end
   end
 end
\ No newline at end of file</diff>
      <filename>lib/sprinkle/verifiers/ruby.rb</filename>
    </modified>
    <modified>
      <diff>@@ -29,6 +29,10 @@ describe Sprinkle::Verify do
         
         # Check that ruby can include files
         ruby_can_load 'a', 'b', 'c'
+        
+        # Check that a gem exists
+        has_gem 'rails'
+        has_gem 'rails', '2.1.0'
       end
     end
     @verification = @package.verifications[0]
@@ -74,6 +78,11 @@ describe Sprinkle::Verify do
     it 'should check if ruby can include a, b, c' do
       @verification.commands.should include(&quot;ruby -e \&quot;require 'rubygems';require 'a';require 'b';require 'c'\&quot;&quot;)
     end
+    
+    it 'should check that a ruby gem is installed' do
+      @verification.commands.should include(&quot;sudo gem list | grep -e '^rails (.*.*)$'&quot;)
+      @verification.commands.should include(&quot;sudo gem list | grep -e '^rails (.*2\\.1\\.0.*)$'&quot;)
+    end
   end
   
   describe 'with configurations' do</diff>
      <filename>spec/sprinkle/verify_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>54e8a4f8817f511b16a16b611641ad898fa220dd</id>
    </parent>
  </parents>
  <author>
    <name>Mitchell Hashimoto</name>
    <email>mitchell.hashimoto@gmail.com</email>
  </author>
  <url>http://github.com/mitchellh/sprinkle/commit/1bea329def552526a9546fcd588cb59e7862070e</url>
  <id>1bea329def552526a9546fcd588cb59e7862070e</id>
  <committed-date>2008-07-20T16:14:54-07:00</committed-date>
  <authored-date>2008-07-20T16:14:54-07:00</authored-date>
  <message>Added has_gem verifier which verifiers a ruby gem is installed. An optional version parameter allows you to check for a specific version. Specs and RDoc included.</message>
  <tree>cd99958e431fb013796245ac098cbbd83e8127cd</tree>
  <committer>
    <name>Mitchell Hashimoto</name>
    <email>mitchell.hashimoto@gmail.com</email>
  </committer>
</commit>
