class GitCompound::Repository::RemoteFile::GitArchiveStrategy
Git archive strategy
Public Class Methods
new(source, ref, file)
click to toggle source
Calls superclass method
# File lib/git_compound/repository/remote_file/git_archive_strategy.rb, line 7 def initialize(source, ref, file) super opts = "--format=tar --remote=#{@source} #{@ref} -- #{@file} | tar -O -xf -" @command = GitCommand.new(:archive, opts) @command.execute! end
Public Instance Methods
contents()
click to toggle source
# File lib/git_compound/repository/remote_file/git_archive_strategy.rb, line 14 def contents raise FileUnreachableError unless reachable? raise FileNotFoundError unless exists? @command.output end
exists?()
click to toggle source
# File lib/git_compound/repository/remote_file/git_archive_strategy.rb, line 24 def exists? @command.valid? end
reachable?()
click to toggle source
# File lib/git_compound/repository/remote_file/git_archive_strategy.rb, line 20 def reachable? @command.valid? || @command.output.include?('did not match any files') end