lib/bivouac/template.rb in bivouac-0.1.6 vs lib/bivouac/template.rb in bivouac-0.2.0
- old
+ new
@@ -62,16 +62,21 @@
src = File.dirname(__FILE__) + "/template/" + file
FileUtils::cp( src, dest )
end
end
- def template( template_name, b = nil )
- template_file = File.dirname(__FILE__) + "/template/" + template_name + ".rb"
+ def plugin_template( template_file, b = nil )
result = if b.nil?
ERB.new(File.readlines(template_file).join, nil, '-').result( )
else
ERB.new(File.readlines(template_file).join, nil, '-').result( b )
end
return( result )
+ end
+
+ def template( template_name, b = nil )
+ template_file = File.dirname(__FILE__) + "/template/" + template_name + ".rb"
+
+ return plugin_template( template_file, b )
end
end
end
\ No newline at end of file