gitlab-org--gitlab-foss/lib/gitlab/namespace_sanitizer.rb

10 lines
179 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module Gitlab
class NamespaceSanitizer
def self.sanitize(namespace)
namespace.gsub(/[^-a-z0-9]/, '-').gsub(/^-+/, '')
end
end
end