class Generator::TemplateDir
An extraction of the template file/directory for the generator… This way it can be separated, redefined, and tested.
Attributes
dir[R]
Public Class Methods
new(component)
click to toggle source
# File lib/ngi/generator.rb, line 58 def initialize(component) @dir = "#{Utils::CurrentDir.dir}/templates/" @dir << "#{component['type']}/#{component['language']}" @dir << "/#{component['using']}/#{component['template']}" end
Public Instance Methods
read()
click to toggle source
# File lib/ngi/generator.rb, line 64 def read f = File.open(@dir) content = f.read f.close content end