blob: ec41b7952467d4d4add1f8c8afd54a4b88f33867 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
module NamesHelper
def extract_repo_name(path)
repo_name = path.strip
repo_name.gsub!(/\.git$/, "")
repo_name.gsub!(/^\//, "")
repo_name.split(File::SEPARATOR).last(2).join(File::SEPARATOR)
end
def extract_ref_name(ref)
ref.gsub(/\Arefs\/(tags|heads)\//, '')
end
end
|