class Puppet::ModuleTool::Applications::Unpacker

Public Class Methods

new(filename, options = {}) click to toggle source
# File lib/puppet/module_tool/applications/unpacker.rb, line 8
def initialize(filename, options = {})
  @filename = Pathname.new(filename)
  parsed = parse_filename(filename)
  super(options)
  @module_dir = Pathname.new(options[:target_dir]) + parsed[:dir_name]
end

Public Instance Methods

build_dir() click to toggle source

Obtain a suitable temporary path for building and unpacking tarballs

@return [Pathname] path to temporary build location

# File lib/puppet/module_tool/applications/unpacker.rb, line 27
def build_dir
  Puppet::Forge::Cache.base_path + "tmp-unpacker-#{Digest::SHA1.hexdigest(@filename.basename.to_s)}"
end
run() click to toggle source
# File lib/puppet/module_tool/applications/unpacker.rb, line 15
def run
  extract_module_to_install_dir

  # Return the Pathname object representing the directory where the
  # module release archive was unpacked the to, and the module release
  # name.
  @module_dir
end