diff --git a/lib/puppet/provider/rvm_gem/gem.rb b/lib/puppet/provider/rvm_gem/gem.rb index 704c20b0..74987a58 100644 --- a/lib/puppet/provider/rvm_gem/gem.rb +++ b/lib/puppet/provider/rvm_gem/gem.rb @@ -76,6 +76,15 @@ def self.gemsplit(desc) end end + def gemfile_from_puppet_url(source) + unless tmp = Puppet::FileServing::Content.indirection.find(source, :environment => resource.catalog.environment_instance, :links => :follow) + fail "Could not find gemfile at %s" % source + end + tmpfile = Tempfile.open(['puppet-rvm_geminstaller','.gem']) + tmpfile.write(tmp.content) + tmpfile.flush + return tmpfile.path.to_s + end def install(useversion = true) command = gembinary + ['install'] @@ -102,8 +111,7 @@ def install(useversion = true) when /file/i command << uri.path when 'puppet' - # we don't support puppet:// URLs (yet) - raise Puppet::Error.new("puppet:// URLs are not supported as gem sources") + command << gemfile_from_puppet_url(uri.to_s) else # interpret it as a gem repository command << "--source" << "#{source}" << resource[:name]