Crit::Models::Repository
Repository model class
Provides basic operations for Git repositories such as creation, existence checking, and listing. This class is responsible for the basic management of repositories, while actual Git operations are handled by the service layer.
Example
repo = Crit::Models::Repository.new("my-project")
if !repo.exists?
repo.create
end
Constants
Maximum length for repository names
Minimum length for repository names
Reserved repository names
Regular expression for repository name validation
Constructors
Class methods
Ensures the repository directory exists
@return [Boolean] True if the directory exists or was created successfully
Instance methods
Creates a new bare Git repository
@return [Boolean] True if the repository was created successfully, false otherwise @return [Boolean] False if the repository already exists
Deletes a repository directory
@return [Boolean] True if deleted successfully, false otherwise
Checks if the repository exists
@return [Boolean] True if the repository exists, false otherwise