class FPM::Fry::Source::Git::Cache
Public Class Methods
new(*_)
click to toggle source
Calls superclass method
# File lib/fpm/fry/source/git.rb, line 68 def initialize(*_) super update end
Public Instance Methods
cachekey()
click to toggle source
# File lib/fpm/fry/source/git.rb, line 59 def cachekey Exec::exec(package.git, "--git-dir=#{repodir}",'rev-parse','FETCH_HEAD^{tree}', logger: logger).chomp end
copy_to(dst)
click to toggle source
# File lib/fpm/fry/source/git.rb, line 52 def copy_to(dst) Exec[ package.git, "--git-dir=#{repodir}", "--work-tree=#{dst}",'checkout','FETCH_HEAD','--','*', chdir: dst, logger: logger ] end
prefix()
click to toggle source
# File lib/fpm/fry/source/git.rb, line 63 def prefix "" end
tar_io()
click to toggle source
# File lib/fpm/fry/source/git.rb, line 48 def tar_io Exec::popen(package.git, "--git-dir=#{repodir}",'archive','--format=tar','FETCH_HEAD', logger: logger) end
Private Instance Methods
repodir()
click to toggle source
# File lib/fpm/fry/source/git.rb, line 84 def repodir File.join(tempdir,File.basename(url.path)) end
update()
click to toggle source
# File lib/fpm/fry/source/git.rb, line 73 def update begin if !File.exist? repodir Exec::exec(package.git, "--git-dir=#{repodir}",'init', '--bare', description: "initializing git repository", logger: logger) end Exec::exec(package.git, "--git-dir=#{repodir}",'fetch','--depth=1', url.to_s, rev, description: 'fetching from remote', logger: logger) return self rescue => e raise CacheFailed.new(e, url: url.to_s, rev: rev) end end