Librarian::Puppet::Source::Git

Public Instance Methods

cache!() click to toggle source
# File lib/librarian/puppet/source/git.rb, line 27
def cache!
  return vendor_checkout! if vendor_cached?

  if environment.local?
    raise Error, "Could not find a local copy of #{uri} at #{sha}."
  end

  super

  cache_in_vendor(repository.path) if environment.vendor?
end
cache_in_vendor(tmp_path) click to toggle source
# File lib/librarian/puppet/source/git.rb, line 56
def cache_in_vendor(tmp_path)
  run!(%{git archive #{sha} | gzip > #{vendor_tgz}}, :chdir => tmp_path.to_s)
end
vendor_cached?() click to toggle source
# File lib/librarian/puppet/source/git.rb, line 43
def vendor_cached?
  vendor_tgz.exist?
end
vendor_checkout!() click to toggle source
# File lib/librarian/puppet/source/git.rb, line 47
def vendor_checkout!
  repository.path.rmtree if repository.path.exist?
  repository.path.mkpath

  run!(%{tar xzf #{vendor_tgz}}, :chdir => repository.path.to_s)

  repository_cached!
end
vendor_tgz() click to toggle source
# File lib/librarian/puppet/source/git.rb, line 39
def vendor_tgz
  environment.vendor_source + "#{sha}.tar.gz"
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.