require "amrita/template" require "amrita/merge" include Amrita # This idea was suggested by Tom Sawyer tmpfile = "/tmp/html1.html" File::open(tmpfile, "w") do |f| f.write <<-END Insertable This will be replaced. END end tmpl = TemplateText.new <<-END Insertion MockUp This comes from a template fragment: This will be replaced. END m = MergeTemplate.new do { :hello=>"Hello World" } end model_data = { :data => m } tmpl.expand(STDOUT, model_data) File::unlink tmpfile __END__ the output of file2, when passed through Amrita, would then be: Insertion MockUp This comes from a template fragment: Hello World!