Sha256: 68f731498424b2a4d2421989fa93c6d806eabf0a27032b6db605cf4c5f1993e7
Contents?: true
Size: 754 Bytes
Versions: 8
Compression:
Stored size: 754 Bytes
Contents
module GitCompound module Repository class RemoteFile # Git archive strategy # class GitArchiveStrategy < RemoteFileStrategy def initialize(source, ref, file) super opts = "--format=tar --remote=#{@source} #{@ref} -- #{@file} | tar -O -xf -" @command = GitCommand.new(:archive, opts) @command.execute! end def contents raise FileUnreachableError unless reachable? raise FileNotFoundError unless exists? @command.output end def reachable? @command.valid? || @command.output.include?('did not match any files') end def exists? @command.valid? end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems