Class: Sle2Docker::Template
- Inherits:
-
Object
- Object
- Sle2Docker::Template
- Defined in:
- lib/sle2docker/template.rb
Class Method Summary collapse
Class Method Details
.list ⇒ Object
5 6 7 8 9 |
# File 'lib/sle2docker/template.rb', line 5 def self.list Dir[File.('../../templates/*', __FILE__)].map do |dir| File.basename(dir) end end |
.template_dir(template_name) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/sle2docker/template.rb', line 11 def self.template_dir(template_name) dir = File.("../../templates/#{template_name.upcase}", __FILE__) if !File.exists?(dir) raise TemplateNotFoundError.new("Cannot find template with name #{template_name}") end dir end |