This repository has been archived on 2022-01-17. You can view files and clone it, but cannot push or open issues/pull-requests.
packaging/src/backends.cr

27 lines
527 B
Crystal

abstract class Package::Backend::Packaging
getter name : String
def initialize(@name)
end
abstract def package(context : Context, package : Package) : Bool
def self.install(packages : Array(String))
raise "'install' unimplemented for this backend, yet"
end
def install(packages : Array(String))
self.install packages
end
end
class Package::Backend::Splitter
def initialize(&block : Proc(Recipe, Package))
@callback = block
end
def create_split(recipe : Recipe) : Package
@callback.call recipe
end
end