diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-04-04 11:56:32 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-04-04 11:56:32 +0200 |
commit | 97c6cf59b361a0fe1b22cc999a2b2dd64b0a30f3 (patch) | |
tree | 0e9e97ea1e1af02ae179d9cac220e7cd501fc1e4 /lib/container_registry | |
parent | 7cf91f7b78225957d8b79e96f7d0080cdd15c0cd (diff) | |
download | gitlab-ce-97c6cf59b361a0fe1b22cc999a2b2dd64b0a30f3.tar.gz |
Swap method names in containe registry path class
Diffstat (limited to 'lib/container_registry')
-rw-r--r-- | lib/container_registry/path.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/container_registry/path.rb b/lib/container_registry/path.rb index f76c6489381..2291291d1fc 100644 --- a/lib/container_registry/path.rb +++ b/lib/container_registry/path.rb @@ -18,19 +18,19 @@ module ContainerRegistry def valid? @path =~ Gitlab::Regex.container_repository_name_regex && - nodes.size > 1 && - nodes.size < Namespace::NUMBER_OF_ANCESTORS_ALLOWED + components.size > 1 && + components.size < Namespace::NUMBER_OF_ANCESTORS_ALLOWED end - def nodes - @nodes ||= @path.to_s.split('/') + def components + @components ||= @path.to_s.split('/') end - def components + def nodes raise InvalidRegistryPathError unless valid? - @components ||= nodes.size.downto(2).map do |length| - nodes.take(length).join('/') + @nodes ||= components.size.downto(2).map do |length| + components.take(length).join('/') end end @@ -50,7 +50,7 @@ module ContainerRegistry end def repository_project - @project ||= Project.where_full_path_in(components.first(3)).first + @project ||= Project.where_full_path_in(nodes.first(3)).first end def repository_name |