Class: Gitlab::Repositories::RepoType
- Inherits:
-
Object
- Object
- Gitlab::Repositories::RepoType
show all
- Defined in:
- lib/gitlab/repositories/repo_type.rb
Instance Method Summary
collapse
Instance Method Details
#access_checker_class ⇒ Object
10
11
12
|
# File 'lib/gitlab/repositories/repo_type.rb', line 10
def access_checker_class
raise NotImplementedError, 'Define an access_checker_class in a RepoType subclass'
end
|
#container_class ⇒ Object
20
21
22
|
# File 'lib/gitlab/repositories/repo_type.rb', line 20
def container_class
raise NotImplementedError, 'Define a container_class in a RepoType subclass'
end
|
#design? ⇒ Boolean
44
45
46
|
# File 'lib/gitlab/repositories/repo_type.rb', line 44
def design?
name == :design
end
|
#guest_read_ability ⇒ Object
14
15
16
|
# File 'lib/gitlab/repositories/repo_type.rb', line 14
def guest_read_ability
raise NotImplementedError, 'Define a guest_read_ability in a RepoType subclass'
end
|
#identifier_for_container(container) ⇒ Object
28
29
30
|
# File 'lib/gitlab/repositories/repo_type.rb', line 28
def identifier_for_container(container)
"#{name}-#{container.id}"
end
|
#name ⇒ Object
6
7
8
|
# File 'lib/gitlab/repositories/repo_type.rb', line 6
def name
raise NotImplementedError, 'Define a name in a RepoType subclass'
end
|
#path_suffix ⇒ Object
48
49
50
|
# File 'lib/gitlab/repositories/repo_type.rb', line 48
def path_suffix
suffix ? ".#{suffix}" : ''
end
|
#project? ⇒ Boolean
36
37
38
|
# File 'lib/gitlab/repositories/repo_type.rb', line 36
def project?
name == :project
end
|
#project_for(container) ⇒ Object
59
60
61
|
# File 'lib/gitlab/repositories/repo_type.rb', line 59
def project_for(container)
raise NotImplementedError, 'Define a project_for in a RepoType subclass'
end
|
#repository_for(container) ⇒ Object
52
53
54
55
56
57
|
# File 'lib/gitlab/repositories/repo_type.rb', line 52
def repository_for(container)
check_container(container)
return unless container
repository_resolver(container)
end
|
#snippet? ⇒ Boolean
40
41
42
|
# File 'lib/gitlab/repositories/repo_type.rb', line 40
def snippet?
name == :snippet
end
|
#suffix ⇒ Object
18
|
# File 'lib/gitlab/repositories/repo_type.rb', line 18
def suffix = nil
|
#type_id ⇒ Object
24
25
26
|
# File 'lib/gitlab/repositories/repo_type.rb', line 24
def type_id
name.to_s
end
|
#valid?(repository_path) ⇒ Boolean
#wiki? ⇒ Boolean
32
33
34
|
# File 'lib/gitlab/repositories/repo_type.rb', line 32
def wiki?
name == :wiki
end
|