class
Crit::Services::RepoService
- Crit::Services::RepoService
- Reference
- Object
Overview
Repository service class
Provides Git-specific operations for repositories such as listing files, getting file content, and listing branches. This service layer interacts with Git commands to perform operations on repositories.
Example
# List files in a repository
files = Crit::Services::RepoService.list_files("my-project", "master")
Defined in:
services/repo_service.crClass Method Summary
-
.get_file_content(repo_name : String, ref : String = "master", path : String = "")
Gets file content for a specific file in a repository
-
.list_branches(repo_name : String)
Gets list of branches for a repository
-
.list_files(repo_name : String, ref : String = "master", path : String = "")
Gets file listing for a repository at a specific path and reference
Class Method Detail
Gets file content for a specific file in a repository
@param repo_name [String] The name of the repository @param ref [String] The Git reference (branch, tag, or commit) @param path [String] The path to the file within the repository @return [String] The content of the file @return [Nil] If the repository or file doesn't exist
Gets list of branches for a repository
@param repo_name [String] The name of the repository
@return [Array
Gets file listing for a repository at a specific path and reference
@param repo_name [String] The name of the repository @param ref [String] The Git reference (branch, tag, or commit) @param path [String] The path within the repository @return [Array<{type: String, mode: String, hash: String, name: String}>] Array of file entries @return [Nil] If the repository or path doesn't exist