20 lines
372 B
Ruby
20 lines
372 B
Ruby
class RepoManager
|
|
attr :path, :error, :last_status, :last_pid
|
|
|
|
def initialize(path)
|
|
@error = nil
|
|
unless File.exist? (path)
|
|
Dir.mkdir(path)
|
|
end
|
|
@path = path
|
|
end
|
|
|
|
def create_repo
|
|
%x(/usr/bin/createrepo_c --database --workers 1 "#{@path}")
|
|
result = $?
|
|
@last_status = result.exitstatus
|
|
@last_pid = result.pid
|
|
result
|
|
end
|
|
end
|