You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
593 B
28 lines
593 B
require "sequel"
|
|
|
|
cfg_internal = IniConfig.new()
|
|
Sequel.connect(cfg_internal.get_db)
|
|
|
|
class Repos < Sequel::Model(:repos)
|
|
end
|
|
|
|
class DBase
|
|
attr :error, :last_id
|
|
|
|
def creategit(project_name, description)
|
|
@error = nil
|
|
data = Repos.where(reponame: project_name)
|
|
unless data.nil?
|
|
id = Repos.insert(reponame: project_name, descr: description, public: 1)
|
|
@last_id = id
|
|
else
|
|
@error = "Данный репозиторий уже существует"
|
|
end
|
|
@error
|
|
end
|
|
|
|
def get_repo_info_by_name(repo_name)
|
|
Repos.where(reponame: repo_name)
|
|
end
|
|
end
|