Sha256: 99abad7395f5a3799927c55585cac0991850dac219b8a58136498fd95af60131

Contents?: true

Size: 1.14 KB

Versions: 20

Compression:

Stored size: 1.14 KB

Contents

Puppet::Type.type(:package).provide :puppet_gem, :parent => :gem do
  desc "Puppet Ruby Gem support. This provider is useful for managing
        gems needed by the ruby provided in the puppet-agent package."

  has_feature :versionable, :install_options, :uninstall_options

  confine :true => Facter.value(:aio_agent_version)

  def self.windows_gemcmd
    puppet_dir = Puppet::Util.get_env('PUPPET_DIR')
    if puppet_dir
      File.join(Puppet::Util.get_env('PUPPET_DIR').to_s, 'bin', 'gem.bat')
    else
      File.join(Gem.default_bindir, 'gem.bat')
    end
  end

  if Puppet::Util::Platform.windows?
    commands :gemcmd => windows_gemcmd
  else
    commands :gemcmd => "/opt/puppetlabs/puppet/bin/gem"
  end

  def uninstall
    super
    Puppet.debug("Invalidating rubygems cache after uninstalling gem '#{resource[:name]}'")
    Puppet::Util::Autoload.gem_source.clear_paths
  end

  def self.execute_gem_command(command, command_options, custom_environment = {})
    custom_environment['PKG_CONFIG_PATH'] = '/opt/puppetlabs/puppet/lib/pkgconfig' unless Puppet::Util::Platform.windows?
    super(command, command_options, custom_environment)
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
puppet-7.10.0 lib/puppet/provider/package/puppet_gem.rb
puppet-7.10.0-x86-mingw32 lib/puppet/provider/package/puppet_gem.rb
puppet-7.10.0-x64-mingw32 lib/puppet/provider/package/puppet_gem.rb
puppet-7.10.0-universal-darwin lib/puppet/provider/package/puppet_gem.rb
puppet-7.9.0 lib/puppet/provider/package/puppet_gem.rb
puppet-7.9.0-x86-mingw32 lib/puppet/provider/package/puppet_gem.rb
puppet-7.9.0-x64-mingw32 lib/puppet/provider/package/puppet_gem.rb
puppet-7.9.0-universal-darwin lib/puppet/provider/package/puppet_gem.rb
puppet-7.8.0 lib/puppet/provider/package/puppet_gem.rb
puppet-7.8.0-x86-mingw32 lib/puppet/provider/package/puppet_gem.rb
puppet-7.8.0-x64-mingw32 lib/puppet/provider/package/puppet_gem.rb
puppet-7.8.0-universal-darwin lib/puppet/provider/package/puppet_gem.rb
puppet-7.7.0 lib/puppet/provider/package/puppet_gem.rb
puppet-7.7.0-x86-mingw32 lib/puppet/provider/package/puppet_gem.rb
puppet-7.7.0-x64-mingw32 lib/puppet/provider/package/puppet_gem.rb
puppet-7.7.0-universal-darwin lib/puppet/provider/package/puppet_gem.rb
puppet-7.6.1 lib/puppet/provider/package/puppet_gem.rb
puppet-7.6.1-x86-mingw32 lib/puppet/provider/package/puppet_gem.rb
puppet-7.6.1-x64-mingw32 lib/puppet/provider/package/puppet_gem.rb
puppet-7.6.1-universal-darwin lib/puppet/provider/package/puppet_gem.rb