Sha256: 5c7499944753363fcafa1f32793e1644d6c50dc723edc7b477b5213bd6f132ac

Contents?: true

Size: 634 Bytes

Versions: 1

Compression:

Stored size: 634 Bytes

Contents

require "fileutils"

module Mandy
  class Packer
    TMP_DIR = '/tmp/mandy'
    
    def self.pack(dir)
      return dir if File.file?(dir)
      FileUtils.mkdir_p(TMP_DIR)
      tmp_path = "#{TMP_DIR}/packed-job-#{Time.now.to_i}.tar"
      Dir.chdir(dir) { `tar -cf #{tmp_path} *` }
      tmp_path
    end
    
    def self.unpack(file)
      return false unless File.extname(file) == '.tar'
      `tar -xf #{file}`
    end
    
    def self.cleanup!(file)
      return false unless File.extname(file) == '.tar'
      `rm #{file}`
    end
  end
end

Mandy::Packer.unpack(ARGV[0])

exec("bin/mandy-#{ARGV[1]} #{ARGV[2]} '#{ARGV[3]}'")

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mandy-0.3.5 bootstrap.rb