Method: Boxes::Environment#available_templates

Defined in:
lib/boxes/environment.rb

#available_templatesObject



11
12
13
14
15
16
17
18
19
# File 'lib/boxes/environment.rb', line 11

def available_templates
  t = Dir.glob("#{Boxes.config.working_dir}/templates/*/**")
  a = t.collect { |c| c.include?('preseed.cfg') ? next : c }.compact

  a.collect do |c|
    c = c.gsub(Boxes.config.working_dir.to_s + '/templates/', '')
    c.gsub('.erb', '')
  end
end