debian-mirror-gitlab/lib/gitlab/namespace_sanitizer.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

10 lines
179 B
Ruby
Raw Permalink Normal View History

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