Class: XCBootstrap::Templates

Inherits:
Object
  • Object
show all
Defined in:
lib/xcbootstrap/templates.rb

Constant Summary collapse

TEMPLATE_ROOT =
File.expand_path(File.join(File.dirname(__FILE__), "../../templates"))

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(template_name) ⇒ Templates

Returns a new instance of Templates.



16
17
18
# File 'lib/xcbootstrap/templates.rb', line 16

def initialize(template_name)
  @template_name = template_name
end

Instance Attribute Details

#template_nameObject

Returns the value of attribute template_name.



8
9
10
# File 'lib/xcbootstrap/templates.rb', line 8

def template_name
  @template_name
end

Class Method Details

.all_templatesObject



10
11
12
13
14
# File 'lib/xcbootstrap/templates.rb', line 10

def self.all_templates
  Dir.glob("#{TEMPLATE_ROOT}/*").map do |template_path|
    template_name = File.basename(template_path)
  end
end

Instance Method Details

#manifestObject



24
25
26
# File 'lib/xcbootstrap/templates.rb', line 24

def manifest
  File.join(path, "manifest.yml")
end

#pathObject



20
21
22
# File 'lib/xcbootstrap/templates.rb', line 20

def path
  File.join(TEMPLATE_ROOT, template_name)
end