Class: FPM::Fry::Source::Git::Cache

Inherits:
Struct
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/fpm/fry/source/git.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#packageObject

Returns the value of attribute package

Returns:

  • (Object)

    the current value of package



43
44
45
# File 'lib/fpm/fry/source/git.rb', line 43

def package
  @package
end

#tempdirObject

Returns the value of attribute tempdir

Returns:

  • (Object)

    the current value of tempdir



43
44
45
# File 'lib/fpm/fry/source/git.rb', line 43

def tempdir
  @tempdir
end

Instance Method Details

#cachekeyObject



59
60
61
# 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) ⇒ Object



52
53
54
55
56
57
# 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

#prefixObject



63
64
65
# File 'lib/fpm/fry/source/git.rb', line 63

def prefix
  ""
end

#tar_ioObject



48
49
50
# 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