diff options
Diffstat (limited to 'lib/gitlab_edition.rb')
-rw-r--r-- | lib/gitlab_edition.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/gitlab_edition.rb b/lib/gitlab_edition.rb index 02006148a34..5e3ed35ace4 100644 --- a/lib/gitlab_edition.rb +++ b/lib/gitlab_edition.rb @@ -7,6 +7,21 @@ module GitlabEdition Pathname.new(File.expand_path('..', __dir__)) end + def self.path_glob(path) + "#{root}/#{extension_path_prefixes}#{path}" + end + + def self.extension_path_prefixes + path_prefixes = extensions + return '' if path_prefixes.empty? + + path_prefixes.map! { "#{_1}/" } + path_prefixes.unshift '' + + # For example `{,ee/,jh/}` + "{#{path_prefixes.join(',')}}" + end + def self.extensions if jh? %w[ee jh] |