class Buildable

Attributes

commit[RW]
name[R]
repository[R]

Public Class Methods

new(name:, repository:, commit:) click to toggle source
# File lib/buildable.rb, line 5
def initialize(name:, repository:, commit:)
  @name = name.downcase
  @repository = repository
  @commit = commit
end

Public Instance Methods

checkout() { |source directory| ... } click to toggle source
# File lib/buildable.rb, line 11
def checkout  # :yields: source directory
  Dir.mktmpdir("#{name}-build") do |dir|
    system("git -C #{repository} archive #{commit} | tar -x -C #{dir}") or raise "Git error"
    yield dir
  end
end