Module: Puppet::ModuleTool::Tar

Defined in:
lib/puppet/module_tool/tar.rb

Defined Under Namespace

Classes: Gnu, Mini, Solaris

Class Method Summary collapse

Class Method Details

.instance(module_name) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/puppet/module_tool/tar.rb', line 6

def self.instance(module_name)
  gtar_platforms = ['Solaris', 'OpenBSD']
  if gtar_platforms.include?(Facter.value('osfamily')) && Puppet::Util.which('gtar')
    Solaris.new
  elsif Puppet::Util.which('tar') && ! Puppet::Util::Platform.windows?
    Gnu.new
  elsif Puppet.features.minitar? && Puppet.features.zlib?
    Mini.new(module_name)
  else
    raise RuntimeError, 'No suitable tar implementation found'
  end
end