    # File lib/facets/core/fileutils/stage.rb, line 72
        def stage( keys )
          keys = keys.rekey(:to_s)

          name    = keys['name']   || File.basename(Dir.pwd)
          files   = keys['files']  || '**/*'
          rules   = keys['rules']  || ''
          source  = keys['source'] || Dir.pwd
          vars    = keys['vars']   || {}

          raise ArgumentError, "missing argument -- name" unless name

          files = [files].flatten.compact

          # Work folder where all work on this package is being done.
          work_folder = File.join(Dir.tmpdir, $0.gsub(/W/,''), 'stage')

          # Where files are copied recreating an image of the local package.
          stage_folder ||= File.join(work_folder, name)

          # allocate temporary work space
          if FileTest.directory?(work_folder)
            rm_r(work_folder) #unless $DRYRUN
          end
          mkdir_p(work_folder)

          # source (typically the current directory).
          #source_folder = File.expand_path( source.chomp('/') )

          # TODO Should dirs include all subfiles? Currently yes.
          files = Dir.chdir(source) do
            Dir.multiglob_recurse(*files)
          end

          # preformat transfer rules
          trans = transfer_rules(source, rules, vars)

          # create staging package
          transfer_files(source, files, trans, stage_folder)

          return stage_folder
        end