diff --git a/lib/puppet/provider/package/gem.rb b/lib/puppet/provider/package/gem.rb
index <HASH>..<HASH> 100755
--- a/lib/puppet/provider/package/gem.rb
+++ b/lib/puppet/provider/package/gem.rb
@@ -20,7 +20,9 @@ Puppet::Type.type(:package).provide :gem, :parent => Puppet::Provider::Package d
     else
       gem_list_command << "--remote"
     end
-
+    if options[:source]
+      gem_list_command << "--source" << options[:source]
+    end
     if name = options[:justme]
       gem_list_command << name + "$"
     end
@@ -104,7 +106,9 @@ Puppet::Type.type(:package).provide :gem, :parent => Puppet::Provider::Package d
 
   def latest
     # This always gets the latest version available.
-    hash = self.class.gemlist(:justme => resource[:name])
+    gemlist_options = {:justme => resource[:name]}
+    gemlist_options.merge!({:source => resource[:source]}) unless resource[:source].nil?
+    hash = self.class.gemlist(gemlist_options)
 
     hash[:ensure][0]
   end
(#<I>) add --source to the gem list command

Without this patch the `gem list` command in the gem package provider
will search all package repositories.  This is a problem because the end
user is likely expecting Puppet to only search the specified repository
instead of all repositories.

This patch fixes the problem by passing the source parameter value onto
the gem list command as the `--source` command line option.

    Commit message amended by Jeff McCune <<EMAIL>>