Class: Katello::Mapping::ImageFactoryNaming
- Inherits:
-
Object
- Object
- Katello::Mapping::ImageFactoryNaming
- Defined in:
- app/lib/katello/mapping.rb
Class Method Summary collapse
Class Method Details
.translate(name = '', version = '') ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/lib/katello/mapping.rb', line 18 def self.translate(name = '', version = '') matched_name = "#{name} #{version}" naming = Mapping.configuration['imagefactory_naming'] || {} naming.each do |key, values| regexp_str = "^#{Regexp.escape(key).gsub('\*', '.*')}$" if Regexp.new(regexp_str) =~ matched_name return values.map(&:to_s) end end return [name.to_s, version.to_s] end |