Class: Xcmake::PlistBuilder

Inherits:
Object
  • Object
show all
Includes:
Logger
Defined in:
lib/xcmake/source_builder/plist_builder.rb

Instance Method Summary collapse

Methods included from Logger

#log_error, #log_error!, #log_info

Constructor Details

#initialize(template_path = nil) ⇒ PlistBuilder

Returns a new instance of PlistBuilder.



7
8
9
10
11
# File 'lib/xcmake/source_builder/plist_builder.rb', line 7

def initialize(template_path=nil)
  template_path = template_path || File.expand_path("../../../templates/default.plist.erb", __dir__)
  log_error!("Template not found: #{template_path}") unless File.exist?(template_path)
  @template = File.read(template_path)
end

Instance Method Details

#build(params = {}) ⇒ Object



13
14
15
16
# File 'lib/xcmake/source_builder/plist_builder.rb', line 13

def build(params={})
  params = params
  ERB.new(@template, nil, "-").result(binding)
end