Sha256: 77d489f4916cd8a7b4480fc83301282387870abd224a5b45887d2c162217b299

Contents?: true

Size: 628 Bytes

Versions: 4

Compression:

Stored size: 628 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])

`bin/mandy-#{ARGV[1]} #{ARGV[2]} '#{ARGV[3]}'`

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mandy-0.3.4 bootstrap.rb
mandy-0.3.3 bootstrap.rb
mandy-0.3.2 bootstrap.rb
mandy-0.3.1 bootstrap.rb