Class: Xcmake::PlistBuilder
- Inherits:
-
Object
- Object
- Xcmake::PlistBuilder
- Includes:
- Logger
- Defined in:
- lib/xcmake/source_builder/plist_builder.rb
Instance Method Summary collapse
- #build(params = {}) ⇒ Object
-
#initialize(template_path = nil) ⇒ PlistBuilder
constructor
A new instance of PlistBuilder.
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.("../../../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 |