Class: Grably::ZipJob
- Inherits:
-
Object
- Object
- Grably::ZipJob
- Includes:
- Job
- Defined in:
- lib/grably/jobs/zip/zip.rb
Overview
TBD
Constant Summary collapse
- OPTIONS =
{ compression_level: ->(value) { "-r#{value}" } }.freeze
Instance Method Summary collapse
Methods included from Job
Instance Method Details
#build ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/grably/jobs/zip/zip.rb', line 20 def build if files.empty? warn 'No files to zip' return [] end log "Zipping #{files.size} files into #{File.basename(dst)}" src_dir = job_dir('src') ln(files, src_dir) zip(src_dir) end |
#cflags ⇒ Object
40 41 42 43 44 |
# File 'lib/grably/jobs/zip/zip.rb', line 40 def cflags OPTIONS .select { |k, _v| .key?(k) } .map { |k, _v| OPTIONS[k].call([k]) } end |
#setup(srcs, dst, meta = {}) ⇒ Object
14 15 16 17 18 |
# File 'lib/grably/jobs/zip/zip.rb', line 14 def setup(srcs, dst, = {}) @files = srcs @dst = dst @meta = end |