Sha256: 57c89f6827f67856d3e596bc0bd82c5b8737179d0e82bb52264de0899a4c59d2
Contents?: true
Size: 929 Bytes
Versions: 13
Compression:
Stored size: 929 Bytes
Contents
require 'picsolve_docker_builder/base' module PicsolveDockerBuilder module Builder # File helper to add files to tars class File include PicsolveDockerBuilder::Base attr_reader :path def initialize(path, opts = {}) @opts = opts @path = path end def content return @opts[:content] if @opts.key? :content return read_source if @opts.key? :source fail 'No content found' end def destination @opts[:destination] end def add_to_image? @opts.key? :destination end def source @opts[:source] end def mode ::File.stat(source).mode end def add_to_tar(tar) log.debug "add file from #{source} to #{path} in tar" tar.add_file path, mode do |tf| ::File.open(source, 'rb') { |f| tf.write f.read } end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems