Sha256: 80f426bf4a4ceddd2f74d53fd0962d7006db35c486e898606ea4dcf3b296f709
Contents?: true
Size: 450 Bytes
Versions: 2
Compression:
Stored size: 450 Bytes
Contents
module Stan class Compressor attr_reader :path, :output, :size def initialize(dir) @tempdir = ENV.fetch('STAN_TEMP_DIR') @path = File.path(dir) end def compress FileUtils.mkdir_p(@tempdir) date = DateTime.now.strftime('%Y%m%d%H%M%S') @output = "#{@tempdir}/#{date}.tar.gz" Dir.chdir(path) do `tar -czf #{output} .` end @size = File.size(output) / 2**20 end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
stan-0.2.0 | lib/stan/compressor.rb |
stan-0.1.0 | lib/stan/compressor.rb |