Class: Gitlab::NamespaceSanitizer

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/namespace_sanitizer.rb

Class Method Summary collapse

Class Method Details

.sanitize(namespace) ⇒ Object


5
6
7
# File 'lib/gitlab/namespace_sanitizer.rb', line 5

def self.sanitize(namespace)
  namespace.gsub(/[^-a-z0-9]/, '-').gsub(/^-+/, '')
end