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

namespace_sanitizer.rb « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d755bbbcaf91ba3d30049566e09672a5783f1044 (plain)
1
2
3
4
5
6
7
8
9
# frozen_string_literal: true

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