Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke "Jared" Bennett <lbennett@gitlab.com>2017-04-24 17:11:36 +0300
committerLuke "Jared" Bennett <lbennett@gitlab.com>2017-04-24 17:11:36 +0300
commit56ab571fd3b4c589e040b40cf9bd81044b5d8ee3 (patch)
tree2d106526d9a80ef446198a33b2265b74e53d50d6 /lib/container_registry/path.rb
parentf7723b8ebdc437feb731275d9a3cc109a6ce1761 (diff)
parentc768026474b9dff9f6f988372e4eefb85b1d8be9 (diff)
Merge branch 'master' into 20827-getting-started-update-new-group-view20827-getting-started-update-new-group-view
Diffstat (limited to 'lib/container_registry/path.rb')
-rw-r--r--lib/container_registry/path.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/container_registry/path.rb b/lib/container_registry/path.rb
index a4b5f2aba6c..61849a40383 100644
--- a/lib/container_registry/path.rb
+++ b/lib/container_registry/path.rb
@@ -15,7 +15,7 @@ module ContainerRegistry
LEVELS_SUPPORTED = 3
def initialize(path)
- @path = path
+ @path = path.to_s.downcase
end
def valid?
@@ -25,7 +25,7 @@ module ContainerRegistry
end
def components
- @components ||= @path.to_s.split('/')
+ @components ||= @path.split('/')
end
def nodes
@@ -48,7 +48,7 @@ module ContainerRegistry
end
def root_repository?
- @path == repository_project.full_path
+ @path == project_path
end
def repository_project
@@ -60,7 +60,13 @@ module ContainerRegistry
def repository_name
return unless has_project?
- @path.remove(%r(^#{Regexp.escape(repository_project.full_path)}/?))
+ @path.remove(%r(^#{Regexp.escape(project_path)}/?))
+ end
+
+ def project_path
+ return unless has_project?
+
+ repository_project.full_path.downcase
end
def to_s